Skip to contentSkip to conversation

SDRAM Calibration Failed fix for GEN5 SoCFPGA

PATCH Superseded Brian Sune 2 participants 7 messages Nov 25, 2025 – Nov 26, 2025

Subsystems (3)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Brian Sune

author
#0 lore raw

PATCH v3 1/1 SDRAM Calibration Failed fix for GEN5 SoCFPGA

New SPL introduce cyclic and without initial
the interrupt of SDRAM calibration could fail.
Initialize the default CYCLIC setup fix it.

---
 arch/arm/mach-socfpga/Kconfig | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach-socfpga/Kconfig +3 -0
index f2e959b5662..a06b677787d 100644
@@ -117,6 +117,9 @@ config TARGET_SOCFPGA_CYCLONE5
 
 config TARGET_SOCFPGA_GEN5
 	bool
+	select CMD_CYCLIC
+	select CYCLIC
+	select SPL_CYCLIC
 	select SPL_ALTERA_SDRAM
 	imply FPGA_SOCFPGA
 	imply SPL_SIZE_LIMIT_SUBTRACT_GD
Signature · 1 line
2.34.1
#1 lore raw

Hi Brian,

Quoted 2 lines · Brian Sune

New SPL introduce cyclic and without initial
the interrupt of SDRAM calibration could fail.

Are you even sure SPL_CYCLIC is required? Wouldn't enabling CYCLIC be enough?

Since you have not identified the root issue yet, can you please provide the actual defconfig used before this change so we can figure out what is happening, if other boards are impacted and how to fix it properly so this possible misconfiguration cannot happen anymore?

Quoted 12 lines

Initialize the default CYCLIC setup fix it.

---
  arch/arm/mach-socfpga/Kconfig | 3 +++
  1 file changed, 3 insertions(+)
arch/arm/mach-socfpga/Kconfig +0 -0
index f2e959b5662..a06b677787d 100644

arch/arm/mach-socfpga/Kconfig config TARGET_SOCFPGA_CYCLONE5 · line 120

Quoted 4 lines
arch/arm/mach-socfpga/Kconfig +1 -0
@@ -117,6 +117,9 @@ config TARGET_SOCFPGA_CYCLONE5
 
  config TARGET_SOCFPGA_GEN5
  	bool
+	select CMD_CYCLIC

I don't think you **need** a U-Boot command to be available to unbreak your device?

Cheers,
Quentin

author
#2 lore raw
Quoted 2 lines

Are you even sure SPL_CYCLIC is required? Wouldn't enabling CYCLIC be enough?

Short test answer is no. SPL_CYCLIC must be init with default timeout #.

Quoted 4 lines

Since you have not identified the root issue yet, can you please provide the actual defconfig used before this change so we can figure out what is happening, if other boards are impacted and how to fix it properly so this possible misconfiguration cannot happen anymore?

socfpga_cyclone5_defconfig

But my patch did not target ONE config file. Because the risk or possible hazard could happen on other GEN5 socfpga. Need others to report btw. b.c. it requires complete fresh build to trigger possibly.

New patch V4 had pushed. CMD CYCLIC seems like not a must.

Brian

#3 lore raw

Hi Brian,

Quoted 12 lines · Sune Brian
Quoted 2 lines

Are you even sure SPL_CYCLIC is required? Wouldn't enabling CYCLIC be enough?

Short test answer is no. SPL_CYCLIC must be init with default timeout #.

Quoted 4 lines

Since you have not identified the root issue yet, can you please provide the actual defconfig used before this change so we can figure out what is happening, if other boards are impacted and how to fix it properly so this possible misconfiguration cannot happen anymore?

socfpga_cyclone5_defconfig

So, this does NOT enable WDT or WATCHDOG. It does force SPL_WATCHDOG on but that doesn't seem to do anything except if SPL_WDT is also set, in which case it'll then selects SPL_CYCLIC automatically. Can you walk us step by step through how you get this into this broken state?

git clone https://source.denx.de/u-boot/u-boot.git
cd u-boot
git checkout origin/master
make CROSS_COMPILE=arm-linux-gnu- socfpga_cyclone5_defconfig and then...?

Does it happen with the default socfpga_cyclone5_defconfig defconfig?

What do you do next? Do you run "make menuconfig" to enable/disable some options? Which ones?

Quoted 2 lines

But my patch did not target ONE config file. Because the risk or possible hazard could happen on other GEN5 socfpga. Need others to report btw.

Yes, but I only want at least one board this happens on so we can try figure out exactly what happens with this watchdog.

Quoted 2 lines

b.c. it requires complete fresh build to trigger possibly.

What do you mean it requires a complete fresh build?

Cheers,
Quentin

author
#4 lore raw
Quoted 2 lines

Yes, but I only want at least one board this happens on so we can try figure out exactly what happens with this watchdog.

I am a bit confused. Sounds like this is affecting the entire U-Boot? Isn't this just a Cyclone V GEN5 socfpga issue?

It is a very generic setup.
clone from fresh

make clean
make mrproper
make socfpga_cyclone5_defconfig
make prepare

Now please cp .config to .config_default

Ok now
make menuconfig
/WDT turn on and save
make menuconfig
turn all those you have enabled
save again.

then gvimdiff .config .config_default

You will see what I meant.

Enjoy~
Brian

#5 lore raw

Hi Brian,

Quoted 4 lines · Sune Brian
Quoted 2 lines

Yes, but I only want at least one board this happens on so we can try figure out exactly what happens with this watchdog.

I am a bit confused. Sounds like this is affecting the entire U-Boot?

I believe so.

Quoted 2 lines

Isn't this just a Cyclone V GEN5 socfpga issue?

I don't think so.

I think the issue is that CONFIG_WATCHDOG selects CYCLIC but only implies SPL_CYCLIC and CONFIG_SPL_WATCHDOG does nothing wrt SPL_CYLIC. ARCH_SOCFPGA selects SPL_WATCHDOG so it is always enabled, but SPL_CYCLIC may not always be enabled.

Quoted 8 lines

It is a very generic setup.
clone from fresh

make clean
make mrproper
make socfpga_cyclone5_defconfig
make prepare

Quoted 5 lines

Now please cp .config to .config_default

Ok now
make menuconfig
/WDT turn on and save

Only WDT or also SPL_WDT?

Quoted 2 lines

make menuconfig
turn all those you have enabled

Which ones?

Quoted 6 lines

save again.

then gvimdiff .config .config_default

You will see what I meant.

Can you run "make savedefconfig" after your "save again" step and copy the content of the file called "defconfig" that was just generated in a mail? That would really help me, thanks!

Cheers,
Quentin

author
#6 lore raw
In reply to Quentin Schulz
Quoted 1 line

So, this does NOT enable WDT or WATCHDOG. It does force SPL_WATCHDOG on

Comment on this.
No this is not the case.

The specific turned on are:

[] Enable U-Boot watchdog reset
[] Designware watchdog timer support
[] Enable driver model for watchdog timer drivers

Save and uncheck those back in order.

Never touch this setting from the beginning.
[] Enable driver model for watchdog timer drivers in SPL

BTW appreciate your interest on this issue and welling to debug. For my case if any issue is fixed by a solution(s) I usually just leave it as such.

Don't really worth it to spend time on s.t. had a tmperal solution. Unless it is really broken to the point that it is unbootable.

Brian