Hi,
The file lpddr4_timing.c generated by mscale_ddr_tool_v3.10 with RPA version 15 is a little different.
But, I have the same file with the i.MX 8M Mini EVK.
--- a/board/freescale/xxx/lpddr4_timing.c
+++ b/board/freescale/xxx/lpddr4_timing.c
@@ -1,21 +1,23 @@
/*
- * Copyright 2018-2019 NXP
+ * Copyright 2019 NXP
*
* SPDX-License-Identifier: GPL-2.0+
*
* Generated code from MX8M_DDR_tool
+ * Align with uboot version:
+ * imx_v2018.03_4.14.78_1.0.0_ga ~ imx_v2018.04_4.19.35_1.1.0_ga
*/
#include <linux/kernel.h>
#include <asm/arch/imx8m_ddr.h>
struct dram_cfg_param ddr_ddrc_cfg[] = {
- /* Initialize DDRC registers */
+ /** Initialize DDRC registers **/
{ 0x3d400304, 0x1 },
{ 0x3d400030, 0x1 },
{ 0x3d400000, 0xa1080020 },
{ 0x3d400020, 0x223 },
- { 0x3d400024, 0x16e3600 },
+ { 0x3d400024, 0x3a980 },
{ 0x3d400064, 0x5b00d2 },
{ 0x3d4000d0, 0xc00305ba },
{ 0x3d4000d4, 0x940000 },
@@ -45,7 +47,7 @@ struct dram_cfg_param ddr_ddrc_cfg[] = {
{ 0x3d4001a8, 0x80000000 },
{ 0x3d4001b0, 0x11 },
{ 0x3d4001c0, 0x1 },
- { 0x3d4001c4, 0x0 },
+ { 0x3d4001c4, 0x1 },
{ 0x3d4000f4, 0xc99 },
{ 0x3d400108, 0x70e1617 },
{ 0x3d400200, 0x1f },
@@ -54,8 +56,6 @@ struct dram_cfg_param ddr_ddrc_cfg[] = {
{ 0x3d400204, 0x80808 },
{ 0x3d400214, 0x7070707 },
{ 0x3d400218, 0x7070707 },
-
- /* performance setting */
{ 0x3d400250, 0x29001701 },
{ 0x3d400254, 0x2c },
{ 0x3d40025c, 0x4000030 },
@@ -67,10 +67,8 @@ struct dram_cfg_param ddr_ddrc_cfg[] = {
{ 0x3d400498, 0x620096 },
{ 0x3d40049c, 0x1100e07 },
{ 0x3d4004a0, 0xc8012c },
-
- /* P1: 400mts */
{ 0x3d402020, 0x21 },
- { 0x3d402024, 0x30d400 },
+ { 0x3d402024, 0x7d00 },
{ 0x3d402050, 0x20d040 },
{ 0x3d402064, 0xc001c },
{ 0x3d4020dc, 0x840000 },
@@ -93,10 +91,9 @@ struct dram_cfg_param ddr_ddrc_cfg[] = {
{ 0x3d402190, 0x3818200 },
{ 0x3d402194, 0x80303 },
{ 0x3d4021b4, 0x100 },
-
- /* p2: 100mts */
+ { 0x3d4020f4, 0xc99 },
{ 0x3d403020, 0x21 },
- { 0x3d403024, 0xc3500 },
+ { 0x3d403024, 0x1f40 },
{ 0x3d403050, 0x20d040 },
{ 0x3d403064, 0x30007 },
{ 0x3d4030dc, 0x840000 },
@@ -119,8 +116,7 @@ struct dram_cfg_param ddr_ddrc_cfg[] = {
{ 0x3d403190, 0x3818200 },
{ 0x3d403194, 0x80303 },
{ 0x3d4031b4, 0x100 },
-
- /* default boot point */
+ { 0x3d4030f4, 0xc99 },
{ 0x3d400028, 0x0 },
};
@@ -208,8 +204,8 @@ struct dram_cfg_param ddr_ddrphy_cfg[] = {
{ 0x220024, 0x1ab },
{ 0x2003a, 0x0 },
{ 0x20056, 0x3 },
- { 0x120056, 0xa },
- { 0x220056, 0xa },
+ { 0x120056, 0x3 },
+ { 0x220056, 0x3 },
{ 0x1004d, 0xe00 },
{ 0x1014d, 0xe00 },
{ 0x1104d, 0xe00 },
@@ -1060,7 +1056,6 @@ struct dram_cfg_param ddr_fsp0_cfg[] = {
{ 0x54008, 0x131f },
{ 0x54009, 0xc8 },
{ 0x5400b, 0x2 },
- { 0x5400d, 0x100 },
{ 0x54012, 0x110 },
{ 0x54019, 0x2dd4 },
{ 0x5401a, 0x31 },
@@ -1101,7 +1096,6 @@ struct dram_cfg_param ddr_fsp1_cfg[] = {
{ 0x54008, 0x121f },
{ 0x54009, 0xc8 },
{ 0x5400b, 0x2 },
- { 0x5400d, 0x100 },
{ 0x54012, 0x110 },
{ 0x54019, 0x84 },
{ 0x5401a, 0x31 },
@@ -1142,7 +1136,6 @@ struct dram_cfg_param ddr_fsp2_cfg[] = {
{ 0x54008, 0x121f },
{ 0x54009, 0xc8 },
{ 0x5400b, 0x2 },
- { 0x5400d, 0x100 },
{ 0x54012, 0x110 },
{ 0x54019, 0x84 },
{ 0x5401a, 0x31 },
@@ -1182,6 +1175,7 @@ struct dram_cfg_param ddr_fsp0_2d_cfg[] = {
{ 0x54008, 0x61 },
{ 0x54009, 0xc8 },
{ 0x5400b, 0x2 },
+ { 0x5400d, 0x100 },
{ 0x5400f, 0x100 },
{ 0x54010, 0x1f7f },
{ 0x54012, 0x110 },
I passed successfully Stress Test on a board which boot normally.
On a card which does not boot, the Calibration failed during CA training.
Could you analyze the text files to help us?
Downloading file 'bin\lpddr4_train1d_string.bin' ..Done
Downloading file 'bin\lpddr4_train2d_string.bin' ..Done
Downloading file 'bin\lpddr4_pmu_train_1d_imem.bin' ..Done
Downloading file 'bin\lpddr4_pmu_train_1d_dmem.bin' ..Done
Downloading file 'bin\lpddr4_pmu_train_2d_imem.bin' ..Done
Downloading file 'bin\lpddr4_pmu_train_2d_dmem.bin' ..Done
Downloading IVT header...Done
Downloading file 'bin\m845s_ddr_stress_test.bin' ...Done
Download is complete
Waiting for the target board boot...
===================hardware_init=====================
hardware_init exit
*************************************************************************
*************************************************************************
*************************************************************************
MX8 DDR Stress Test V3.10
Built on Feb 5 2020 13:04:09
*************************************************************************
--Set up the MMU and enable I and D cache--
- This is the Cortex-A53 core
- Check if I cache is enabled
- Enabling I cache since it was disabled
- Push base address of TTB to TTBR0_EL3
- Config TCR_EL3
- Config MAIR_EL3
- Enable MMU
- Data Cache has been enabled
- Check system memory register, only for debug
- VMCR Check:
- ttbr0_el3: 0x93d000
- tcr_el3: 0x2051c
- mair_el3: 0x774400
- sctlr_el3: 0xc01815
- id_aa64mmfr0_el1: 0x1122
- MMU and cache setup complete
*************************************************************************
ARM clock(CA53) rate: 1800MHz
DDR Clock: 1500MHz
============================================
DDR configuration
DDR type is LPDDR4
Data width: 32, bank num: 8
Row size: 16, col size: 10
One chip select is used
Number of DDR controllers used on the SoC: 1
Density per chip select: 2048MB
Density per controller is: 2048MB
Total density detected on the board is: 2048MB
============================================
MX8M-mini: Cortex-A53 is found
*************************************************************************
============ Step 1: DDRPHY Training... ============
---DDR 1D-Training @1500Mhz...
[Process] End of CA training
[Process] End of initialization
[Process] End of read enable training
[Process] End of fine write leveling
[Process] End of read DQ deskew training
[Process] End of MPR read delay center optimization
[Process] End of Write Leveling coarse delay
[Process] End of write delay center optimization
[Process] End of read delay center optimization
[Process] End of max read latency training
[Result] PASS
---DDR 1D-Training @200Mhz...
[Process] End of CA training
[Process] End of initialization
[Process] End of read enable training
[Process] End of fine write leveling
[Process] End of MPR read delay center optimization
[Process] End of Write Leveling coarse delay
[Process] End of write delay center optimization
[Process] End of read delay center optimization
[Process] End of max read latency training
[Result] PASS
---DDR 1D-Training @50Mhz...
[Process] End of CA training
[Process] End of initialization
[Process] End of read enable training
[Process] End of fine write leveling
[Process] End of MPR read delay center optimization
[Process] End of Write Leveling coarse delay
[Process] End of write delay center optimization
[Process] End of read delay center optimization
[Process] End of max read latency training
[Result] PASS
---DDR 2D-Training @1500Mhz...
[Process] End of initialization
[Process] End of 2D read delay/voltage center optimization
[Process] End of 2D read delay/voltage center optimization
[Process] End of 2D write delay/voltage center optimization
[Process] End of 2D write delay/voltage center optimization
[Result] PASS
============ Step 2: DDR memory accessing... ============
Verifying DDR frequency point0@1500MHz.......Pass
Verifying DDR frequency point1@200MHz.......Pass
Verifying DDR frequency point2@50MHz.......Pass
[Result] OK
============ Step 3: DDR parameters processing... ============
[Result] Done
Success: DDR Calibration completed!!!
'lpddr4_timing.c' is created!
DDR Stress Test Iteration 1
--------------------------------
--Running DDR test on region 1--
--------------------------------
t0.1: data is addr test
....
t0.2: row hop read test
...
t1: memcpy SSN armv8_x32 test
....
t2: byte-wise SSN armv8_x32 test
..
t3: memcpy pseudo random pattern test
....................................................................
t4: IRAM_to_DDRv1 test
...
t5: IRAM_to_DDRv2 test
--------------------------------
--Running DDR test on frequency point1@200MHz--
--------------------------------
t0.1: data is addr test
....
t0.2: row hop read test
...
t1: memcpy SSN armv8_x32 test
....
t2: byte-wise SSN armv8_x32 test
..
t3: memcpy pseudo random pattern test
....................................................................
t4: IRAM_to_DDRv1 test
...
t5: IRAM_to_DDRv2 test
--------------------------------
--Running DDR test on frequency point2@50MHz--
--------------------------------
t0.1: data is addr test
....
t0.2: row hop read test
...
t1: memcpy SSN armv8_x32 test
....
t2: byte-wise SSN armv8_x32 test
..
t3: memcpy pseudo random pattern test
....................................................................
t4: IRAM_to_DDRv1 test
...
t5: IRAM_to_DDRv2 test
Success: DDR Stress test completed!!!