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