[PATCH v2] arm64: dts: amlogic: t7: khadas-vim4: fix memory layout for 8GB RAM

From: Nick Xie

Date: Wed Mar 18 2026 - 22:35:15 EST


The Khadas VIM4 features 8GB of LPDDR4X RAM. The previous memory node
mapped a single incorrect region. This caused the kernel to map MMIO
and secure firmware (ATF/TrustZone) memory holes as standard RAM,
leading to an Asynchronous SError Interrupt during early boot
(paging_init) when the kernel attempted to clear those pages.

Fix this by splitting the 8GB memory layout into three separate
regions to properly avoid the memory holes (e.g., 0xe0000000 -
0xffffffff):
- 3.5GB @ 0x000000000
- 3.5GB @ 0x100000000
- 1.0GB @ 0x200000000

Signed-off-by: Nick Xie <nick@xxxxxxxxxx>
Suggested-by: Ronald Claveau <linux-kernel-dev@xxxxxxxx>
---
Changes in v2:
- Removed leading zeroes in the memory node reg property.

Link to v1: https://lore.kernel.org/all/20260306031014.2421875-1-nick@xxxxxxxxxx/

arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts b/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts
index 25b478e106451..f4c953034be39 100644
--- a/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts
+++ b/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts
@@ -17,7 +17,9 @@ aliases {

memory@0 {
device_type = "memory";
- reg = <0x0 0x0 0x2 0x0>; /* 8 GB */
+ reg = <0x0 0x0 0x0 0xE0000000
+ 0x1 0x0 0x0 0xE0000000
+ 0x2 0x0 0x0 0x40000000>; /* 8 GB */
};

reserved-memory {
--
2.34.1