gen3-spl.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 <asm/io.h>
  10. #include <spl.h>
  11. #define RCAR_CNTC_BASE 0xE6080000
  12. #define CNTCR_EN BIT(0)
  13. void board_init_f(ulong dummy)
  14. {
  15. writel(CNTCR_EN, RCAR_CNTC_BASE);
  16. timer_init();
  17. }
  18. void spl_board_init(void)
  19. {
  20. /* UART clocks enabled and gd valid - init serial console */
  21. preloader_console_init();
  22. }
  23. u32 spl_boot_device(void)
  24. {
  25. return BOOT_DEVICE_UART;
  26. }
  27. void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
  28. {
  29. debug("image entry point: 0x%lx\n", spl_image->entry_point);
  30. if (spl_image->os == IH_OS_ARM_TRUSTED_FIRMWARE) {
  31. typedef void (*image_entry_arg_t)(int, int, int, int)
  32. __attribute__ ((noreturn));
  33. image_entry_arg_t image_entry =
  34. (image_entry_arg_t)(uintptr_t) spl_image->entry_point;
  35. image_entry(IH_MAGIC, CONFIG_SPL_TEXT_BASE, 0, 0);
  36. } else {
  37. typedef void __noreturn (*image_entry_noargs_t)(void);
  38. image_entry_noargs_t image_entry =
  39. (image_entry_noargs_t)spl_image->entry_point;
  40. image_entry();
  41. }
  42. }
  43. void s_init(void)
  44. {
  45. }
  46. void reset_cpu(ulong addr)
  47. {
  48. }