Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Patrice Chotard | 1e1d02d | 2017-09-13 18:00:12 +0200 | [diff] [blame] | 2 | /* |
Patrice Chotard | 789ee0e | 2017-10-23 09:53:58 +0200 | [diff] [blame] | 3 | * Copyright (C) 2017, STMicroelectronics - All Rights Reserved |
Patrice Chotard | 5d9950d | 2020-12-02 18:47:30 +0100 | [diff] [blame] | 4 | * Author(s): Patrice Chotard, <patrice.chotard@foss.st.com> for STMicroelectronics. |
Patrice Chotard | 1e1d02d | 2017-09-13 18:00:12 +0200 | [diff] [blame] | 5 | */ |
| 6 | |
Patrice Chotard | 1e1d02d | 2017-09-13 18:00:12 +0200 | [diff] [blame] | 7 | #include <dm.h> |
Simon Glass | a7b5130 | 2019-11-14 12:57:46 -0700 | [diff] [blame] | 8 | #include <init.h> |
Simon Glass | 0f2af88 | 2020-05-10 11:40:05 -0600 | [diff] [blame] | 9 | #include <log.h> |
Simon Glass | 3ba929a | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 10 | #include <asm/global_data.h> |
Patrice Chotard | 1e1d02d | 2017-09-13 18:00:12 +0200 | [diff] [blame] | 11 | |
| 12 | DECLARE_GLOBAL_DATA_PTR; |
| 13 | |
| 14 | int dram_init(void) |
| 15 | { |
| 16 | struct udevice *dev; |
| 17 | int ret; |
| 18 | |
| 19 | ret = uclass_get_device(UCLASS_RAM, 0, &dev); |
| 20 | if (ret) { |
| 21 | debug("DRAM init failed: %d\n", ret); |
| 22 | return ret; |
| 23 | } |
| 24 | |
Siva Durga Prasad Paladugu | b3d55ea | 2018-07-16 15:56:11 +0530 | [diff] [blame] | 25 | if (fdtdec_setup_mem_size_base() != 0) |
Patrice Chotard | 1e1d02d | 2017-09-13 18:00:12 +0200 | [diff] [blame] | 26 | ret = -EINVAL; |
| 27 | |
| 28 | return ret; |
| 29 | } |
| 30 | |
| 31 | int dram_init_banksize(void) |
| 32 | { |
| 33 | fdtdec_setup_memory_banksize(); |
| 34 | |
| 35 | return 0; |
| 36 | } |
| 37 | |
Patrice Chotard | 1e1d02d | 2017-09-13 18:00:12 +0200 | [diff] [blame] | 38 | int board_init(void) |
| 39 | { |
Patrice Chotard | 1e1d02d | 2017-09-13 18:00:12 +0200 | [diff] [blame] | 40 | return 0; |
| 41 | } |