blob: 35ef9ff9e288e9b79b02a3677da8efa599a09f6b [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Patrice Chotard1e1d02d2017-09-13 18:00:12 +02002/*
Patrice Chotard789ee0e2017-10-23 09:53:58 +02003 * Copyright (C) 2017, STMicroelectronics - All Rights Reserved
Patrice Chotard5d9950d2020-12-02 18:47:30 +01004 * Author(s): Patrice Chotard, <patrice.chotard@foss.st.com> for STMicroelectronics.
Patrice Chotard1e1d02d2017-09-13 18:00:12 +02005 */
6
Patrice Chotard1e1d02d2017-09-13 18:00:12 +02007#include <dm.h>
Simon Glassa7b51302019-11-14 12:57:46 -07008#include <init.h>
Simon Glass0f2af882020-05-10 11:40:05 -06009#include <log.h>
Simon Glass3ba929a2020-10-30 21:38:53 -060010#include <asm/global_data.h>
Patrice Chotard1e1d02d2017-09-13 18:00:12 +020011
12DECLARE_GLOBAL_DATA_PTR;
13
14int 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 Paladugub3d55ea2018-07-16 15:56:11 +053025 if (fdtdec_setup_mem_size_base() != 0)
Patrice Chotard1e1d02d2017-09-13 18:00:12 +020026 ret = -EINVAL;
27
28 return ret;
29}
30
31int dram_init_banksize(void)
32{
33 fdtdec_setup_memory_banksize();
34
35 return 0;
36}
37
Patrice Chotard1e1d02d2017-09-13 18:00:12 +020038int board_init(void)
39{
Patrice Chotard1e1d02d2017-09-13 18:00:12 +020040 return 0;
41}