Adam Ford | 3867688 | 2020-06-30 09:30:11 -0500 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * Copyright 2020 Compass Electronics Group, LLC |
| 4 | */ |
| 5 | |
| 6 | #include <common.h> |
Simon Glass | 3ba929a | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 7 | #include <asm/global_data.h> |
Adam Ford | 3867688 | 2020-06-30 09:30:11 -0500 | [diff] [blame] | 8 | #include <asm/io.h> |
| 9 | #include <asm/arch/rcar-mstp.h> |
| 10 | |
| 11 | DECLARE_GLOBAL_DATA_PTR; |
| 12 | |
Adam Ford | 3867688 | 2020-06-30 09:30:11 -0500 | [diff] [blame] | 13 | int 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 Ford | 3867688 | 2020-06-30 09:30:11 -0500 | [diff] [blame] | 21 | #define RST_BASE 0xE6160000 |
| 22 | #define RST_CA57RESCNT (RST_BASE + 0x40) |
| 23 | #define RST_CODE 0xA5A5000F |
| 24 | |
Harald Seiler | 6f14d5f | 2020-12-15 16:47:52 +0100 | [diff] [blame] | 25 | void reset_cpu(void) |
Adam Ford | 3867688 | 2020-06-30 09:30:11 -0500 | [diff] [blame] | 26 | { |
| 27 | writel(RST_CODE, RST_CA57RESCNT); |
| 28 | } |
Adam Ford | 2458e1a | 2021-09-20 11:14:27 -0500 | [diff] [blame] | 29 | |
| 30 | #if IS_ENABLED(CONFIG_MULTI_DTB_FIT) |
| 31 | int 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 |