spl.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. #include <asm/global_data.h>
  13. DECLARE_GLOBAL_DATA_PTR;
  14. void board_init_f(ulong dummy)
  15. {
  16. spl_early_init();
  17. preloader_console_init();
  18. timer_init();
  19. dram_init();
  20. }
  21. u32 spl_boot_device(void)
  22. {
  23. return BOOT_DEVICE_RAM;
  24. }
  25. struct image_header *spl_get_load_buffer(ssize_t offset, size_t size)
  26. {
  27. /*
  28. * When boot from SPI, AST2600 already remap 0x00000000 ~ 0x0fffffff
  29. * to BMC SPI memory space 0x20000000 ~ 0x2fffffff. The next stage BL
  30. * has been located in SPI for XIP. In this case, the load buffer for
  31. * SPL image loading will be set to the remapped address of the next
  32. * BL instead of the DRAM space CONFIG_SYS_LOAD_ADDR
  33. */
  34. return (struct image_header *)(CONFIG_SYS_TEXT_BASE);
  35. }
  36. #ifdef CONFIG_SPL_OS_BOOT
  37. int spl_start_uboot(void)
  38. {
  39. /* boot linux */
  40. return 0;
  41. }
  42. #endif
  43. #ifdef CONFIG_SPL_LOAD_FIT
  44. int board_fit_config_name_match(const char *name)
  45. {
  46. /* just empty function now - can't decide what to choose */
  47. debug("%s: %s\n", __func__, name);
  48. return 0;
  49. }
  50. #endif