SDRAM Calibration Failed fix for GEN5 SoCFPGA
Subsystems (3)
PATCH v4 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 | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/mach-socfpga/Kconfig +2 -0
@@ -117,6 +117,8 @@ config TARGET_SOCFPGA_CYCLONE5 config TARGET_SOCFPGA_GEN5 bool + select CYCLIC + select SPL_CYCLIC select SPL_ALTERA_SDRAM imply FPGA_SOCFPGA imply SPL_SIZE_LIMIT_SUBTRACT_GD
Signature · 1 line
2.34.1
arch/arm/mach-socfpga/Kconfig config TARGET_SOCFPGA_CYCLONE5 · line 124
Quoted 5 lines
arch/arm/mach-socfpga/Kconfig +2
-0+ select CYCLIC + select SPL_CYCLIC select SPL_ALTERA_SDRAM imply FPGA_SOCFPGA imply SPL_SIZE_LIMIT_SUBTRACT_GD
Hi Quentin,
But interestingly do you tried any case that when defconfig had givenCONFIG_CYCLIC=yCONFIG_SPL_CYCLIC=y
but empty CMD_CYCLIC?
What my observation is that it is automatically turn on CMD_CYCLIC during .config recovery.
So I had no clue what you want on this correlated settings.
Brian
Hi Brian,
Quoted 14 lines · Sune Brian
arch/arm/mach-socfpga/Kconfig config TARGET_SOCFPGA_CYCLONE5 · line 124
Quoted 5 lines
arch/arm/mach-socfpga/Kconfig +2
-0+ select CYCLIC + select SPL_CYCLIC select SPL_ALTERA_SDRAM imply FPGA_SOCFPGA imply SPL_SIZE_LIMIT_SUBTRACT_GDHi Quentin,
But interestingly do you tried any case that when defconfig had given
CONFIG_CYCLIC=yCONFIG_SPL_CYCLIC=y
but emptyCMD_CYCLIC?
Quoted 4 lines
What my observation is that it is automatically turn on
CMD_CYCLICduring .config recovery.So I had no clue what you want on this correlated settings.
CMD_CYCLIC is enabled by default ("default y") if its dependencies are met (that is "CYCLIC" as specified by "depends on CYCLIC" in cmd/Kconfig). So when you enable CONFIG_CYCLIC via menuconfig, it enables (by default) CMD_CYCLIC as well. But you can disable it if you don't need it for example. If you add a "select OPTION" in an option in Kconfig, you cannot disable OPTION anymore.
CMD_CYCLIC is not required, so you shouldn't "depends on" or "select" it.
Cheers,
Quentin
Quoted 8 lines
CMD_CYCLICis enabled by default ("default y") if its dependencies are met (that is "CYCLIC" as specified by "depends on CYCLIC" in cmd/Kconfig). So when you enableCONFIG_CYCLICvia menuconfig, it enables (by default)CMD_CYCLICas well. But you can disable it if you don't need it for example. If you add a "select OPTION" in an option inKconfig, you cannot disable OPTION anymore.
CMD_CYCLICis not required, so you shouldn't "depends on" or "select" it.
Yes this patch had removed it by cross-check via real board on the fail calibration issue. But CYCLIC and CYCLIC_SPL still a must to fix the issue.
Brian
Hi all
Quoted 7 lines
Quoted 7 lines
CMD_CYCLICis enabled by default ("default y") if its dependencies are met (that is "CYCLIC" as specified by "depends on CYCLIC" in cmd/Kconfig). So when you enableCONFIG_CYCLICvia menuconfig, it enables (by default)CMD_CYCLICas well. But you can disable it if you don't need it for example. If you add a "select OPTION" in an option inKconfig, you cannot disable OPTION anymore.
Quoted 6 lines
Quoted 1 line
CMD_CYCLICis not required, so you shouldn't "depends on" or "select" it.Yes this patch had removed it by cross-check via real board on the fail calibration issue. But CYCLIC and
CYCLIC_SPLstill a must to fix the issue.Brian
Would Altera also confirm this issue a bit?
I can repeat this issue by a fresh pull build.
Thanks,
Brian
Hi Brian,
Quoted 11 lines · Sune Brian
[CAUTION: This email is from outside your organization. Unless you trust the sender, do not click on links or open attachments as it may be a fraudulent email attempting to steal your information and/or compromise your computer.]
Hi all
Quoted 7 lines
Quoted 7 lines
CMD_CYCLICis enabled by default ("default y") if its dependencies are met (that is "CYCLIC" as specified by "depends on CYCLIC" in cmd/Kconfig). So when you enableCONFIG_CYCLICvia menuconfig, it enables (by default)CMD_CYCLICas well. But you can disable it if you don't need it for example. If you add a "select OPTION" in an option inKconfig, you cannot disable OPTION anymore.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
CMD_CYCLICis not required, so you shouldn't "depends on" or "select" it.Yes this patch had removed it by cross-check via real board on the fail calibration issue. But CYCLIC and
CYCLIC_SPLstill a must to fix the issue.Brian
Would Altera also confirm this issue a bit?
I can repeat this issue by a fresh pull build.
Thanks for sharing your findings. However, based on the behavior you described, I’m not fully convinced that enabling cyclic/watchdog is actually fixing the SDRAM calibration issue itself. From the SPL side, there is no clear timeout or calibration control path that would logically be corrected by turning on the cyclic framework, so the improvement may simply be due to timing shifts rather than a real fix.
Before we go deeper into upstream work, could you try testing against the official Altera downstream tree?
Altera official U-Boot (SoCFPGA):
https://github.com/altera-fpga/u-boot-socfpga - branch socfpga_v2025.07
This branch includes several Gen5 DDR related fixes that are not upstreamed yet. If calibration becomes stable with the downstream tree, then it is very likely that the real fix already exists there, and we can identify which patch addresses the root cause instead of spending time reverse engineering a solution that may already be solved.
If the calibration still fails even on the official release, then at least we can rule out downstream fixes and focus efforts on the correct upstream location.
Let me know the results, it will help us pinpoint whether the issue is timing-related or missing a specific patch.
Thanks.
Tien Fong
Quoted 3 lines
Altera official U-Boot (SoCFPGA):
https://github.com/altera-fpga/u-boot-socfpga - branch socfpga_v2025.07
Confirm downstream on default cyclone v socdk always works stable. No settings are touch nor any file are modified.
What other confirmations are required?
Brian
Quoted 6 lines
Thanks for sharing your findings. However, based on the behavior you described, I’m not fully convinced that enabling cyclic/watchdog is actually fixing the SDRAM calibration issue itself. From the SPL side, there is no clear timeout or calibration control path that would logically be corrected by turning on the cyclic framework, so the improvement may simply be due to timing shifts rather than a real fix.
BTW T.F. I want to point out a very important setup. By default the Altera trunk had turned on
│ │ [*] Enable U-Boot watchdog reset
│ │
│ │ [*] Automatically start watchdog timer
│ │
│ │ (10000) Watchdog timeout in msec
│ │
│ │ [ ] Enable Watchdog Timer support for IMX and LSCH2 of NXP
│ │
│ │ [ ] i.MX7ULP watchdog
│ │
│ │ -*- Designware watchdog timer support
│ │
│ │ [*] Enable driver model for watchdog timer driversSo maybe you can also reverse investigate on your side via real board. Removing all CYCLIC WDT drivers and all dst watchdog "okay" do not introduce sdram calibration issue?
Lets cross check.
Thanks,
Brian
Quoted 17 lines
BTW T.F. I want to point out a very important setup. By default the Altera trunk had turned on
│ │ [*] Enable U-Boot watchdog reset │ │ │ │ [*] Automatically start watchdog timer │ │ │ │ (10000) Watchdog timeout in msec │ │ │ │ [ ] Enable Watchdog Timer support for IMX and LSCH2 of NXP │ │ │ │ [ ] i.MX7ULP watchdog │ │ │ │ -*- Designware watchdog timer support │ │ │ │ [*] Enable driver model for watchdog timer drivers
Quoted 5 lines
So maybe you can also reverse investigate on your side via real board. Removing all CYCLIC WDT drivers and all dst watchdog "okay" do not introduce sdram calibration issue?
Lets cross check.
Hi T.F. and adding Alif as well.
Long story short it fails on Altera trunk as follow:
1: Altera trunk force enable the driver of DESIGNWARE_WATCHDOG 2: It is not allow to remove by default git pull
3: After manually remove via Kconfig modification
config TARGET_SOCFPGA_GEN5
bool
# select DESIGNWARE_WATCHDOG
4: The DESIGNWARE and all CYCLIC are turned off
DTS, .config had double confirmed the setup
Test result:
U-Boot SPL 2025.07-g35abb4f1cedc-dirty (Nov 28 2025 - 20:19:39 +0800) SDRAM calibration failed.
### ERROR ### Please RESET the board ###
Long story short the inherent patch for this series is actually correct. The WDT introduces calibration failures.
Thanks,
Brian
Chee, Tien Fong <[email protected]> 於 2025年11月28日週五 下午6:17寫道:
Quoted 46 lines
Hi Brian,
Quoted 11 lines · Sune Brian
[CAUTION: This email is from outside your organization. Unless you trust the sender, do not click on links or open attachments as it may be a fraudulent email attempting to steal your information and/or compromise your computer.]
Hi all
Quoted 7 lines
Quoted 7 lines
CMD_CYCLICis enabled by default ("default y") if its dependencies are met (that is "CYCLIC" as specified by "depends on CYCLIC" in cmd/Kconfig). So when you enableCONFIG_CYCLICvia menuconfig, it enables (by default)CMD_CYCLICas well. But you can disable it if you don't need it for example. If you add a "select OPTION" in an option inKconfig, you cannot disable OPTION anymore.Quoted 7 lines
Quoted 5 lines
Quoted 1 line
CMD_CYCLICis not required, so you shouldn't "depends on" or "select" it.Yes this patch had removed it by cross-check via real board on the fail calibration issue. But CYCLIC and
CYCLIC_SPLstill a must to fix the issue.Brian
Would Altera also confirm this issue a bit?
I can repeat this issue by a fresh pull build.Thanks for sharing your findings. However, based on the behavior you described, I’m not fully convinced that enabling cyclic/watchdog is actually fixing the SDRAM calibration issue itself. From the SPL side, there is no clear timeout or calibration control path that would logically be corrected by turning on the cyclic framework, so the improvement may simply be due to timing shifts rather than a real fix.
Before we go deeper into upstream work, could you try testing against the official Altera downstream tree?
Altera official U-Boot (SoCFPGA):
https://github.com/altera-fpga/u-boot-socfpga - branch socfpga_v2025.07This branch includes several Gen5 DDR related fixes that are not upstreamed yet. If calibration becomes stable with the downstream tree, then it is very likely that the real fix already exists there, and we can identify which patch addresses the root cause instead of spending time reverse engineering a solution that may already be solved.
If the calibration still fails even on the official release, then at least we can rule out downstream fixes and focus efforts on the correct upstream location.
Quoted 7 lines
Let me know the results, it will help us pinpoint whether the issue is timing-related or missing a specific patch.
Thanks.
Tien Fong
Hi T.F.
I am enclosing a bit log here.
I had diff both sequencer on mainstream and altera trunk. No diff.
As for the sdram_gen5.c there are diff but no major point before calibration fail is trigger. ECC is not use or setup.
Setup:
No CYCLIC no WDT all off on dts and .config.
No modification on code.
The below logs are trigger via reset key.
Pass case:
U-Boot SPL 2026.01-rc3-00043-gd5276409c0a1-dirty (Dec 01 2025 - 21:10:15 +0800)
sequencer: Preparing to start memory calibration sdram_calibration_full:3939
run_mem_calibrate:3671
phy_mgr_initialize:115
rw_mgr_mem_initialize:1048
delay_for_n_mem_clocks:809: clocks=250 ... start delay_for_n_mem_clocks:872 clocks=250 ... end delay_for_n_mem_clocks:809: clocks=4 ... start delay_for_n_mem_clocks:872 clocks=4 ... end delay_for_n_mem_clocks:809: clocks=4 ... start delay_for_n_mem_clocks:872 clocks=4 ... end delay_for_n_mem_clocks:809: clocks=512 ... start delay_for_n_mem_clocks:872 clocks=512 ... end
mem_calibrate:3492
mem_init_latency:3358
rw_mgr_mem_calibrate_vfifo:2853: 0 0 rw_mgr_mem_calibrate_read_load_patterns:1446 rw_mgr_mem_calibrate_dqs_enable_calibration:2747 (0,0) rw_mgr_mem_calibrate_vfifo_find_dqs_en_phase:1959 0 rw_mgr_mem_calibrate_vfifo_center:2565: 0 0rw_mgr_mem_calibrate_writes:3295 0 0 rw_mgr_mem_calibrate_writes_center:3146 0 0rw_mgr_mem_calibrate_vfifo_end:2950 0 0rw_mgr_mem_calibrate_vfifo_center:2565: 0 0rw_mgr_mem_calibrate_vfifo:2853: 1 0 rw_mgr_mem_calibrate_read_load_patterns:1446 rw_mgr_mem_calibrate_dqs_enable_calibration:2747 (1,0) rw_mgr_mem_calibrate_vfifo_find_dqs_en_phase:1959 1 rw_mgr_mem_calibrate_vfifo_center:2565: 1 0rw_mgr_mem_calibrate_writes:3295 1 8 rw_mgr_mem_calibrate_writes_center:3146 1 8rw_mgr_mem_calibrate_vfifo_end:2950 1 0rw_mgr_mem_calibrate_vfifo_center:2565: 1 0rw_mgr_mem_calibrate_vfifo:2853: 2 0 rw_mgr_mem_calibrate_read_load_patterns:1446 rw_mgr_mem_calibrate_dqs_enable_calibration:2747 (2,0) rw_mgr_mem_calibrate_vfifo_find_dqs_en_phase:1959 2 rw_mgr_mem_calibrate_vfifo_center:2565: 2 0rw_mgr_mem_calibrate_writes:3295 2 16 rw_mgr_mem_calibrate_writes_center:3146 2 16rw_mgr_mem_calibrate_vfifo_end:2950 2 0rw_mgr_mem_calibrate_vfifo_center:2565: 2 0rw_mgr_mem_calibrate_vfifo:2853: 3 0 rw_mgr_mem_calibrate_read_load_patterns:1446 rw_mgr_mem_calibrate_dqs_enable_calibration:2747 (3,0) rw_mgr_mem_calibrate_vfifo_find_dqs_en_phase:1959 3 rw_mgr_mem_calibrate_vfifo_center:2565: 3 0rw_mgr_mem_calibrate_writes:3295 3 24 rw_mgr_mem_calibrate_writes_center:3146 3 24rw_mgr_mem_calibrate_vfifo_end:2950 3 0rw_mgr_mem_calibrate_vfifo_center:2565: 3 0rw_mgr_mem_calibrate_lfifo:2979 rw_mgr_mem_calibrate_read_load_patterns:1446 delay_for_n_mem_clocks:809: clocks=4 ... start delay_for_n_mem_clocks:872 clocks=4 ... end delay_for_n_mem_clocks:809: clocks=4 ... start delay_for_n_mem_clocks:872 clocks=4 ... end
sequencer: CALIBRATION PASSED
sequencer: Calibration complete
Trying to boot from MMC1
Fail case:
U-Boot SPL 2026.01-rc3-00043-gd5276409c0a1-dirty (Dec 01 2025 - 21:10:15 +0800)
sequencer: Preparing to start memory calibration sdram_calibration_full:3939
run_mem_calibrate:3671
phy_mgr_initialize:115
rw_mgr_mem_initialize:1048
delay_for_n_mem_clocks:809: clocks=250 ... start delay_for_n_mem_clocks:872 clocks=250 ... end delay_for_n_mem_clocks:809: clocks=4 ... start delay_for_n_mem_clocks:872 clocks=4 ... end delay_for_n_mem_clocks:809: clocks=4 ... start delay_for_n_mem_clocks:872 clocks=4 ... end delay_for_n_mem_clocks:809: clocks=512 ... start delay_for_n_mem_clocks:872 clocks=512 ... end
mem_calibrate:3492
mem_init_latency:3358
rw_mgr_mem_calibrate_vfifo:2853: 0 0 rw_mgr_mem_calibrate_read_load_patterns:1446 rw_mgr_mem_calibrate_dqs_enable_calibration:2747 (0,0) rw_mgr_mem_calibrate_vfifo_find_dqs_en_phase:1959 0 rw_mgr_mem_calibrate_read_load_patterns:1446 rw_mgr_mem_calibrate_dqs_enable_calibration:2747 (0,0) rw_mgr_mem_calibrate_vfifo_find_dqs_en_phase:1959 0 rw_mgr_mem_calibrate_read_load_patterns:1446 rw_mgr_mem_calibrate_dqs_enable_calibration:2747 (0,0) rw_mgr_mem_calibrate_vfifo_find_dqs_en_phase:1959 0 rw_mgr_mem_calibrate_read_load_patterns:1446 rw_mgr_mem_calibrate_dqs_enable_calibration:2747 (0,0) rw_mgr_mem_calibrate_vfifo_find_dqs_en_phase:1959 0 rw_mgr_mem_calibrate_read_load_patterns:1446 rw_mgr_mem_calibrate_dqs_enable_calibration:2747 (0,0) rw_mgr_mem_calibrate_vfifo_find_dqs_en_phase:1959 0 delay_for_n_mem_clocks:809: clocks=4 ... start delay_for_n_mem_clocks:872 clocks=4 ... end delay_for_n_mem_clocks:809: clocks=4 ... start delay_for_n_mem_clocks:872 clocks=4 ... end
sequencer: CALIBRATION FAILED
sequencer: Calibration complete
SDRAM calibration failed.
### ERROR ### Please RESET the board ###
Thanks,
Brian
Hi Brian,
Quoted 10 lines · Sune Brian
I am enclosing a bit log here.
I had diff both sequencer on mainstream and altera trunk. No diff.As for the
sdram_gen5.cthere are diff but no major point before calibration fail is trigger. ECC is not use or setup.Setup:
No CYCLIC no WDT all off on dts and .config.
No modification on code.
I had similar problem on a custom board with cyclone V. I tried disabling the watchdog but this didn't make any difference.
After bisecting, I traced it to commit 3b8dfc42a23 which changed CONFIG_SYS_TIMER_COUNTS_DOWN into a real Kconfig symbol. Although this was updated in socfpga_cyclone5_defconfig, I had to make the same change in my defconfig.
Not sure if this is your problem too, but worth checking, particularly if you're using a custom defconfig.
Regards,
Ralph
Ralph Siemsen <[email protected]> 於 2025年12月4日週四 上午2:01寫道:
Quoted 11 lines
Hi Brian,
Quoted 7 lines · Sune Brian
I am enclosing a bit log here.
I had diff both sequencer on mainstream and altera trunk. No diff.As for the
sdram_gen5.cthere are diff but no major point before calibration fail is trigger. ECC is not use or setup.
Quoted 6 lines
Quoted 3 lines
Setup:
No CYCLIC no WDT all off on dts and .config.
No modification on code.I had similar problem on a custom board with cyclone V. I tried disabling the watchdog but this didn't make any difference.
Hi Ralph,
But did you disable also all "CYCLIC" as well?
Quoted 3 lines
After bisecting, I traced it to commit
3b8dfc42a23which changedCONFIG_SYS_TIMER_COUNTS_DOWNinto a realKconfigsymbol. Although this
1) If my memory recall correctly just after this week bundle merge of GEN5. The issue cont'd exist after disable all WDT CYCLIC etc.
2) This is still a bit contradict what T.F. mentioned.
If anything that is related to the time or counter then the original susception holds.
3) I use socfpga_cyclone5_defconfig and only change minimum settings that I needs.
From this issue mentioned to current day.
Quoted 8 lines
was updated in
socfpga_cyclone5_defconfig, I had to make the same change in my defconfig.Not sure if this is your problem too, but worth checking, particularly if you're using a custom defconfig.
Regards,
Ralph
Still thank you and I will check.
Brian
Hi Brian,
Quoted 1 line · Sune Brian
But did you disable also all "CYCLIC" as well?
I have "CONFIG_CYCLIC is not set" which disables all the others.
I also have another patch to disable the watchdog, adapted from [1]. This didn't seem to make any difference (but my ram calibration doesn't take very long).
[1] https://lore.kernel.org/all/[email protected]/
Quoted 3 lines
3) I use
socfpga_cyclone5_defconfigand only change minimum settings that I needs.
From this issue mentioned to current day.
Then it sounds like it is a recent issue... hmm... I'm currently on 2025.10 release version (plus some cherry-picks). I'll give a try on master/next once I get some other things stabilised...
Regards,
Ralph
Ralph Siemsen <[email protected]> 於 2025年12月4日週四 上午4:52寫道:
Quoted 7 lines
Hi Brian,
Quoted 1 line · Sune Brian
But did you disable also all "CYCLIC" as well?
Quoted 8 lines
I have "
CONFIG_CYCLICis not set" which disables all the others.I also have another patch to disable the watchdog, adapted from [1]. This didn't seem to make any difference (but my ram calibration doesn't take very long).
Hi Ralph,
I do diff the mainstream and Altera trunk.
I cam repeat the same behavior on altera trunk when all WDT CYCLIC turned off.
I plan to investigate under another board.
TBH if it is board specific case then there is nothing harm to simply turn on CYCLIC or WDT.
But the truth is that Altera trunk force using designware WDT by default. Because under distro I do full "memtester" and "stressapptest". Nothing really fails on those two.
Quoted 10 lines
Quoted 3 lines
3) I use
socfpga_cyclone5_defconfigand only change minimum settings that I needs.
From this issue mentioned to current day.Then it sounds like it is a recent issue... hmm... I'm currently on 2025.10 release version (plus some cherry-picks). I'll give a try on master/next once I get some other things stabilised...
Regards,
Ralph
The major reason is the ECC on mainstream is completely missing. BTW [1] I do manually inserted and test no luck on that.
Yet still thank you for the help.
Brian
Hi,
Quoted 24 lines · Sune Brian
[CAUTION: This email is from outside your organization. Unless you trust the sender, do not click on links or open attachments as it may be a fraudulent email attempting to steal your information and/or compromise your computer.]
Ralph Siemsen <[email protected]> 於 2025年12月4日週四 上午4:52寫道:
Quoted 7 lines
Hi Brian,
Quoted 1 line · Sune Brian
But did you disable also all "CYCLIC" as well?
Quoted 8 lines
I have "
CONFIG_CYCLICis not set" which disables all the others.I also have another patch to disable the watchdog, adapted from [1]. This didn't seem to make any difference (but my ram calibration doesn't take very long).
Hi Ralph,
I do diff the mainstream and Altera trunk.
I cam repeat the same behavior on altera trunk when all WDT CYCLIC turned off.
Quoted 7 lines
I plan to investigate under another board.
TBH if it is board specific case then there is nothing harm to simply turn on CYCLIC or WDT.
But the truth is that Altera trunk force using designware WDT by default. Because under distro I do full "memtester" and "stressapptest". Nothing really fails on those two.
I have tried to disable all WDT and CYCLIC configs on both Altera trunk and mainline U-Boot on my side.
I made some changes to the standard socfpga_cyclone5_defconfig as well as the common Kconfig to really disable all watchdog configs.
I cannot replicate the issue on both cases, I am able to boot via RAM through ARM debugger, as well as through MMC boot after triggering reset in Linux.
I am using our Cyclone V SoC Development Kit, details of the board can be found here
[1] https://www.rocketboards.org/foswiki/Documentation/AlteraSoCDevelopmentBoard
I am thinking this could be related to the power supply not being fully stable before SDRAM calibration, perhaps you could try other reset methods, such as cold/warm reset, or power cycling the board and see if there is any difference compared to using the physical reset switch key?
Thanks,
Alif
Quoted 17 lines
Quoted 10 lines
Quoted 3 lines
3) I use
socfpga_cyclone5_defconfigand only change minimum settings that I needs.
From this issue mentioned to current day.Then it sounds like it is a recent issue... hmm... I'm currently on 2025.10 release version (plus some cherry-picks). I'll give a try on master/next once I get some other things stabilised...
Regards,
RalphThe major reason is the ECC on mainstream is completely missing. BTW [1] I do manually inserted and test no luck on that.
Yet still thank you for the help.
Brian
Yuslaimi, Alif Zakuan <[email protected]> 於 2025年12月4日週四 上午9:11寫道:
Quoted 52 lines
Hi,
Quoted 24 lines · Sune Brian
[CAUTION: This email is from outside your organization. Unless you trust the sender, do not click on links or open attachments as it may be a fraudulent email attempting to steal your information and/or compromise your computer.]
Ralph Siemsen <[email protected]> 於 2025年12月4日週四 上午4:52寫道:
Quoted 7 lines
Hi Brian,
Quoted 1 line · Sune Brian
But did you disable also all "CYCLIC" as well?
Quoted 8 lines
I have "
CONFIG_CYCLICis not set" which disables all the others.I also have another patch to disable the watchdog, adapted from [1]. This didn't seem to make any difference (but my ram calibration doesn't take very long).
Hi Ralph,
I do diff the mainstream and Altera trunk.
I cam repeat the same behavior on altera trunk when all WDT CYCLIC turned off.Quoted 7 lines
I plan to investigate under another board.
TBH if it is board specific case then there is nothing harm to simply turn on CYCLIC or WDT.
But the truth is that Altera trunk force using designware WDT by default. Because under distro I do full "memtester" and "stressapptest". Nothing really fails on those two.I have tried to disable all WDT and CYCLIC configs on both Altera trunk and mainline U-Boot on my side.
I made some changes to the standard
socfpga_cyclone5_defconfigas well as the commonKconfigto really disable all watchdog configs.I cannot replicate the issue on both cases, I am able to boot via RAM through ARM debugger, as well as through MMC boot after triggering reset in Linux.
I am using our Cyclone V SoC Development Kit, details of the board can be found here
[1]
https://www.rocketboards.org/foswiki/Documentation/AlteraSoCDevelopmentBoard
Quoted 26 lines
I am thinking this could be related to the power supply not being fully stable before SDRAM calibration, perhaps you could try other reset methods, such as cold/warm reset, or power cycling the board and see if there is any difference compared to using the physical reset switch key?
Thanks,
AlifQuoted 17 lines
Quoted 10 lines
Quoted 3 lines
3) I use
socfpga_cyclone5_defconfigand only change minimum settings that I needs.
From this issue mentioned to current day.Then it sounds like it is a recent issue... hmm... I'm currently on 2025.10 release version (plus some cherry-picks). I'll give a try on master/next once I get some other things stabilised...
Regards,
RalphThe major reason is the ECC on mainstream is completely missing. BTW [1] I do manually inserted and test no luck on that.
Yet still thank you for the help.
Brian
Hi Alif,
I think almost 90% or even 95% above board only uses 1GB socdk as well. I am undergoing a deep investigation.
Cyclone V SoC FPGA boards also do
not have issues w/o WDT CYCLIC.
The issue happened on 2GB variant boards.
If any parties or users happen to have 2GB please do point out it is OK.
If not it is a 32bit bug on driver or other files. Calibration time is indeed longer.
No time shift is not a solution or inherent problem here. 2x512x16 ddr die is used to introduce a signed possible issue perhase. aka 0x8000_0000
Thanks,
Brian
Quoted 3 lines · Ralph Siemsen
Then it sounds like it is a recent issue... hmm... I'm currently on 2025.10 release version (plus some cherry-picks). I'll give a try on master/next once I get some other things stabilised...
Just a quick note to say that master branch (with Jan's v2 patches) is working fine for me. The calibration is passing on both cold/warm reboot, as well as power cycling (I tried a few dozen times each). Note that my board only has 512 MB.
Regards,
Ralph
Ralph Siemsen <[email protected]> 於 2025年12月4日週四 下午11:47寫道:
Quoted 10 lines · Ralph Siemsen
Quoted 3 lines
Then it sounds like it is a recent issue... hmm... I'm currently on 2025.10 release version (plus some cherry-picks). I'll give a try on master/next once I get some other things stabilised...
Just a quick note to say that master branch (with Jan's v2 patches) is working fine for me. The calibration is passing on both cold/warm reboot, as well as power cycling (I tried a few dozen times each). Note that my board only has 512 MB.
Thank you. Yet, no confirmation on 2GB situation. For 1G or 512M I can also repeat normal boot on different brand.
Which for 512x16 ddr3 die can have several construction from the beginning. But the question still holds "WHY" CYCLIC or WDT can trigger a normal boot? Cannot explain nor trace.
Brian
Quoted 3 lines
Regards,
Ralph
Hi Tom,
Tom please reject his patch, thank you.
Hi Alif, and Ralph,
As you both had undergo a board test.
First sorry for cont'd bothering both of you.
If possible I would like to check if this is aligned disregarded to DRAM size. On U-Boot latest or after 2025.07.
Issue 1:sequencer.c if turned on debug by including this at the very top. "#define LOG_DEBUG" and "#define DLEVEL 1 or 2"
If will stall somehow on any brand of board my side current had.
Issue 2:
For DRAM size larger than 1GB, when w/o O.C. and using as stable setting as possible.
Even it passed the calibration it will not cont'd boot when sdram_gen5.c is turned on debug flag via "#define LOG_DEBUG" However this issue is not found on 1GB nor 512MB.
Finding 1:
This is very puzzling and completely lost control on what possible cause. If SDRAM fails same WDT or CYCLIC simply bypassed it.
Aka 533MHz DRAM speed then it is a must to discover bitflip or any issue under distro test tools "memtester" or "stressapptest" on long sanity test. However neither of those return issue since the board used for development.
Finding 2
So long story short WDT or CYCLIC is not a solution to fix SDRAM calibration fail.
Thanks,
Brian
Quoted 21 lines
Quoted 9 lines · Ralph Siemsen
Quoted 3 lines
Then it sounds like it is a recent issue... hmm... I'm currently on 2025.10 release version (plus some cherry-picks). I'll give a try on master/next once I get some other things stabilised...
Just a quick note to say that master branch (with Jan's v2 patches) is working fine for me. The calibration is passing on both cold/warm reboot, as well as power cycling (I tried a few dozen times each). Note that my board only has 512 MB.
Thank you. Yet, no confirmation on 2GB situation. For 1G or 512M I can also repeat normal boot on different brand.
Which for 512x16 ddr3 die can have several construction from the beginning. But the question still holds "WHY" CYCLIC or WDT can trigger a normal boot? Cannot explain nor trace.Brian
Quoted 3 lines
Regards,
Ralph
Hi Brian,
Quoted 2 lines · Sune Brian
If possible I would like to check if this is aligned disregarded to DRAM size. On U-Boot latest or after 2025.07.
Sorry for the delay. I am testing on 2025.10 version with a few additional changes. It is a custom board using its own Quartus memory parameters (which have been unchanged in many years).
Quoted 4 lines
Issue 1:
sequencer.cif turned on debug by including this at the very top. "#defineLOG_DEBUG" and "#define DLEVEL 1 or 2"
If will stall somehow on any brand of board my side current had.
I also encountered this, but it was solved by disable the watchdog, by toggling L4WD0 reset. After doing this, there is no problem with using DLEVEL 2. I even took it a step further and logged every single write to the DDR control registers.
Quoted 6 lines
Issue 2:
For DRAM size larger than 1GB, when w/o O.C. and using as stable setting as possible.
Even it passed the calibration it will not cont'd boot whensdram_gen5.cis turned on debug flag via "#defineLOG_DEBUG" However this issue is not found on 1GB nor 512MB.
I was able to get access to board with 2GB, and it boots successfully. Memory calibration completes, and subsequent test with u-boot "mtest" basic memory test is also passing.
I'm also running memtester on my 512MB board and it hasn't found any issues after a few hours runtime.
Regards,
Ralph
Hi Ralph,
Quoted 17 lines · Ralph Siemsen
Hi Brian,
Quoted 2 lines · Sune Brian
If possible I would like to check if this is aligned disregarded to DRAM size. On U-Boot latest or after 2025.07.
Sorry for the delay. I am testing on 2025.10 version with a few additional changes. It is a custom board using its own Quartus memory parameters (which have been unchanged in many years).
Quoted 4 lines
Issue 1:
sequencer.cif turned on debug by including this at the very top. "#defineLOG_DEBUG" and "#define DLEVEL 1 or 2"
If will stall somehow on any brand of board my side current had.
Quoted 4 lines
I also encountered this, but it was solved by disable the watchdog, by toggling L4WD0 reset. After doing this, there is no problem with using DLEVEL 2. I even took it a step further and logged every single write to the DDR control registers.
For issue 1 it is just a debug issue but I could also try a bit of your method. Didn't deeply investigate this.
Quoted 11 lines
Quoted 7 lines
Issue 2:
For DRAM size larger than 1GB, when w/o O.C. and using as stable setting as possible.
Even it passed the calibration it will not cont'd boot whensdram_gen5.cis turned on debug flag via "#defineLOG_DEBUG" However this issue is not found on 1GB nor 512MB.I was able to get access to board with 2GB, and it boots successfully. Memory calibration completes, and subsequent test with u-boot "mtest" basic memory test is also passing.
For your 2GB case it is w/o CYCLIC and WDT right?
For this may I ask what DDR3 speed you used? 400MHz?
For 2GB there are different die configurations 512x16 itself also come with different forms. If possible can you provide the actual die part #?
For the latest test result.
1) all boards can run properly w/o watchdog or cyclic but only works on 400M on any size from 512M to 2G.
2) For die itself it is shown that twice die performs much more stably.
3) The DDR calibration itself is so touchy on time and opening CYCLIC or WDT highly improves the bootup stability on all timing bins.
Quoted 4 lines
I'm also running memtester on my 512MB board and it hasn't found any issues after a few hours runtime.
The most puzzling part is this. It only dies on the U-Boot stage. The ddr sequence.c was somehow cropped to a point for only size and speed for the file comments.
All boards or cases that even by luck passed the calibration phase on U-Boot do not have any issue on all stressapptest nor memtester under distro.
Quoted 2 lines
Regards,
Ralph
Quoted 9 lines
Quoted 4 lines
Issue 1:
sequencer.cif turned on debug by including this at the very top. "#defineLOG_DEBUG" and "#define DLEVEL 1 or 2"
If will stall somehow on any brand of board my side current had.I also encountered this, but it was solved by disable the watchdog, by toggling L4WD0 reset. After doing this, there is no problem with using DLEVEL 2. I even took it a step further and logged every single write to the DDR control registers.
Hi Ralph,
Thanks again. Quick test on your proposed method.
drivers/ddr/altera/sdram_gen5.c +3 -0
@@ -589,6 +589,9 @@ static int altera_gen5_sdram_probe(struct udevice *dev) }reset_deassert_bulk (&resets); +socfpga_per_reset (SOCFPGA_RESET (L4WD0 ),1 ); +socfpga_per_reset (SOCFPGA_RESET (L4WD0 ),0 ); +if (sdram_mmr_init_full (sdr_ctrl,0xffffffff ) !=0 ) {puts ("SDRAM init failed.\n" ); goto failed;
Works and all debug_log and max level=2.
However the same behavior can be repeated when CYCLIC / WDT off. It will fail and once CYCLIC is turned on it will pass again.
If HW level does not support the 533.333M timing from the beginning it is a 100% fail and no possible turning back to work. AKA you won't be able to do any timing shift to make it work. The DDR3 chip dies are unchanged and twin dies can always run 533.333 and never stall on the calibration phase w/ CYCLIC.
So simply speaking the sequence.c somehow is so touchy on timing. I do test the most common timing bin of the DDR3 die.
I guess there is no easy fix on this issue unless Altera do change a bit the sequence.c syntax.
Brian
Quoted 8 lines · Sune Brian
Quoted 8 lines
Quoted 7 lines
Issue 2:
For DRAM size larger than 1GB, when w/o O.C. and using as stable setting as possible.
Even it passed the calibration it will not cont'd boot whensdram_gen5.cis turned on debug flag via "#defineLOG_DEBUG" However this issue is not found on 1GB nor 512MB.
Quoted 5 lines
Quoted 3 lines
I was able to get access to board with 2GB, and it boots successfully. Memory calibration completes, and subsequent test with u-boot "mtest" basic memory test is also passing.
For your 2GB case it is w/o CYCLIC and WDT right?
Correct. Both my 512MB and 2GB are without CYCLIC and WDT.
Quoted 1 line
For this may I ask what DDR3 speed you used? 400MHz?
Yes, it is 400MHz, at least on the 512MB board.
Quoted 2 lines
For 2GB there are different die configurations 512x16 itself also come with different forms. If possible can you provide the actual die part #?
Unfortunately I don't have physical access (nor schematics) to check that.
Quoted 5 lines
The most puzzling part is this. It only dies on the U-Boot stage. The ddr
sequence.cwas somehow cropped to a point for only size and speed for the file comments.
All boards or cases that even by luck passed the calibration phase on U-Boot do not have any issue on all stressapptest nor memtester under distro.
I guess I have been lucky then. My only real problem was that CONFIG_TIMER_COUNTS_DOWN needs to be enabled. And it was quite an adventure to find that (using git bisect). There are other issues, such as watchdog kicking in if there are too many printfs(), and also early uart access is broken.
Ralph
Quoted 19 lines · Sune Brian
Hi Ralph,
Thanks again. Quick test on your proposed method.
drivers/ddr/altera/sdram_gen5.c +3
-0@@ -589,6 +589,9 @@ static int altera_gen5_sdram_probe(struct udevice *dev) }reset_deassert_bulk (&resets); +socfpga_per_reset (SOCFPGA_RESET (L4WD0 ),1 ); +socfpga_per_reset (SOCFPGA_RESET (L4WD0 ),0 ); +if (sdram_mmr_init_full (sdr_ctrl,0xffffffff ) !=0 ) {puts ("SDRAM init failed.\n" ); goto failed;
Quoted 1 line
Works and all
debug_logand max level=2.
Okay, great.
Quoted 2 lines
However the same behavior can be repeated when CYCLIC / WDT off. It will fail and once CYCLIC is turned on it will pass again.
So there would seem to be another issue related to CYCLIC, hmm...
Quoted 4 lines
So simply speaking the
sequence.csomehow is so touchy on timing. I do test the most common timing bin of the DDR3 die.
I guess there is no easy fix on this issue unless Altera do change a bit thesequence.csyntax.
One other complaint about sequencer.c is its size... the compile code takes up a major portion of the 60kB size limit for SPL.
Ralph
Hi Ralph,
Quoted 14 lines · Ralph Siemsen
Quoted 12 lines · Sune Brian
Quoted 11 lines
Quoted 7 lines
Issue 2:
For DRAM size larger than 1GB, when w/o O.C. and using as stable setting as possible.
Even it passed the calibration it will not cont'd boot whensdram_gen5.cis turned on debug flag via "#defineLOG_DEBUG" However this issue is not found on 1GB nor 512MB.I was able to get access to board with 2GB, and it boots successfully. Memory calibration completes, and subsequent test with u-boot "mtest" basic memory test is also passing.
Quoted 7 lines
Quoted 1 line
For your 2GB case it is w/o CYCLIC and WDT right?
Correct. Both my 512MB and 2GB are without CYCLIC and WDT.
Quoted 1 line
For this may I ask what DDR3 speed you used? 400MHz?
Yes, it is 400MHz, at least on the 512MB board.
For this let me recap the situation.
1) 400MHz on any size could run w/o CYCLIC nor WDT. Disregarded to die configuration nor die size aka page size 1k or 2k etc. From 512 to 2G.
2) 533MHz only properly run w/o CYCLIC nor WDT on twinDie setup
3) 500MHz is required to backoff when CYCLIC and WDT is turned off on 2k page size die on max 2G case.
So basically speaking it is about the delay tap on the sequence.c is very timing dependent and toucky.
Quoted 12 lines
Quoted 3 lines
For 2GB there are different die configurations 512x16 itself also come with different forms. If possible can you provide the actual die part #?
Unfortunately I don't have physical access (nor schematics) to check that.
Quoted 5 lines
The most puzzling part is this. It only dies on the U-Boot stage. The ddr
sequence.cwas somehow cropped to a point for only size and speed for the file comments.
All boards or cases that even by luck passed the calibration phase on U-Boot do not have any issue on all stressapptest nor memtester under distro.
Quoted 7 lines
I guess I have been lucky then. My only real problem was that
CONFIG_TIMER_COUNTS_DOWNneeds to be enabled. And it was quite an adventure to find that (using git bisect). There are other issues, such as watchdog kicking in if there are too manyprintfs(), and also early uart access is broken.Ralph
Long story short when CYCLIC/WDT is off just back off DDR speed to stable. However it makes no sense to trade off possible system speed when it is allowed to reach 533.333MHz.
Brian
Hi Ralph
Quoted 30 lines · Ralph Siemsen
Quoted 19 lines · Sune Brian
Hi Ralph,
Thanks again. Quick test on your proposed method.
drivers/ddr/altera/sdram_gen5.c +3
-0@@ -589,6 +589,9 @@ static int altera_gen5_sdram_probe(struct udevice *dev) }reset_deassert_bulk (&resets); +socfpga_per_reset (SOCFPGA_RESET (L4WD0 ),1 ); +socfpga_per_reset (SOCFPGA_RESET (L4WD0 ),0 ); +if (sdram_mmr_init_full (sdr_ctrl,0xffffffff ) !=0 ) {puts ("SDRAM init failed.\n" ); goto failed;Quoted 1 line
Works and all
debug_logand max level=2.Okay, great.
Quoted 2 lines
However the same behavior can be repeated when CYCLIC / WDT off. It will fail and once CYCLIC is turned on it will pass again.
So there would seem to be another issue related to CYCLIC, hmm...
Quoted 7 lines
Quoted 4 lines
So simply speaking the
sequence.csomehow is so touchy on timing. I do test the most common timing bin of the DDR3 die.
I guess there is no easy fix on this issue unless Altera do change a bit thesequence.csyntax.One other complaint about
sequencer.cis its size... the compile code takes up a major portion of the 60kB size limit for SPL.
The major concern here as I didn't fully read that file nor understand yet. If the write is possibly ruined the data via wrong address during delay taps trials.
Then the system is sure to stall somehow. So if the SPL phase is not 100% reliant on OCRAM only then the chance is very high to stall. For example it uses total memory of the SDRAM lowest part i.e. 0x0 to 0x10000 etc. even this could be corrupted during the test. However before the sequence.c could possibly reach a good delay taps, it had been stalled by other issues and never completed.
And the most concerns from the beginning of C5 devices are they don't even have leveling aka official don't allow fly-by yet T-branch only.
So many DDR3 standards are cropped from the beginning and even the timing training. (I might be wrong on software level but not hardware level).
Quoted 2 lines
Ralph
Brian