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