blob: c343de510232426ee4a9aeb8ed583216d686e39a [file] [log] [blame]
Adam Ford59028792020-06-30 09:30:11 -05001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright 2020 Compass Electronics Group, LLC
4 */
5
6#include <common.h>
Simon Glass401d1c42020-10-30 21:38:53 -06007#include <asm/global_data.h>
Adam Ford59028792020-06-30 09:30:11 -05008#include <asm/io.h>
9#include <asm/arch/rcar-mstp.h>
10
11DECLARE_GLOBAL_DATA_PTR;
12
13void s_init(void)
14{
15}
16
17/* Kconfig forces this on, so just return 0 */
18int board_early_init_f(void)
19{
20 return 0;
21}
22
23int board_init(void)
24{
25 /* address of boot parameters */
26 gd->bd->bi_boot_params = CONFIG_SYS_TEXT_BASE + 0x50000;
27
28 return 0;
29}
30
31int dram_init(void)
32{
33 if (fdtdec_setup_mem_size_base() != 0)
34 return -EINVAL;
35
36 return 0;
37}
38
39int dram_init_banksize(void)
40{
41 fdtdec_setup_memory_banksize();
42
43 return 0;
44}
45
46#define RST_BASE 0xE6160000
47#define RST_CA57RESCNT (RST_BASE + 0x40)
48#define RST_CODE 0xA5A5000F
49
50void reset_cpu(ulong addr)
51{
52 writel(RST_CODE, RST_CA57RESCNT);
53}