LS1046 bringup stuck in BL2, DDR init failed

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LS1046 bringup stuck in BL2, DDR init failed

Jump to solution
3,086 Views
SimonRo
Contributor III

We have a custom LS1046 board with DDR4. I have mapped DQ lines and got a successful CodeWarrior DDR validation and passed Operational DDR tests with ECC disabled, and speed 1300 MT/s. I have 4 x 1Gb x 16 DDR4 devices fitted.

I've taken the ddr_init1.c output and applied it to my atf version lf-5.10.52-2.1.0.

BL2 fails to boot from SD Card (DDR init failed). If I use the ddr_raw_timing structure from Codewarrior (no CONFIG_STATIC_DDR) I get:

INFO: SoC workaround for Errata A008850 Early-Phase was applied
INFO: SoC workaround for Errata A010539 was applied
INFO: RCW BOOT SRC is SD/EMMC
INFO: SoC workaround for DDR Errata A008511 was applied
INFO: SoC workaround for DDR Errata A009803 was applied
INFO: SoC workaround for DDR Errata A009942 was applied
INFO: SoC workaround for DDR Errata A010165 was applied
INFO: time base 0 ms
NOTICE: Fixed DDR on board
INFO: Time after parsing SPD 4 ms
ERROR: Board parameters no match.
ERROR: Failed matching board timing.
ERROR: DDR Clk: MCLK cycle is 481 ps.
ERROR: DDR Clk is faster than DIMM can support.
ERROR: mclk 481 invalid
ERROR: cas latency is too large 42
ERROR: Calculating DDR registers failed
ERROR: Calculate register error
ERROR: DDR init failed.
INFO: SoC workaround for Errata A008850 Post-Phase was applied
INFO: RCW BOOT SRC is SD/EMMC
INFO: esdhc_emmc_init
INFO: Card detected successfully
INFO: init done:
NOTICE: Incorrect DRAM0 size is defined in platform_def.h
ERROR: mmap_add_region_check() failed. error -22
ERROR: mmap_add_region_check() failed. error -22
NOTICE: BL2: v2.4(release):lf-5.10.52-2.1.0-rc2-0-gbb4957067-dirty
NOTICE: BL2: Built : 14:21:46, Jan 16 2025
INFO: Configuring TrustZone Controller
INFO: BL2: Doing platform setup
INFO: BL2: Loading image id 3
INFO: sd-mmc read done.

If I define CONFIG_STATIC_DDR and use the static_1300 struct from Codewarrior I get:

INFO: SoC workaround for Errata A008850 Early-Phase was applied
INFO: SoC workaround for Errata A010539 was applied
INFO: RCW BOOT SRC is SD/EMMC
INFO: SoC workaround for DDR Errata A008511 was applied
INFO: SoC workaround for DDR Errata A009803 was applied
INFO: SoC workaround for DDR Errata A009942 was applied
INFO: SoC workaround for DDR Errata A010165 was applied
INFO: Time before programming controller 0 ms
WARNING: Warning: Optimal CPO value not set.
ERROR: Found training error(s): 0x3000
ERROR: Error: Waiting for D_INIT timeout.
ERROR: Writing DDR register(s) failed
ERROR: Programing DDRC error
ERROR: DDR init failed.
INFO: SoC workaround for Errata A008850 Post-Phase was applied
INFO: RCW BOOT SRC is SD/EMMC
INFO: esdhc_emmc_init
INFO: Card detected successfully
INFO: init done:
NOTICE: Incorrect DRAM0 size is defined in platform_def.h
ERROR: mmap_add_region_check() failed. error -22
ERROR: mmap_add_region_check() failed. error -22
NOTICE: BL2: v2.4(release):lf-5.10.52-2.1.0-rc2-0-gbb4957067-dirty
NOTICE: BL2: Built : 14:52:12, Jan 16 2025
INFO: Configuring TrustZone Controller
INFO: BL2: Doing platform setup
INFO: BL2: Loading image id 3
INFO: sd-mmc read done.

 

I can see DDR clock on a scope at 650MHz. I'm fairly confident on the DQ map as I've double checked, and DDR Validation passed.

Does anyone have any ideas what I should do next? 

Thanks

0 Kudos
Reply
1 Solution
3,017 Views
yipingwang
NXP TechSupport
NXP TechSupport

Yes, CodeWarrior gets the DQ Mapping from the running board.

View solution in original post

0 Kudos
Reply
3 Replies
3,059 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please boot ATF on the target board, then connect CodeWarrior to the target board to create a QCVS DDR project with "From target" method, then check whether the generated DDR controller configuration parameters are same with what you provided in ATF source code.

0 Kudos
Reply
3,050 Views
SimonRo
Contributor III

When I do this should all properties match, e.g. does CodeWarrior get the DQ Mapping from the running board? 

I'm seeing a lot of difference in the DQ mapping for example.

0 Kudos
Reply
3,018 Views
yipingwang
NXP TechSupport
NXP TechSupport

Yes, CodeWarrior gets the DQ Mapping from the running board.

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2029115%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ELS1046%20bringup%20stuck%20in%20BL2%2C%20DDR%20init%20failed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2029115%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EWe%20have%20a%20custom%20LS1046%20board%20with%20DDR4.%20I%20have%20mapped%20DQ%20lines%20and%20got%20a%20successful%20CodeWarrior%20DDR%20validation%20and%20passed%20Operational%20DDR%20tests%20with%20ECC%20disabled%2C%20and%20speed%201300%20MT%2Fs.%20I%20have%204%20x%201Gb%20x%2016%20DDR4%20devices%20fitted.%3C%2FP%3E%3CP%3EI've%20taken%20the%20ddr_init1.c%20output%20and%20applied%20it%20to%20my%20atf%20version%20lf-5.10.52-2.1.0.%3C%2FP%3E%3CP%3EBL2%20fails%20to%20boot%20from%20SD%20Card%20(DDR%20init%20failed).%20If%20I%20use%20the%20ddr_raw_timing%20structure%20from%20Codewarrior%20(no%26nbsp%3BCONFIG_STATIC_DDR)%20I%20get%3A%3C%2FP%3E%3CBLOCKQUOTE%3E%3CP%3EINFO%3A%20SoC%20workaround%20for%20Errata%20A008850%20Early-Phase%20was%20applied%3CBR%20%2F%3EINFO%3A%20SoC%20workaround%20for%20Errata%20A010539%20was%20applied%3CBR%20%2F%3EINFO%3A%20RCW%20BOOT%20SRC%20is%20SD%2FEMMC%3CBR%20%2F%3EINFO%3A%20SoC%20workaround%20for%20DDR%20Errata%20A008511%20was%20applied%3CBR%20%2F%3EINFO%3A%20SoC%20workaround%20for%20DDR%20Errata%20A009803%20was%20applied%3CBR%20%2F%3EINFO%3A%20SoC%20workaround%20for%20DDR%20Errata%20A009942%20was%20applied%3CBR%20%2F%3EINFO%3A%20SoC%20workaround%20for%20DDR%20Errata%20A010165%20was%20applied%3CBR%20%2F%3EINFO%3A%20time%20base%200%20ms%3CBR%20%2F%3ENOTICE%3A%20Fixed%20DDR%20on%20board%3CBR%20%2F%3EINFO%3A%20Time%20after%20parsing%20SPD%204%20ms%3CBR%20%2F%3EERROR%3A%20Board%20parameters%20no%20match.%3CBR%20%2F%3EERROR%3A%20Failed%20matching%20board%20timing.%3CBR%20%2F%3EERROR%3A%20DDR%20Clk%3A%20MCLK%20cycle%20is%20481%20ps.%3CBR%20%2F%3EERROR%3A%20DDR%20Clk%20is%20faster%20than%20DIMM%20can%20support.%3CBR%20%2F%3EERROR%3A%20mclk%20481%20invalid%3CBR%20%2F%3EERROR%3A%20cas%20latency%20is%20too%20large%2042%3CBR%20%2F%3EERROR%3A%20Calculating%20DDR%20registers%20failed%3CBR%20%2F%3EERROR%3A%20Calculate%20register%20error%3CBR%20%2F%3EERROR%3A%20DDR%20init%20failed.%3CBR%20%2F%3EINFO%3A%20SoC%20workaround%20for%20Errata%20A008850%20Post-Phase%20was%20applied%3CBR%20%2F%3EINFO%3A%20RCW%20BOOT%20SRC%20is%20SD%2FEMMC%3CBR%20%2F%3EINFO%3A%20esdhc_emmc_init%3CBR%20%2F%3EINFO%3A%20Card%20detected%20successfully%3CBR%20%2F%3EINFO%3A%20init%20done%3A%3CBR%20%2F%3ENOTICE%3A%20Incorrect%20DRAM0%20size%20is%20defined%20in%20platform_def.h%3CBR%20%2F%3EERROR%3A%20mmap_add_region_check()%20failed.%20error%20-22%3CBR%20%2F%3EERROR%3A%20mmap_add_region_check()%20failed.%20error%20-22%3CBR%20%2F%3ENOTICE%3A%20BL2%3A%20v2.4(release)%3Alf-5.10.52-2.1.0-rc2-0-gbb4957067-dirty%3CBR%20%2F%3ENOTICE%3A%20BL2%3A%20Built%20%3A%2014%3A21%3A46%2C%20Jan%2016%202025%3CBR%20%2F%3EINFO%3A%20Configuring%20TrustZone%20Controller%3CBR%20%2F%3EINFO%3A%20BL2%3A%20Doing%20platform%20setup%3CBR%20%2F%3EINFO%3A%20BL2%3A%20Loading%20image%20id%203%3CBR%20%2F%3EINFO%3A%20sd-mmc%20read%20done.%3C%2FP%3E%3C%2FBLOCKQUOTE%3E%3CP%3EIf%20I%20define%26nbsp%3BCONFIG_STATIC_DDR%20and%20use%20the%20static_1300%20struct%20from%20Codewarrior%20I%20get%3A%3C%2FP%3E%3CBLOCKQUOTE%3E%3CP%3EINFO%3A%20SoC%20workaround%20for%20Errata%20A008850%20Early-Phase%20was%20applied%3CBR%20%2F%3EINFO%3A%20SoC%20workaround%20for%20Errata%20A010539%20was%20applied%3CBR%20%2F%3EINFO%3A%20RCW%20BOOT%20SRC%20is%20SD%2FEMMC%3CBR%20%2F%3EINFO%3A%20SoC%20workaround%20for%20DDR%20Errata%20A008511%20was%20applied%3CBR%20%2F%3EINFO%3A%20SoC%20workaround%20for%20DDR%20Errata%20A009803%20was%20applied%3CBR%20%2F%3EINFO%3A%20SoC%20workaround%20for%20DDR%20Errata%20A009942%20was%20applied%3CBR%20%2F%3EINFO%3A%20SoC%20workaround%20for%20DDR%20Errata%20A010165%20was%20applied%3CBR%20%2F%3EINFO%3A%20Time%20before%20programming%20controller%200%20ms%3CBR%20%2F%3EWARNING%3A%20Warning%3A%20Optimal%20CPO%20value%20not%20set.%3CBR%20%2F%3EERROR%3A%20Found%20training%20error(s)%3A%200x3000%3CBR%20%2F%3EERROR%3A%20Error%3A%20Waiting%20for%20D_INIT%20timeout.%3CBR%20%2F%3EERROR%3A%20Writing%20DDR%20register(s)%20failed%3CBR%20%2F%3EERROR%3A%20Programing%20DDRC%20error%3CBR%20%2F%3EERROR%3A%20DDR%20init%20failed.%3CBR%20%2F%3EINFO%3A%20SoC%20workaround%20for%20Errata%20A008850%20Post-Phase%20was%20applied%3CBR%20%2F%3EINFO%3A%20RCW%20BOOT%20SRC%20is%20SD%2FEMMC%3CBR%20%2F%3EINFO%3A%20esdhc_emmc_init%3CBR%20%2F%3EINFO%3A%20Card%20detected%20successfully%3CBR%20%2F%3EINFO%3A%20init%20done%3A%3CBR%20%2F%3ENOTICE%3A%20Incorrect%20DRAM0%20size%20is%20defined%20in%20platform_def.h%3CBR%20%2F%3EERROR%3A%20mmap_add_region_check()%20failed.%20error%20-22%3CBR%20%2F%3EERROR%3A%20mmap_add_region_check()%20failed.%20error%20-22%3CBR%20%2F%3ENOTICE%3A%20BL2%3A%20v2.4(release)%3Alf-5.10.52-2.1.0-rc2-0-gbb4957067-dirty%3CBR%20%2F%3ENOTICE%3A%20BL2%3A%20Built%20%3A%2014%3A52%3A12%2C%20Jan%2016%202025%3CBR%20%2F%3EINFO%3A%20Configuring%20TrustZone%20Controller%3CBR%20%2F%3EINFO%3A%20BL2%3A%20Doing%20platform%20setup%3CBR%20%2F%3EINFO%3A%20BL2%3A%20Loading%20image%20id%203%3CBR%20%2F%3EINFO%3A%20sd-mmc%20read%20done.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EI%20can%20see%20DDR%20clock%20on%20a%20scope%20at%20650MHz.%20I'm%20fairly%20confident%20on%20the%20DQ%20map%20as%20I've%20double%20checked%2C%20and%20DDR%20Validation%20passed.%3C%2FP%3E%3CP%3EDoes%20anyone%20have%20any%20ideas%20what%20I%20should%20do%20next%3F%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3C%2FBLOCKQUOTE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2030483%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20LS1046%20bringup%20stuck%20in%20BL2%2C%20DDR%20init%20failed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2030483%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EYes%2C%26nbsp%3B%3CSPAN%3ECodeWarrior%20gets%20the%20DQ%20Mapping%20from%20the%20running%20board.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2029774%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20LS1046%20bringup%20stuck%20in%20BL2%2C%20DDR%20init%20failed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2029774%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EWhen%20I%20do%20this%20should%20all%20properties%20match%2C%20e.g.%20does%20CodeWarrior%20get%20the%20DQ%20Mapping%20from%20the%20running%20board%3F%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20seeing%20a%20lot%20of%20difference%20in%20the%20DQ%20mapping%20for%20example.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2029558%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20LS1046%20bringup%20stuck%20in%20BL2%2C%20DDR%20init%20failed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2029558%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EPlease%20boot%20ATF%20on%20the%20target%20board%2C%20then%20connect%20CodeWarrior%20to%20the%20target%20board%20to%20create%20a%20QCVS%20DDR%20project%20with%20%22From%20target%22%20method%2C%20then%20check%20whether%20the%20generated%20DDR%20controller%20configuration%20parameters%20are%20same%20with%20what%20you%20provided%20in%20ATF%20source%20code.%3C%2FP%3E%3C%2FLINGO-BODY%3E