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