Skip to contentSkip to conversation

ARM: socfpga: Pull DRAM size from DT

PATCH New Marek Vasut 2 participants 2 messages May 29, 2018 – May 31, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: socfpga: Pull DRAM size from DT

Pull the DRAM size from DT instead of hardcoding it into U-Boot.

Cc Chin Liang See <[email protected]>
Cc Dinh Nguyen <[email protected]>
---
 arch/arm/mach-socfpga/misc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm/mach-socfpga/misc.c +3 -1
index fca86507f1..bc6097cb1f 100644
@@ -40,7 +40,9 @@ struct bsel bsel_str[] = {
 
 int dram_init(void)
 {
-	gd->ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE);
+	if (fdtdec_setup_memory_size() != 0)
+		return -EINVAL;
+
 	return 0;
 }
 
Signature · 1 line
2.17.0
#1 lore raw

PATCH 1/1 ARM: socfpga: Pull DRAM size from DT

Quoted 23 lines · Marek Vasut

Pull the DRAM size from DT instead of hardcoding it into U-Boot.

Cc Chin Liang See <[email protected]>
Cc Dinh Nguyen <[email protected]>

---
 arch/arm/mach-socfpga/misc.c | 4 +++-

 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm/mach- renamed from arch/arm/mach-socfpga/misc.c +0 -0

socfpga/misc.c
index fca86507f1..bc6097cb1f 100644

arch/arm/mach-socfpga/misc.c +0 -0
@@ -40,7 +40,9 @@ struct bsel bsel_str[] = {


 int dram_init(void)
 {

arch/arm/mach-socfpga/misc.c +0 -1
-	gd->ram_size = get_ram_size((long *)PHYS_SDRAM_1,

PHYS_SDRAM_1_SIZE);

arch/arm/mach-socfpga/misc.c +3 -0
+	if (fdtdec_setup_memory_size() != 0)
+		return -EINVAL;
+
Quoted 3 lines

  return 0;
 }

Thanks
Chin Liang