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 | |
| 13 | void s_init(void) |
| 14 | { |
| 15 | } |
| 16 | |
| 17 | /* Kconfig forces this on, so just return 0 */ |
| 18 | int board_early_init_f(void) |
| 19 | { |
| 20 | return 0; |
| 21 | } |
| 22 | |
| 23 | int 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 | |
| 31 | int dram_init(void) |
| 32 | { |
| 33 | if (fdtdec_setup_mem_size_base() != 0) |
| 34 | return -EINVAL; |
| 35 | |
| 36 | return 0; |
| 37 | } |
| 38 | |
| 39 | int 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 | |
| 50 | void reset_cpu(ulong addr) |
| 51 | { |
| 52 | writel(RST_CODE, RST_CA57RESCNT); |
| 53 | } |