[PATCH] arm64: dts: mediatek: Fix malformed SRAM ranges property

airjinkela at gmail.com airjinkela at gmail.com
Wed Oct 28 06:45:44 PDT 2026


From: StarField Xu <airjinkela at gmail.com>

The eth_sram nodes on MT7981, MT7986 and MT7988 sit under the soc
simple-bus, which provides #address-cells = <2> and #size-cells = <2>,
while the SRAM nodes themselves declare single-cell addressing:

    #address-cells = <1>;
    #size-cells = <1>;

A ranges entry is therefore sliced by the OF core as 1 + 2 + 1 cells:

    child-bus-address  (1 cell,  from the SRAM node #address-cells)
    parent-bus-address (2 cells, from the parent bus #address-cells)
    length             (1 cell,  from the SRAM node #size-cells)

The existing values place the parent address in the wrong position, so
the 64-bit parent base is decoded as 0x1540000000000000 instead of
0x15400000. dtc and dtbs_check stay silent because the total cell count
still matches na + pna + ns, and the sram driver only translates child
addresses, which currently do not exist on any of these nodes.

This is a latent bug: adding a pool or export sub-partition, or any
other child with a reg property, makes sram_reserve_regions() fail with

    reserved block ... outside the sram area

and the driver probe aborts. Fix the ranges tuple for all three SoCs so
that the mapping actually resolves to the SRAM window.

Fixes: 65f0e3970143 ("arm64: dts: mediatek: mt7988: add basic ethernet-nodes")
Fixes: d0c970091abf ("arm64: dts: mediatek: mt7986: add sram node")
Fixes: 9846a8c60318 ("arm64: dts: mediatek: mt7981b: Add Ethernet and WiFi offload support")
Signed-off-by: StarField Xu <airjinkela at gmail.com>
---
 arch/arm64/boot/dts/mediatek/mt7981b.dtsi | 2 +-
 arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 2 +-
 arch/arm64/boot/dts/mediatek/mt7988a.dtsi | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt7981b.dtsi b/arch/arm64/boot/dts/mediatek/mt7981b.dtsi
index e63ba3ae395e9..2718c7dd7eb60 100644
--- a/arch/arm64/boot/dts/mediatek/mt7981b.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7981b.dtsi
@@ -492,7 +492,7 @@ int_gbe_phy: ethernet-phy at 0 {
 		eth_sram: sram at 15140000 {
 			compatible = "mmio-sram";
 			reg = <0 0x15140000 0 0x40000>;
-			ranges = <0 0x15140000 0 0x40000>;
+			ranges = <0 0x0 0x15140000 0x40000>;
 			#address-cells = <1>;
 			#size-cells = <1>;
 		};
diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
index 318639a7c64e9..98fd74824653d 100644
--- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
@@ -579,7 +579,7 @@ eth_sram: sram at 15140000 {
 			reg = <0 0x15140000 0 0x40000>;
 			#address-cells = <1>;
 			#size-cells = <1>;
-			ranges = <0 0x15140000 0 0x40000>;
+			ranges = <0 0x0 0x15140000 0x40000>;
 		};
 
 		wo_ccif0: syscon at 151a5000 {
diff --git a/arch/arm64/boot/dts/mediatek/mt7988a.dtsi b/arch/arm64/boot/dts/mediatek/mt7988a.dtsi
index 8c9a5aba25791..d497ac826d669 100644
--- a/arch/arm64/boot/dts/mediatek/mt7988a.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7988a.dtsi
@@ -1009,7 +1009,7 @@ eth_sram: sram at 15400000 {
 			reg = <0 0x15400000 0 0x200000>;
 			#address-cells = <1>;
 			#size-cells = <1>;
-			ranges = <0 0x15400000 0 0x200000>;
+			ranges = <0 0x0 0x15400000 0x200000>;
 		};
 	};
 
-- 
2.56.0




More information about the Linux-mediatek mailing list