aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-stm32mp
diff options
context:
space:
mode:
authorPatrice Chotard <patrice.chotard@st.com>2023-10-27 16:42:57 +0200
committerPatrice Chotard <patrice.chotard@foss.st.com>2023-11-13 10:55:38 +0100
commitdba8d92a3da482f9e3d44181711ce4e08e2ac6b1 (patch)
tree451c51fba2f628ec11e005ea72ebb3c3fb09f671 /arch/arm/mach-stm32mp
parent2f9886c66864ffc52f6a7ab5be9be97fec47ef1d (diff)
downloadu-boot-dba8d92a3da482f9e3d44181711ce4e08e2ac6b1.zip
u-boot-dba8d92a3da482f9e3d44181711ce4e08e2ac6b1.tar.gz
u-boot-dba8d92a3da482f9e3d44181711ce4e08e2ac6b1.tar.bz2
stm32mp: dram_init: Get RAM size from DT if no RAM driver found
In case there is no RAM driver retrieve RAM size from DT as fallback. Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Diffstat (limited to 'arch/arm/mach-stm32mp')
-rw-r--r--arch/arm/mach-stm32mp/dram_init.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/arm/mach-stm32mp/dram_init.c b/arch/arm/mach-stm32mp/dram_init.c
index 7f37b0d..a1e77a4 100644
--- a/arch/arm/mach-stm32mp/dram_init.c
+++ b/arch/arm/mach-stm32mp/dram_init.c
@@ -24,8 +24,11 @@ int dram_init(void)
int ret;
ret = uclass_get_device(UCLASS_RAM, 0, &dev);
- if (ret) {
- log_debug("RAM init failed: %d\n", ret);
+ /* in case there is no RAM driver, retrieve DDR size from DT */
+ if (ret == -ENODEV) {
+ return fdtdec_setup_mem_size_base();
+ } else if (ret) {
+ log_err("RAM init failed: %d\n", ret);
return ret;
}
ret = ram_get_info(dev, &ram);