gen3-spl.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * R-Car Gen3 recovery SPL
  4. *
  5. * Copyright (C) 2019 Marek Vasut <marek.vasut@gmail.com>
  6. */
  7. #include <common.h>
  8. #include <cpu_func.h>
  9. #include <image.h>
  10. #include <init.h>
  11. #include <log.h>
  12. #include <asm/io.h>
  13. #include <spl.h>
  14. #include <linux/bitops.h>
  15. #define RCAR_CNTC_BASE 0xE6080000
  16. #define CNTCR_EN BIT(0)
  17. void board_init_f(ulong dummy)
  18. {
  19. writel(CNTCR_EN, RCAR_CNTC_BASE);
  20. timer_init();
  21. }
  22. void spl_board_init(void)
  23. {
  24. /* UART clocks enabled and gd valid - init serial console */
  25. preloader_console_init();
  26. }
  27. u32 spl_boot_device(void)
  28. {
  29. return BOOT_DEVICE_UART;
  30. }
  31. void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
  32. {
  33. debug("image entry point: 0x%lx\n", spl_image->entry_point);
  34. if (spl_image->os == IH_OS_ARM_TRUSTED_FIRMWARE) {
  35. typedef void (*image_entry_arg_t)(int, int, int, int)
  36. __attribute__ ((noreturn));
  37. image_entry_arg_t image_entry =
  38. (image_entry_arg_t)(uintptr_t) spl_image->entry_point;
  39. image_entry(IH_MAGIC, CONFIG_SPL_TEXT_BASE, 0, 0);
  40. } else {
  41. typedef void __noreturn (*image_entry_noargs_t)(void);
  42. image_entry_noargs_t image_entry =
  43. (image_entry_noargs_t)spl_image->entry_point;
  44. image_entry();
  45. }
  46. }
  47. void s_init(void)
  48. {
  49. }
  50. void reset_cpu(ulong addr)
  51. {
  52. }