Skip to contentSkip to conversation

arm64: dts: mediatek: Fix malformed SRAM ranges property

PATCH Applied [email protected] 2 participants 2 messages Oct 28 – Nov 17

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: dts: mediatek: Fix malformed SRAM ranges property

From: StarField Xu <[email protected]>

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")
---
 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(-)
arch/arm64/boot/dts/mediatek/mt7981b.dtsi +1 -1
index e63ba3ae395e9..2718c7dd7eb60 100644
@@ -492,7 +492,7 @@ int_gbe_phy: ethernet-phy@0 {
 		eth_sram: sram@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>;
 		};
arch/arm64/boot/dts/mediatek/mt7986a.dtsi +1 -1
index 318639a7c64e9..98fd74824653d 100644
@@ -579,7 +579,7 @@ eth_sram: sram@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@151a5000 {
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +1 -1
index 8c9a5aba25791..d497ac826d669 100644
@@ -1009,7 +1009,7 @@ eth_sram: sram@15400000 {
 			reg = <0 0x15400000 0 0x200000>;
 			#address-cells = <1>;
 			#size-cells = <1>;
-			ranges = <0 0x15400000 0 0x200000>;
+			ranges = <0 0x0 0x15400000 0x200000>;
 		};
 	};
 
Signature · 1 line
2.56.0
maintainer Applied
#1 lore raw
Quoted 8 lines · On Wed, 28 Oct 2026 21:45:44 +0800, [email protected] wrote:

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>;

[...]

Applied to v7.4-next/dts64, thanks!

[1/1] arm64: dts: mediatek: Fix malformed SRAM ranges property

      commit: 55e9f03de754eb92e45404def36faaa5942a3877

Cheers,
Angelo