Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame^] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Patrice Chotard | 246771b | 2017-09-13 18:00:12 +0200 | [diff] [blame] | 2 | /* |
Patrice Chotard | 3bc599c | 2017-10-23 09:53:58 +0200 | [diff] [blame] | 3 | * Copyright (C) 2017, STMicroelectronics - All Rights Reserved |
| 4 | * Author(s): Patrice Chotard, <patrice.chotard@st.com> for STMicroelectronics. |
Patrice Chotard | 246771b | 2017-09-13 18:00:12 +0200 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <dm.h> |
| 9 | |
| 10 | DECLARE_GLOBAL_DATA_PTR; |
| 11 | |
| 12 | int dram_init(void) |
| 13 | { |
| 14 | struct udevice *dev; |
| 15 | int ret; |
| 16 | |
| 17 | ret = uclass_get_device(UCLASS_RAM, 0, &dev); |
| 18 | if (ret) { |
| 19 | debug("DRAM init failed: %d\n", ret); |
| 20 | return ret; |
| 21 | } |
| 22 | |
| 23 | if (fdtdec_setup_memory_size() != 0) |
| 24 | ret = -EINVAL; |
| 25 | |
| 26 | return ret; |
| 27 | } |
| 28 | |
| 29 | int dram_init_banksize(void) |
| 30 | { |
| 31 | fdtdec_setup_memory_banksize(); |
| 32 | |
| 33 | return 0; |
| 34 | } |
| 35 | |
| 36 | int board_early_init_f(void) |
| 37 | { |
| 38 | return 0; |
| 39 | } |
| 40 | |
| 41 | u32 get_board_rev(void) |
| 42 | { |
| 43 | return 0; |
| 44 | } |
| 45 | |
| 46 | int board_late_init(void) |
| 47 | { |
| 48 | return 0; |
| 49 | } |
| 50 | |
| 51 | int board_init(void) |
| 52 | { |
| 53 | gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100; |
| 54 | return 0; |
| 55 | } |