spl.c 966 B

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