mrc_common.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (c) 2016 Google, Inc
  4. */
  5. #ifndef __ASM_MRC_COMMON_H
  6. #define __ASM_MRC_COMMON_H
  7. #include <linux/linkage.h>
  8. /**
  9. * mrc_common_init() - Set up SDRAM
  10. *
  11. * This calls the memory reference code (MRC) to set up SDRAM
  12. *
  13. * @dev: Northbridge device
  14. * @pei_data: Platform-specific data required by the MRC
  15. * @use_asm_linkage: true if the call to MRC requires asmlinkage, false if it
  16. * uses normal U-Boot calling
  17. * @return 0 if OK, -ve on error
  18. */
  19. int mrc_common_init(struct udevice *dev, void *pei_data, bool use_asm_linkage);
  20. asmlinkage void sdram_console_tx_byte(unsigned char byte);
  21. int mrc_locate_spd(struct udevice *dev, int size, const void **spd_datap);
  22. void report_memory_config(void);
  23. /**
  24. * mrc_add_memory_area() - Add a new usable memory area to our list
  25. *
  26. * Note: @start and @end must not span the first 4GB boundary
  27. *
  28. * @info: Place to store memory info
  29. * @start: Start of this memory area
  30. * @end: End of this memory area + 1
  31. */
  32. int mrc_add_memory_area(struct memory_info *info, uint64_t start,
  33. uint64_t end);
  34. /*
  35. * This function looks for the highest region of memory lower than 4GB which
  36. * has enough space for U-Boot where U-Boot is aligned on a page boundary.
  37. * It overrides the default implementation found elsewhere which simply
  38. * picks the end of ram, wherever that may be. The location of the stack,
  39. * the relocation address, and how far U-Boot is moved by relocation are
  40. * set in the global data structure.
  41. */
  42. ulong mrc_common_board_get_usable_ram_top(ulong total_size);
  43. void mrc_common_dram_init_banksize(void);
  44. #endif