Hello everyone,
I’m currently debugging a DRAM initialization issue on a custom i.MX93 board.
My HW consists of a i.MX93 SoC on a custom board, equipped with a 256 MB LPDDR4 device (AS4C128M16MD4V).
In my actual situation, the board boots correctly, but both U‑Boot and the Linux kernel always detect the DRAM size as 2 GB (0x80000000) (u-boot with dbinfo and Linux via /proc/meminfo or top) instead of the actual 256 MB (0x10000000).
This mismatch causes memory corruption and kernel panics, especially when exercising anonymous memory, for example unpacking large TAR files into ramfs, or after the board is up after several hours.
Here an example panic:
[13991.116549] pc : handle_percpu_devid_irq+0x7c/0x120
[13991.121428] lr : handle_percpu_devid_irq+0x7c/0x120
[13991.126299] sp : ffff80008000bfb0
[13991.129601] x29: ffff80008000bfa0 x28: ffff00000e0dd500 x27: 0000000000000000
[13991.136725] x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000
[13991.143849] x23: 0000000060400009 x22: ffff8000800bb94c x21: ffff80008000bfd0
[13991.150973] x20: ffff8000800c52b4 x19: ffff80008000bfa0 x18: ffff00001feb35c0
[13991.158097] x17: ffff7fff9eb0f000 x16: ffff800080008000 x15: 0000000000000001
[13991.165221] x14: 0000e59fcd64f036 x13: 0000000000000198 x12: ffff00001fe9d640
[13991.172345] x11: 0000000000000040 x10: ffff00000e00e170 x9 : ffff00000e00e168
[13991.179469] x8 : ffff000010000270 x7 : 0000000000000000 x6 : 0000000000000000
[13991.186593] x5 : ffff7fff9eb0f000 x4 : 0000000000000000 x3 : ffff00000e011630
[13991.193717] x2 : ffff800081448c98 x1 : 0000000000001fff x0 : 0000000008030a00
[13991.200842] Call trace:
[13991.203277] handle_percpu_devid_irq+0x7c/0x120
[13991.207800] 0x1
[13991.209629] gic_handle_irq+0x4c/0x11c
[13991.213373] call_on_irq_stack+0x24/0x54
[13991.217290] do_interrupt_handler+0x80/0x84
[13991.221468] el1_interrupt+0x34/0x68
[13991.225038] el1h_64_irq_handler+0x18/0x24
[13991.229129] el1h_64_irq+0x64/0x68
[13991.232518] default_idle_call+0x28/0x3c
[13991.236426] do_idle+0xa0/0xf0
[13991.239477] cpu_startup_entry+0x34/0x3c
[13991.243386] secondary_start_kernel+0x124/0x150
[13991.247910] __secondary_switched+0xb8/0xbc
[13991.252092] Code: f9400a81 2a1603e0 8b030021 d63f0040 (f94026a1)
[13991.258173] ---[ end trace 0000000000000000 ]---
[13991.262784] Kernel panic - not syncing: Oops: Fatal exception in interrupt
[13991.269647] SMP: stopping secondary CPUs
[13991.273561] Kernel Offset: disabled
[13991.277039] CPU features: 0x08,00000004,00280928,4200720b
[13991.282429] Memory Limit: 512 MB
[13991.285646] ---[ end Kernel panic - not syncing: Oops: Fatal exception in interrupt ]---
For now, In both U‑Boot and kernel Device Trees, the memory node is explicitly limited to 256 MB:
memory@80000000 {
device_type = "memory";
reg = <0x0 0x80000000 0x0 0x10000000>;
};
And In U‑Boot, the board configuration was patched so that in imx93_evk.h:
PHYS_SDRAM_SIZE was changed from 0x80000000 to 0x10000000.
LPDDR4 timings were regenerated using the official NXP DDR Configuration Tool and the generated lpddr4x_timing.c was patched accordingly.
Despite all of the above, U‑Boot still reports 2GB of RAM.
I also tried forcing a limit via bootargs:
mem=256M
This always leads to an early OOM / deadlock:
Memory Limit: 256 MB
Kernel panic - not syncing: System is deadlocked on memory
To mitigate memory-related issues in Linux, we are currently limiting the usable memory via kernel bootargs mem=512.
With this limitation, the system is more stable and the issue occurs less frequently.
My questions are if anyone successfully used LPDDR4 devices smaller than 1 GB or 2 GB on i.MX93 or similar boards, and if so, were additional changes required beyond DTS and PHYS_SDRAM_SIZE? (Note: OP-TEE is not enabled, so did not update conf.mk CFG_DDR_SIZE = 0x10000000).
And, if there are additional places in U‑Boot DDR code where DRAM capacity must be explicitly constrained for smaller LPDDR4 devices?
Thanks in advance for any insights or experience you can share.
Best regards,
Sergio