spl.c 1005 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 <version.h>
  12. #include <asm/io.h>
  13. #include <asm/u-boot.h>
  14. DECLARE_GLOBAL_DATA_PTR;
  15. bool boot_linux;
  16. u32 spl_boot_device(void)
  17. {
  18. return BOOT_DEVICE_NOR;
  19. }
  20. /* Board initialization after bss clearance */
  21. void spl_board_init(void)
  22. {
  23. gd = (gd_t *)CONFIG_SPL_STACK_ADDR;
  24. /* enable console uart printing */
  25. preloader_console_init();
  26. }
  27. #ifdef CONFIG_SPL_OS_BOOT
  28. void __noreturn jump_to_image_linux(void *arg)
  29. {
  30. debug("Entering kernel arg pointer: 0x%p\n", arg);
  31. typedef void (*image_entry_arg_t)(char *, ulong, ulong)
  32. __attribute__ ((noreturn));
  33. image_entry_arg_t image_entry =
  34. (image_entry_arg_t)spl_image.entry_point;
  35. image_entry(NULL, 0, (ulong)arg);
  36. }
  37. #endif /* CONFIG_SPL_OS_BOOT */
  38. int spl_start_uboot(void)
  39. {
  40. #ifdef CONFIG_SPL_OS_BOOT
  41. if (boot_linux)
  42. return 0;
  43. #endif
  44. return 1;
  45. }