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> |
| 7 | #include <asm/io.h> |
| 8 | #include <asm/arch/rcar-mstp.h> |
| 9 | |
| 10 | DECLARE_GLOBAL_DATA_PTR; |
| 11 | |
| 12 | void s_init(void) |
| 13 | { |
| 14 | } |
| 15 | |
| 16 | /* Kconfig forces this on, so just return 0 */ |
| 17 | int board_early_init_f(void) |
| 18 | { |
| 19 | return 0; |
| 20 | } |
| 21 | |
| 22 | int board_init(void) |
| 23 | { |
| 24 | /* address of boot parameters */ |
| 25 | gd->bd->bi_boot_params = CONFIG_SYS_TEXT_BASE + 0x50000; |
| 26 | |
| 27 | return 0; |
| 28 | } |
| 29 | |
| 30 | int dram_init(void) |
| 31 | { |
| 32 | if (fdtdec_setup_mem_size_base() != 0) |
| 33 | return -EINVAL; |
| 34 | |
| 35 | return 0; |
| 36 | } |
| 37 | |
| 38 | int dram_init_banksize(void) |
| 39 | { |
| 40 | fdtdec_setup_memory_banksize(); |
| 41 | |
| 42 | return 0; |
| 43 | } |
| 44 | |
| 45 | #define RST_BASE 0xE6160000 |
| 46 | #define RST_CA57RESCNT (RST_BASE + 0x40) |
| 47 | #define RST_CODE 0xA5A5000F |
| 48 | |
| 49 | void reset_cpu(ulong addr) |
| 50 | { |
| 51 | writel(RST_CODE, RST_CA57RESCNT); |
| 52 | } |