mrc_common.h 1.6 KB

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