IMX8M Nano Bring up and DDR4 Stress tool not responding after calibration

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

IMX8M Nano Bring up and DDR4 Stress tool not responding after calibration

Jump to solution
3,275 Views
betanapallisandeepraj
Contributor III

Hi, I am working on i.MX_8M_Nano board with MIMX8MN5DVTJZAA-ON14Y-SBAG1948B default Application processor. But Default Micron DDR4 replaced with Samsung 4Gb DDR4 dram chip of model number K4A4G165WF-BCTD. I am trying to generate ddr initialization code to build yocto and uboot. I have used MX8M_Nano_DDR4_RPA_v4.xlsx tool to generate DDR Stress test file. After Downloading the script to the board, I started calibration. At calibration 'Step 1: DDRPHY Training', it seems like not proceeding to next step even after 30 minutes. If someone can help me on this to proceed further would be a great. refence Documents are at, https://www.samsung.com/semiconductor/global.semi/file/resource/2017/11/DS_K4A4G165WE_BC_I_Rev1_4-1.... https://www.samsung.com/semiconductor/global.semi/file/resource/2017/11/DDR4_Device_Operations_Rev11... https://www.samsung.com/semiconductor/global.semi/file/resource/2018/06/DDR4_Product_guide_May.18.pd...

RPA tool excel sheet attached. 

Please find the log as below,

----------------------------------------------------------------------------------------------------------------------------- Download is complete Waiting for the target board boot... ===================hardware_init===================== ********Found PMIC BD718XX********** hardware_init exit ************************************************************************* ************************************************************************* ************************************************************************* MX8 DDR Stress Test V3.20 Built on Feb 23 2021 13:49:21 ************************************************************************* Waiting for board configuration from PC-end... --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: 0x97d000 - tcr_el3: 0x2051c - mair_el3: 0x774400 - sctlr_el3: 0xc01815 - id_aa64mmfr0_el1: 0x1122 - MMU and cache setup complete ************************************************************************* ARM clock(CA53) rate: 1500MHz DDR Clock: 2666MHz ============================================ DDR configuration DDR type is DDR4 Data width: 16, bank num: 8 For DDR4, bank num is the total of 2 bank groups and 4 banks per group Row size: 15, col size: 10 One chip select is used Number of DDR controllers used on the SoC: 1 Density per chip select: 512MB Density per controller is: 512MB Total density detected on the board is: 512MB ============================================ MX8M-nano: Cortex-A53 is found ************************************************************************* ============ Step 1: DDRPHY Training... ============ ---DDR 1D-Training @1333Mhz...

Labels (1)
0 Kudos
1 Solution
3,100 Views
betanapallisandeepraj
Contributor III

Hi Igor,

Even with the default ddr4_timing.c file I could boot successfully with device tree changes as below in kernel and build imx8mnevk.conf file. 

Changes are as below in kernel source code for my samsung DDR4 of 512MB model K4A4G165WF-BCTD,

diff --git a/arch/arm64/boot/dts/freescale/imx8mn.dtsi b/arch/arm64/boot/dts/freescale/imx8mn.dtsi
index 5d4c245376b0..2b619745f67e 100644
--- a/arch/arm64/boot/dts/freescale/imx8mn.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mn.dtsi
@@ -151,7 +151,7 @@

memory@40000000 {
device_type = "memory";
- reg = <0x0 0x40000000 0 0x80000000>;
+ reg = <0x0 0x40000000 0 0x60000000>;
};

resmem: reserved-memory {
@@ -163,8 +163,8 @@
linux,cma {
compatible = "shared-dma-pool";
reusable;
- size = <0 0x28000000>;
- alloc-ranges = <0 0x40000000 0 0x60000000>;
+ size = <0 0xa000000>;
+ alloc-ranges = <0 0x40000000 0 0x50000000>;
linux,cma-default;
};
};

In imx-yocto-bsp/sources/meta-imx/meta-bsp/conf/machine/imx8mnevk.conf

I modified as below,

- required conf/machine/imx8mnlpddr4evk.conf

+ required conf/machine/imx8mnlpddr4evk.conf

And I configured with bitbake -c menuconfig virtual/kernel 

Library routines->DMA Contiguous Memory Allocator->Size in Mega Bytes

I have kept 160MB for my 512MB ram. One can increase or decrease according to there RAM size. 

 

After all these, I could compile and build and boot successfully. 

Thank you Igor and NXP for the support. 

View solution in original post

0 Kudos
7 Replies
3,101 Views
betanapallisandeepraj
Contributor III

Hi Igor,

Even with the default ddr4_timing.c file I could boot successfully with device tree changes as below in kernel and build imx8mnevk.conf file. 

Changes are as below in kernel source code for my samsung DDR4 of 512MB model K4A4G165WF-BCTD,

diff --git a/arch/arm64/boot/dts/freescale/imx8mn.dtsi b/arch/arm64/boot/dts/freescale/imx8mn.dtsi
index 5d4c245376b0..2b619745f67e 100644
--- a/arch/arm64/boot/dts/freescale/imx8mn.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mn.dtsi
@@ -151,7 +151,7 @@

memory@40000000 {
device_type = "memory";
- reg = <0x0 0x40000000 0 0x80000000>;
+ reg = <0x0 0x40000000 0 0x60000000>;
};

resmem: reserved-memory {
@@ -163,8 +163,8 @@
linux,cma {
compatible = "shared-dma-pool";
reusable;
- size = <0 0x28000000>;
- alloc-ranges = <0 0x40000000 0 0x60000000>;
+ size = <0 0xa000000>;
+ alloc-ranges = <0 0x40000000 0 0x50000000>;
linux,cma-default;
};
};

In imx-yocto-bsp/sources/meta-imx/meta-bsp/conf/machine/imx8mnevk.conf

I modified as below,

- required conf/machine/imx8mnlpddr4evk.conf

+ required conf/machine/imx8mnlpddr4evk.conf

And I configured with bitbake -c menuconfig virtual/kernel 

Library routines->DMA Contiguous Memory Allocator->Size in Mega Bytes

I have kept 160MB for my 512MB ram. One can increase or decrease according to there RAM size. 

 

After all these, I could compile and build and boot successfully. 

Thank you Igor and NXP for the support. 

0 Kudos
3,174 Views
betanapallisandeepraj
Contributor III

Hi,

I tried to boot from default images provided and decreased ddr4 of 8Gb. 
I could see a kernel crash as attached in the log. 

Can someone help me in identifying or narrow downing the issue?

In short log as below,

 

[ 0.110214] io scheduler kyber registered
[ 0.114687] EINJ: ACPI disabled.
[ 0.121956] imx-sdma 302b0000.dma-controller: Direct firmware load for imx/sdma/sdma-imx7d.bin failed with error -2
[ 0.121968] imx-sdma 302b0000.dma-controller: Falling back to sysfs fallback for: imx/sdma/sdma-imx7d.bin
[ 0.122176] ------------[ cut here ]------------
[ 0.122180] Unexpected interrupt received!
[ 0.122238] WARNING: CPU: 3 PID: 0 at drivers/irqchip/irq-gic-v3.c:650 gic_handle_irq+0x114/0x148
[ 0.122242] Modules linked in:
[ 0.122251] CPU: 3 PID: 0 Comm: swapper/3 Not tainted 5.4.70-2.3.0+g4f2631b022d8 #1
[ 0.122255] Hardware name: NXP i.MX8MNano DDR4 EVK board (DT)
[ 0.122262] pstate: 60000085 (nZCv daIf -PAN -UAO)
[ 0.122268] pc : gic_handle_irq+0x114/0x148
[ 0.122273] lr : gic_handle_irq+0x114/0x148
[ 0.122276] sp : ffff80001001bfe0
[ 0.122280] x29: ffff80001001bfe0 x28: ffff00007a0ab800
[ 0.122286] x27: 0000000000000000 x26: ffff80001001c000
[ 0.122293] x25: ffff800010018000 x24: ffff800011a09218
[ 0.122300] x23: 0000000040000005 x22: ffff800010087870
[ 0.122306] x21: ffff800011c8bf30 x20: 000000000000001e
[ 0.122313] x19: 000000000000001e x18: 0000000000000010
[ 0.122319] x17: 0000000000000001 x16: 0000000000000019
[ 0.122325] x15: ffff00007a0abc70 x14: ffffffffffffffff
[ 0.122331] x13: ffff80009001bd37 x12: ffff80001001bd3f
[ 0.122336] x11: ffff800011a21000 x10: ffff800011b47328
[ 0.122342] x9 : 0000000000000000 x8 : 6365722074707572
[ 0.122348] x7 : 7265746e69206465 x6 : 00000000000000b0
[ 0.122353] x5 : 0000000000000000 x4 : 0000000000000000
[ 0.122359] x3 : 00000000ffffffff x2 : ffff800011a21cc8
[ 0.122365] x1 : 58d752a76e66fb00 x0 : 0000000000000000
[ 0.122371] Call trace:
[ 0.122377] gic_handle_irq+0x114/0x148
[ 0.122383] el1_irq+0xb8/0x180
[ 0.122390] arch_cpu_idle+0x10/0x18
[ 0.122397] do_idle+0x200/0x280
[ 0.122403] cpu_startup_entry+0x24/0x80
[ 0.122412] secondary_start_kernel+0x154/0x190
[ 0.122421] ---[ end trace 5fef767320820c86 ]---
[ 0.161268] mxs-dma 33000000.dma-controller: initialized
[ 0.166078] Bus freq driver module loaded
[ 0.190033] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[ 0.200058] 30860000.serial: ttymxc0 at MMIO 0x30860000 (irq = 57, base_baud = 5000000) is a IMX
[ 0.202984] 30880000.serial: ttymxc2 at MMIO 0x30880000 (irq = 58, base_baud = 5000000) is a IMX
[ 0.205471] 30890000.serial: ttymxc1 at MMIO 0x30890000 (irq = 59, base_baud = 1500000) is a IMX
[ 1.348705] printk: console [ttymxc1] enabled
[ 1.356174] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000010
[ 1.364966] Mem abort info:
[ 1.367763] ESR = 0x96000004
[ 1.370823] EC = 0x25: DABT (current EL), IL = 32 bits
[ 1.376135] SET = 0, FnV = 0
[ 1.379191] EA = 0, S1PTW = 0
[ 1.382333] Data abort info:
[ 1.385215] ISV = 0, ISS = 0x00000004
[ 1.389051] CM = 0, WnR = 0
[ 1.392024] [0000000000000010] user address but active_mm is swapper
[ 1.398381] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[ 1.403952] Modules linked in:
[ 1.407009] CPU: 1 PID: 1 Comm: swapper/0 Tainted: G W 5.4.70-2.3.0+g4f2631b022d8 #1
[ 1.416050] Hardware name: NXP i.MX8MNano DDR4 EVK board (DT)
[ 1.421795] pstate: 60000005 (nZCv daif -PAN -UAO)
[ 1.426590] pc : inode_permission+0xc4/0x160
[ 1.430860] lr : lookup_one_len_common+0x9c/0xe0
[ 1.435474] sp : ffff80001003bc90
[ 1.438787] x29: ffff80001003bc90 x28: 0000000000000000
[ 1.444098] x27: 0000000000000000 x26: ffff800011730520
[ 1.449410] x25: ffff800011720988 x24: ffff8000117db078
[ 1.454721] x23: 0000000000000000 x22: ffff800011541fd0
[ 1.460032] x21: 0000000000000000 x20: 0000000000000001
[ 1.465343] x19: ffff000078044940 x18: 0000000000000000
[ 1.470654] x17: 0000000000000000 x16: 0000000000000001
[ 1.475965] x15: ffff00007a090470 x14: ffffffffffffffff
[ 1.481276] x13: ffff00007a51291c x12: 0000000000000020
[ 1.486587] x11: 0101010101010101 x10: 7f7f7f7f7f7f7f7f
[ 1.491898] x9 : fefefeff7273716e x8 : ffff80001003bd08
[ 1.497210] x7 : 000000000000000c x6 : ffff800011541fdc
[ 1.502521] x5 : 61c8864680b583eb x4 : c2703ee5ded8dc9d
[ 1.507833] x3 : 000000007374726f x2 : ffff800011541fdc
[ 1.513144] x1 : 0000000000000001 x0 : 0000000000000000
[ 1.518456] Call trace:
[ 1.520903] inode_permission+0xc4/0x160
[ 1.524826] lookup_one_len_common+0x9c/0xe0
[ 1.529096] lookup_one_len+0x38/0x98
[ 1.532759] start_creating+0x68/0x130
[ 1.536506] debugfs_create_dir+0x18/0x108
[ 1.540603] init+0x68/0x110
[ 1.543483] do_one_initcall+0x50/0x1a8
[ 1.547319] kernel_init_freeable+0x194/0x23c
[ 1.551676] kernel_init+0x10/0x100
[ 1.555164] ret_from_fork+0x10/0x1c
[ 1.558744] Code: 3100043f 54fffb41 17ffffdf f9401260 (f9400802)
[ 1.564842] ---[ end trace 5fef767320820c87 ]---
[ 1.569481] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[ 1.577135] SMP: stopping secondary CPUs
[ 1.581059] Kernel Offset: disabled
[ 1.584546] CPU features: 0x0002,2000200c
[ 1.588553] Memory Limit: none
[ 1.591608] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]---

 

0 Kudos
3,253 Views
igorpadykov
NXP Employee
NXP Employee

Hi betanapallisandeepraj

 

such hanging may be caused by hardware issues, like broken or incorrectly routed

memory traces, so one can recheck ddr4 conections and layout using guidelines in

i.MX 8M Nano Hardware Developer’s Guide

 

Best regards
igor

3,244 Views
betanapallisandeepraj
Contributor III

Hi Igor,

Thank you for the response. But when I tried to flash default boot image of the board and custom build core image, I could see the boot log and u-boot prompt also. After that It is going to kernel panic. This indicates that hardware integration is fine. There could be another issue which is causing this hang at calibration with DDR tool. 

Please find the command used to flash as below,

uuu.exe -b emmc_all imx-boot-imx8mnddr4evk-sd.bin-flash_ddr4_evk imx-image-core-imx8mnevk-20210312094415.rootfs.wic.bz2

Please find the boot log with default image up to u-boot as below,

DDRINFO: start DRAM init
DDRINFO: DRAM rate 2400MTS
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
Normal Boot
Trying to boot from BOOTROM
Net:
Error: ethernet@30be0000 address not set.

Error: ethernet@30be0000 address not set.
No ethernet found.

Fastboot: Normal
Normal Boot
Hit any key to stop autoboot: 0
u-boot=>
u-boot=>
u-boot=>

0 Kudos
3,241 Views
igorpadykov
NXP Employee
NXP Employee

Hi betanapallisandeepraj

 

also one can check if uart is configured properly as described

in sect. "Sample configuration in the .ds script for i.MX 8M debug UART2"

https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-8M-Family-DDR-Tool-Release/ta-p/110...

 

Best regards
igor

3,218 Views
betanapallisandeepraj
Contributor III

Hi igor,

I have set it as 1 that is uart2. I could calibrate and generate code with default script. 
But not with the generated script for samsung ddr4. I do not know why tool is hanging at calibration. 

UART seems fine. 

Thank you,
Sandeep Raj

0 Kudos
3,213 Views
igorpadykov
NXP Employee
NXP Employee

Hi Sandeep

 

if you are able to calibrate with default script seems you can try to use it.

 

Best regards
igor