mediatek: dts: fix the broken memory node

Add the missing "device_type" property to fix the memory node. The
Linux kernel can not get the memory size without it. Though u-boot
can automatically fixup the memory node by adding the "device_type"
and "reg" properties if the CONFIG_ARCH_FIXUP_FDT_MEMORY symbol is
enabled, it's better not to rely on this optional feature. This
patch also adds the reg address for the memory node name to follow
the naming rules.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/19741
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit is contained in:
Shiji Yang 2025-08-08 20:53:58 +08:00 committed by Hauke Mehrtens
parent 78188ee2bc
commit 6f33529a12
57 changed files with 114 additions and 57 deletions

View File

@ -11,8 +11,9 @@
label-mac-device = &gmac0;
};
memory {
reg = <0 0x40000000 0 0x0F000000>;
memory@40000000 {
reg = <0 0x40000000 0 0x0f000000>;
device_type = "memory";
};
rtkgsw: rtkgsw@0 {

View File

@ -7,8 +7,9 @@
model = "Buffalo WSR-3200AX4S";
compatible = "buffalo,wsr-3200ax4s", "mediatek,mt7622";
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x1f000000>;
device_type = "memory";
};
};

View File

@ -45,8 +45,9 @@
};
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x40000000>;
device_type = "memory";
};
};

View File

@ -134,8 +134,9 @@
enable-active-high;
};
memory {
reg = <0 0x40000000 0 0x3F000000>;
memory@40000000 {
reg = <0 0x40000000 0 0x3f000000>;
device_type = "memory";
};
reg_1p8v: regulator-1p8v {

View File

@ -25,8 +25,9 @@
bootargs = "earlycon=uart8250,mmio32,0x11002000 console=ttyS0,115200n8 swiotlb=512";
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x1f000000>;
device_type = "memory";
};
leds {

View File

@ -80,8 +80,9 @@
};
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x40000000>;
device_type = "memory";
};
reg_1p8v: regulator-1p8v {

View File

@ -108,8 +108,9 @@
};
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x40000000>;
device_type = "memory";
};
};

View File

@ -71,8 +71,9 @@
};
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x40000000>;
device_type = "memory";
};
};

View File

@ -90,8 +90,9 @@
};
};
memory {
memory@40000000 {
reg = <0x0 0x40000000 0x0 0x40000000>;
device_type = "memory";
};
reserved-memory {

View File

@ -45,8 +45,9 @@
};
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x3f000000>;
device_type = "memory";
};
reg_1p8v: regulator-1p8v {

View File

@ -26,8 +26,9 @@
bootargs = "earlycon=uart8250,mmio32,0x11002000 swiotlb=512 ubi.block=0,fit root=/dev/fit0";
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x8000000>;
device_type = "memory";
};
leds {

View File

@ -20,8 +20,9 @@
stdout-path = "serial0:115200n8";
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x10000000>; // 256mb
device_type = "memory";
};
gpio-keys {

View File

@ -25,6 +25,7 @@
memory@40000000 {
reg = <0 0x40000000 0 0x10000000>;
device_type = "memory";
};
gpio-keys {

View File

@ -19,8 +19,9 @@
bootargs-override = "";
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x10000000>;
device_type = "memory";
};
keys {

View File

@ -24,8 +24,9 @@
stdout-path = "serial0:115200n8";
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x10000000>;
device_type = "memory";
};
gpio-keys {

View File

@ -24,6 +24,7 @@
memory@40000000 {
reg = <0 0x40000000 0 0x10000000>;
device_type = "memory";
};
gpio-keys {

View File

@ -27,8 +27,9 @@
stdout-path = "serial0:115200n8";
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x20000000>;
device_type = "memory";
};
gpio-keys {

View File

@ -55,8 +55,9 @@
};
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x10000000>;
device_type = "memory";
};
};

View File

@ -22,8 +22,9 @@
rootdisk = <&firmware>;
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x10000000>;
device_type = "memory";
};
reg_3p3v: regulator-3p3v {

View File

@ -25,8 +25,9 @@
stdout-path = "serial0:115200n8";
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x10000000>;
device_type = "memory";
};
gpio-keys {

View File

@ -60,6 +60,7 @@
memory@40000000 {
reg = <0 0x40000000 0 0x40000000>;
device_type = "memory";
};
};

View File

@ -26,8 +26,9 @@
stdout-path = "serial0:115200n8";
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x10000000>;
device_type = "memory";
};
gpio-keys {

View File

@ -22,8 +22,9 @@
stdout-path = "serial0:115200n8";
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x20000000>;
device_type = "memory";
};
keys {

View File

@ -26,6 +26,7 @@
memory@40000000 {
reg = <0 0x40000000 0 0x10000000>;
device_type = "memory";
};
gpio-keys {

View File

@ -25,6 +25,7 @@
memory@40000000 {
reg = <0 0x40000000 0 0x40000000>;
device_type = "memory";
};
beeper {

View File

@ -22,8 +22,9 @@
rootdisk = <&ubi_fit_volume>;
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x40000000>;
device_type = "memory";
};
reg_3p3v: regulator-3p3v {

View File

@ -25,8 +25,9 @@
stdout-path = "serial0:115200n8";
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x10000000>;
device_type = "memory";
};
gpio-keys {

View File

@ -108,8 +108,9 @@
};
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x10000000>;
device_type = "memory";
};
};

View File

@ -23,8 +23,9 @@
stdout-path = "serial0:115200n8";
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x20000000>;
device_type = "memory";
};
gpio-keys {

View File

@ -19,8 +19,9 @@
stdout-path = "serial0:115200n8";
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x10000000>;
device_type = "memory";
};
gpio-keys {

View File

@ -22,8 +22,9 @@
bootargs = "earlycon=uart8250,mmio32,0x11002000 console=ttyS0,115200n8";
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x40000000>;
device_type = "memory";
};
gpio-keys {

View File

@ -22,8 +22,9 @@
bootargs = "earlycon=uart8250,mmio32,0x11002000 console=ttyS0,115200n8";
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x10000000>;
device_type = "memory";
};
gpio-keys {

View File

@ -19,8 +19,9 @@
stdout-path = "serial0:115200n8";
};
memory@0 {
memory@40000000 {
reg = <0 0x40000000 0 0x20000000>;
device_type = "memory";
};
reg_1p8v: regulator-1p8v {

View File

@ -12,8 +12,9 @@
bootargs = "dm-mod.create=\"acer,,,ro,0 1 zero 1 0 0 0\" rootfstype=squashfs,ext4 rootwait root=/dev/mmcblk0p6 fstools_ignore_partname=1";
};
memory@0 {
memory@40000000 {
reg = <0 0x40000000 0 0x20000000>;
device_type = "memory";
};
reg_1p8v: regulator-1p8v {

View File

@ -26,8 +26,9 @@
bootargs-override = "";
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x20000000>;
device_type = "memory";
};
keys {

View File

@ -25,8 +25,9 @@
bootargs-override = "";
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x20000000>;
device_type = "memory";
};
keys {

View File

@ -25,8 +25,9 @@
bootargs-override = "";
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x20000000>;
device_type = "memory";
};
keys {

View File

@ -32,8 +32,9 @@
rootdisk-spim-nand = <&nand_rootdisk>;
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x80000000>;
device_type = "memory";
};
gpio-keys {

View File

@ -26,6 +26,7 @@
memory@40000000 {
reg = <0 0x40000000 0 0x20000000>;
device_type = "memory";
};
gpio-keys {

View File

@ -30,6 +30,7 @@
memory@40000000 {
reg = <0 0x40000000 0 0x40000000>;
device_type = "memory";
};
gpio-keys {

View File

@ -28,6 +28,7 @@
memory@40000000 {
reg = <0 0x40000000 0 0x20000000>;
device_type = "memory";
};
gpio-keys {

View File

@ -26,8 +26,9 @@
stdout-path = "serial0:115200n8";
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x10000000>;
device_type = "memory";
};
keys {

View File

@ -25,6 +25,7 @@
memory@40000000 {
reg = <0 0x40000000 0 0x20000000>;
device_type = "memory";
};
gpio-keys {

View File

@ -25,6 +25,7 @@
memory@40000000 {
reg = <0 0x40000000 0 0x20000000>;
device_type = "memory";
};
gpio-keys {

View File

@ -22,8 +22,9 @@
stdout-path = "serial0:115200n8";
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x20000000>;
device_type = "memory";
};
reg_3p3v: regulator-3p3v {

View File

@ -26,8 +26,9 @@
stdout-path = "serial0:115200n8";
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x40000000>;
device_type = "memory";
};
reg_3p3v: regulator-3p3v {

View File

@ -20,8 +20,9 @@
stdout-path = "serial0:115200n8";
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x20000000>;
device_type = "memory";
};
keys {

View File

@ -23,8 +23,9 @@
stdout-path = "serial0:115200n8";
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x40000000>;
device_type = "memory";
};
reg_1p8v: regulator-1p8v {

View File

@ -27,8 +27,9 @@
bootargs = "earlycon=uart8250,mmio32,0x11002000 console=ttyS0,115200n8";
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x40000000>;
device_type = "memory";
};
reg_3p3v: regulator-3p3v {

View File

@ -21,8 +21,9 @@
stdout-path = "serial0:115200n8";
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x20000000>;
device_type = "memory";
};
keys {

View File

@ -24,8 +24,9 @@
stdout-path = "serial0:115200n8";
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x20000000>;
device_type = "memory";
};
keys {

View File

@ -27,8 +27,9 @@
bootargs = "console=ttyS0,115200n1 pci=pcie_bus_perf root=PARTLABEL=rootfs";
};
memory {
memory@40000000 {
reg = <0x0 0x40000000 0x0 0x40000000>;
device_type = "memory";
};
reserved-memory {

View File

@ -86,8 +86,9 @@
led-upgrade = &led_status_blue;
};
memory {
memory@40000000 {
reg = <0x0 0x40000000 0x0 0x40000000>;
device_type = "memory";
};
cpus {

View File

@ -20,8 +20,9 @@
bootargs-append = " root=/dev/fit0 rootwait";
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x20000000>;
device_type = "memory";
};
reg_3p3v: regulator-3p3v {

View File

@ -19,8 +19,9 @@
stdout-path = "serial0:115200n8";
};
memory {
memory@40000000 {
reg = <0 0x40000000 0 0x40000000>;
device_type = "memory";
};
reg_1p8v: regulator-1p8v {

View File

@ -811,7 +811,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
+};
--- /dev/null
+++ b/arch/arm64/boot/dts/mediatek/mt7988a-rfb.dts
@@ -0,0 +1,470 @@
@@ -0,0 +1,471 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2022 MediaTek Inc.
@ -836,8 +836,9 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
+ pci=pcie_bus_perf";
+ };
+
+ memory {
+ memory@40000000 {
+ reg = <0 0x40000000 0 0x40000000>;
+ device_type = "memory";
+ };
+
+ reg_1p8v: regulator-1p8v {

View File

@ -194,7 +194,7 @@ Subject: [PATCH 32/32] WIP: add BPi-R4
};
fan: pwm-fan {
@@ -50,6 +54,141 @@
@@ -50,6 +54,142 @@
rate-select0-gpios = <&pio 21 GPIO_ACTIVE_LOW>;
maximum-power-milliwatt = <3000>;
};
@ -210,8 +210,9 @@ Subject: [PATCH 32/32] WIP: add BPi-R4
+ led-upgrade = &led_green;
+ };
+
+ memory {
+ memory@40000000 {
+ reg = <0x00 0x40000000 0x00 0x10000000>;
+ device_type = "memory";
+ };
+
+ /* SFP1 cage (WAN) */
@ -336,7 +337,7 @@ Subject: [PATCH 32/32] WIP: add BPi-R4
};
&cci {
@@ -174,6 +313,10 @@
@@ -174,6 +314,10 @@
color = <LED_COLOR_ID_GREEN>;
};
@ -347,7 +348,7 @@ Subject: [PATCH 32/32] WIP: add BPi-R4
&i2c0 {
pinctrl-names = "default";
pinctrl-0 = <&i2c0_pins>;
@@ -265,6 +408,14 @@
@@ -265,6 +409,14 @@
#size-cells = <0>;
reg = <1>;
};
@ -362,7 +363,7 @@ Subject: [PATCH 32/32] WIP: add BPi-R4
};
};
@@ -364,34 +515,6 @@
@@ -364,34 +516,6 @@
};
};
@ -397,7 +398,7 @@ Subject: [PATCH 32/32] WIP: add BPi-R4
i2p5gbe_led0_pins: 2p5gbe-led0-pins {
mux {
function = "led";
@@ -399,13 +522,6 @@
@@ -399,13 +523,6 @@
};
};
@ -411,7 +412,7 @@ Subject: [PATCH 32/32] WIP: add BPi-R4
mmc0_pins_emmc_45: mmc0-emmc-45-pins {
mux {
function = "flash";
@@ -427,40 +543,12 @@
@@ -427,40 +544,12 @@
};
};
@ -452,7 +453,7 @@ Subject: [PATCH 32/32] WIP: add BPi-R4
};
&pwm {
@@ -500,6 +588,32 @@
@@ -500,6 +589,32 @@
reg = <0x0 0x200000>;
read-only;
};