spl.c 981 B

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