spl.c 959 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * (C) Copyright 2013 - 2014 Xilinx, Inc
  4. *
  5. * Michal Simek <michal.simek@xilinx.com>
  6. */
  7. #include <common.h>
  8. #include <image.h>
  9. #include <spl.h>
  10. #include <asm/io.h>
  11. #include <asm/u-boot.h>
  12. bool boot_linux;
  13. u32 spl_boot_device(void)
  14. {
  15. return BOOT_DEVICE_NOR;
  16. }
  17. /* Board initialization after bss clearance */
  18. void spl_board_init(void)
  19. {
  20. /* enable console uart printing */
  21. preloader_console_init();
  22. }
  23. #ifdef CONFIG_SPL_OS_BOOT
  24. void __noreturn jump_to_image_linux(struct spl_image_info *spl_image)
  25. {
  26. debug("Entering kernel arg pointer: 0x%p\n", spl_image->arg);
  27. typedef void (*image_entry_arg_t)(char *, ulong, ulong)
  28. __attribute__ ((noreturn));
  29. image_entry_arg_t image_entry =
  30. (image_entry_arg_t)spl_image->entry_point;
  31. image_entry(NULL, 0, (ulong)spl_image->arg);
  32. }
  33. #endif /* CONFIG_SPL_OS_BOOT */
  34. int spl_start_uboot(void)
  35. {
  36. #ifdef CONFIG_SPL_OS_BOOT
  37. if (boot_linux)
  38. return 0;
  39. #endif
  40. return 1;
  41. }