handoff.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Passing basic information from SPL to U-Boot proper
  4. *
  5. * Copyright 2018 Google, Inc
  6. */
  7. #ifndef __HANDOFF_H
  8. #define __HANDOFF_H
  9. #if CONFIG_IS_ENABLED(HANDOFF)
  10. #include <asm/handoff.h>
  11. /**
  12. * struct spl_handoff - information passed from SPL to U-Boot proper
  13. *
  14. * @ram_size: Value to use for gd->ram_size
  15. */
  16. struct spl_handoff {
  17. struct arch_spl_handoff arch;
  18. u64 ram_size;
  19. #ifdef CONFIG_NR_DRAM_BANKS
  20. struct {
  21. u64 start;
  22. u64 size;
  23. } ram_bank[CONFIG_NR_DRAM_BANKS];
  24. #endif
  25. };
  26. void handoff_save_dram(struct spl_handoff *ho);
  27. void handoff_load_dram_size(struct spl_handoff *ho);
  28. void handoff_load_dram_banks(struct spl_handoff *ho);
  29. /**
  30. * handoff_arch_save() - Save arch-specific info into the handoff area
  31. *
  32. * This is defined to an empty function by default, but arch-specific code can
  33. * define it to write to spi_handoff->arch. It is called from
  34. * write_spl_handoff().
  35. *
  36. * @ho: Handoff area to fill in
  37. * @return 0 if OK, -ve on error
  38. */
  39. int handoff_arch_save(struct spl_handoff *ho);
  40. #endif
  41. #endif