Skip to contentSkip to conversation

arm: mvebu: Hang if ddr3_init() fails

PATCH In review Pali Rohár 2 participants 3 messages Aug 9, 2021 – Aug 11, 2021

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

PATCH 1/1 arm: mvebu: Hang if ddr3_init() fails

If ddr3_init() fails then DDR was not initialized and we cannot load and execute U-Boot. We cannot continue, we cannot do anything in this case, so hang.

---
 arch/arm/mach-mvebu/spl.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
arch/arm/mach-mvebu/spl.c +5 -1
index 3b6bc3897090..f0cf60bb1488 100644
@@ -345,7 +345,11 @@ void board_init_f(ulong dummy)
 	serdes_phy_config();
 
 	/* Setup DDR */
-	ddr3_init();
+	ret = ddr3_init();
+	if (ret) {
+		debug("ddr3_init() failed: %d\n", ret);
+		hang();
+	}
 #endif
 
 	/* Initialize Auto Voltage Scaling */
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Pali Rohár

If ddr3_init() fails then DDR was not initialized and we cannot load and execute U-Boot. We cannot continue, we cannot do anything in this case, so hang.

Thanks,
Stefan

Quoted 12 lines
---
  arch/arm/mach-mvebu/spl.c | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)
arch/arm/mach-mvebu/spl.c +0 -0
index 3b6bc3897090..f0cf60bb1488 100644
@@ -345,7 +345,11 @@ void board_init_f(ulong dummy)
  	serdes_phy_config();
 

arch/arm/mach-mvebu/spl.c void board_init_f(ulong dummy) · line 355

Quoted 10 lines
arch/arm/mach-mvebu/spl.c +5 -1
  	/* Setup DDR */
-	ddr3_init();
+	ret = ddr3_init();
+	if (ret) {
+		debug("ddr3_init() failed: %d\n", ret);
+		hang();
+	}
  #endif
 
  	/* Initialize Auto Voltage Scaling */

Viele Grüße,
Stefan

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
#2 lore raw
In reply to Pali Rohár
Quoted 5 lines · Pali Rohár

If ddr3_init() fails then DDR was not initialized and we cannot load and execute U-Boot. We cannot continue, we cannot do anything in this case, so hang.

Applied to u-boot-marvell/master

Thanks,
Stefan

Quoted 12 lines
---
  arch/arm/mach-mvebu/spl.c | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)
arch/arm/mach-mvebu/spl.c +0 -0
index 3b6bc3897090..f0cf60bb1488 100644
@@ -345,7 +345,11 @@ void board_init_f(ulong dummy)
  	serdes_phy_config();
 

arch/arm/mach-mvebu/spl.c void board_init_f(ulong dummy) · line 355

Quoted 10 lines
arch/arm/mach-mvebu/spl.c +5 -1
  	/* Setup DDR */
-	ddr3_init();
+	ret = ddr3_init();
+	if (ret) {
+		debug("ddr3_init() failed: %d\n", ret);
+		hang();
+	}
  #endif
 
  	/* Initialize Auto Voltage Scaling */

Viele Grüße,
Stefan

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]