blob: df6044a4297539d04b5589d22afdb4809a908c3e [file] [log] [blame]
Adam Ford38676882020-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 Glass3ba929a2020-10-30 21:38:53 -06007#include <asm/global_data.h>
Adam Ford38676882020-06-30 09:30:11 -05008#include <asm/io.h>
9#include <asm/arch/rcar-mstp.h>
10
11DECLARE_GLOBAL_DATA_PTR;
12
Adam Ford38676882020-06-30 09:30:11 -050013int board_init(void)
14{
15 /* address of boot parameters */
16 gd->bd->bi_boot_params = CONFIG_SYS_TEXT_BASE + 0x50000;
17
18 return 0;
19}
20
Adam Ford38676882020-06-30 09:30:11 -050021#define RST_BASE 0xE6160000
22#define RST_CA57RESCNT (RST_BASE + 0x40)
23#define RST_CODE 0xA5A5000F
24
Harald Seiler6f14d5f2020-12-15 16:47:52 +010025void reset_cpu(void)
Adam Ford38676882020-06-30 09:30:11 -050026{
27 writel(RST_CODE, RST_CA57RESCNT);
28}
Adam Ford2458e1a2021-09-20 11:14:27 -050029
30#if IS_ENABLED(CONFIG_MULTI_DTB_FIT)
31int board_fit_config_name_match(const char *name)
32{
33 if (!strcmp(rzg_get_cpu_name(), "R8A774A1") && !strcmp(name, "r8a774a1-beacon-rzg2m-kit"))
34 return 0;
35
36 if (!strcmp(rzg_get_cpu_name(), "R8A774B1") && !strcmp(name, "r8a774b1-beacon-rzg2n-kit"))
37 return 0;
38
39 if (!strcmp(rzg_get_cpu_name(), "R8A774E1") && !strcmp(name, "r8a774e1-beacon-rzg2h-kit"))
40 return 0;
41
42 return -1;
43}
44#endif