sdram.c 518 B

12345678910111213141516171819202122232425262728293031
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (c) 2015 Google, Inc
  4. */
  5. #include <common.h>
  6. #include <efi.h>
  7. #include <init.h>
  8. #include <asm/u-boot-x86.h>
  9. DECLARE_GLOBAL_DATA_PTR;
  10. ulong board_get_usable_ram_top(ulong total_size)
  11. {
  12. return (ulong)efi_get_ram_base() + gd->ram_size;
  13. }
  14. int dram_init(void)
  15. {
  16. /* gd->ram_size is set as part of EFI init */
  17. return 0;
  18. }
  19. int dram_init_banksize(void)
  20. {
  21. gd->bd->bi_dram[0].start = efi_get_ram_base();
  22. gd->bd->bi_dram[0].size = CONFIG_EFI_RAM_SIZE;
  23. return 0;
  24. }