spl.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 <command.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. }
  43. int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
  44. {
  45. __asm__ __volatile__ ("mts rmsr, r0;" \
  46. "bra r0");
  47. return 0;
  48. }