spl.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (c) Aspeed Technology Inc.
  4. */
  5. #include <common.h>
  6. #include <debug_uart.h>
  7. #include <dm.h>
  8. #include <spl.h>
  9. #include <init.h>
  10. #include <asm/io.h>
  11. #include <asm/arch/scu_ast2600.h>
  12. DECLARE_GLOBAL_DATA_PTR;
  13. void board_init_f(ulong dummy)
  14. {
  15. spl_early_init();
  16. preloader_console_init();
  17. timer_init();
  18. dram_init();
  19. }
  20. u32 spl_boot_device(void)
  21. {
  22. return BOOT_DEVICE_RAM;
  23. }
  24. struct image_header *spl_get_load_buffer(ssize_t offset, size_t size)
  25. {
  26. /*
  27. * When boot from SPI, AST2600 already remap 0x00000000 ~ 0x0fffffff
  28. * to BMC SPI memory space 0x20000000 ~ 0x2fffffff. The next stage BL
  29. * has been located in SPI for XIP. In this case, the load buffer for
  30. * SPL image loading will be set to the remapped address of the next
  31. * BL instead of the DRAM space CONFIG_SYS_LOAD_ADDR
  32. */
  33. return (struct image_header *)(CONFIG_SYS_TEXT_BASE);
  34. }
  35. #ifdef CONFIG_SPL_OS_BOOT
  36. int spl_start_uboot(void)
  37. {
  38. /* boot linux */
  39. return 0;
  40. }
  41. #endif
  42. #ifdef CONFIG_SPL_LOAD_FIT
  43. int board_fit_config_name_match(const char *name)
  44. {
  45. /* just empty function now - can't decide what to choose */
  46. debug("%s: %s\n", __func__, name);
  47. return 0;
  48. }
  49. #endif