Skip to contentSkip to conversation

Altera SoCFpga Boot Stall Fix

PATCH Superseded Brian Sune 1 participant 2 messages Oct 19, 2025

Subsystems (3)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Brian Sune

author
#0 lore raw

PATCH 1/1 Altera SoCFpga Boot Stall Fix

From: tg5 <[email protected]>

Since U-Boot 2025.07 pure SD Card
boot no longer works. Now Altera released 2025.07 shows the different on the u-boot files. After testing, the major root case is get_managers_addr. And this patch fix the SD boot stall via pulling from offical.

---
 arch/arm/mach-socfpga/misc.c | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)
arch/arm/mach-socfpga/misc.c +22 -3
index 97e01140513..11ab8f17489 100644
@@ -177,7 +177,10 @@ int arch_cpu_init(void)
 	 * timeout value is still active which might too short for Linux
 	 * booting.
 	 */
+#if !(IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5_SIMICS) || \
+	IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5_EMU))
 	hw_watchdog_init();
+#endif
 #else
 	/*
 	 * If the HW watchdog is NOT enabled, make sure it is not running,
@@ -222,8 +225,16 @@ static int do_bridge(struct cmd_tbl *cmdtp, int flag, int argc,
 
 U_BOOT_CMD(bridge, 3, 1, do_bridge,
 	   "SoCFPGA HPS FPGA bridge control",
-	   "enable [mask] - Enable HPS-to-FPGA, FPGA-to-HPS, LWHPS-to-FPGA bridges\n"
-	   "bridge disable [mask] - Enable HPS-to-FPGA, FPGA-to-HPS, LWHPS-to-FPGA bridges\n"
+	   "enable [mask] - Enable HPS-to-FPGA (Bit 0), LWHPS-to-FPGA (Bit 1), FPGA-to-HPS (Bit 2), F2SDRAM0 (Bit 3), F2SDRAM1 (Bit 4), F2SDRAM2 (Bit 5) bridges\n"
+	   "bridge disable [mask] - Disable HPS-to-FPGA (Bit 0), LWHPS-to-FPGA (Bit 1), FPGA-to-HPS (Bit 2), F2SDRAM0 (Bit 3), F2SDRAM1 (Bit 4), F2SDRAM2 (Bit 5) bridges\n"
+	   "Bit 3, Bit 4 and Bit 5 bridges only available in Stratix 10\n"
+	   "For example:\n"
+	   "1) To enable and disable all bridges (command without mask):\n"
+	   "	a) bridge enable\n"
+	   "	b) bridge disable\n"
+	   "2) To enable and disable HPS-to-FPGA and LWHPS-to-FPGA bridges (command with mask):\n"
+	   "	a) bridge enable 0x3\n"
+	   "	b) bridge disable 0x3\n"
 	   ""
 );
 
@@ -260,7 +271,15 @@ void socfpga_get_managers_addr(void)
 	if (ret)
 		hang();
 
-	if (IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX))
+	if (!IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5)) {
+		ret = socfpga_get_base_addr("altr,sys-mgr",
+					    &socfpga_sysmgr_base);
+		if (ret)
+			hang();
+	}
+
+	if (IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX) ||
+	    IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX7M))
 		ret = socfpga_get_base_addr("intel,agilex-clkmgr",
 					    &socfpga_clkmgr_base);
 	else if (IS_ENABLED(CONFIG_TARGET_SOCFPGA_N5X))
Signature · 1 line
2.25.1
author
#1 lore raw

Brian Sune <[email protected]> 於 2025年10月19日 週日 下午5:23寫道:

Quoted 14 lines
arch/arm/mach-socfpga/misc.c +9 -2
-       if (IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX))
+       if (!IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5)) {
+               ret = socfpga_get_base_addr("altr,sys-mgr",
+                                           &socfpga_sysmgr_base);
+               if (ret)
+                       hang();
+       }
+
+       if (IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX) ||
+           IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX7M))
                ret = socfpga_get_base_addr("intel,agilex-clkmgr",
                                            &socfpga_clkmgr_base);
        else if (IS_ENABLED(CONFIG_TARGET_SOCFPGA_N5X))
--
Quoted 2 lines

2.25.1

Explain a bit more, and correct me if wrong.
Under investigation on different revision.

"Commit 3563817"
The base address of system manager can be retrieved using DT framework through the System Manager driver.

However this is completely wrong on simply removing the inline from first place! ret = socfpga_get_base_addr("altr,sys-mgr", &socfpga_sysmgr_base); if (ret)
hang();

In consequence, simply support Agliex series and w/o consider old series of socfpga breaks the boot and stall the HPS. I highly suspect either NOR or SDMMC should also stall no matter how. B.C. the sys-mgr never setup.