From: airjinkela@gmail.com
To: Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>
Cc: linux-mediatek@lists.infradead.org,
linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
Frank Wunderlich <frank-w@public-files.de>,
Sjoerd Simons <sjoerd@collabora.com>,
StarField Xu <airjinkela@gmail.com>
Subject: [PATCH] arm64: dts: mediatek: Fix malformed SRAM ranges property
Date: Wed, 28 Oct 2026 21:45:44 +0800 [thread overview]
Message-ID: <20261028134544.594888-1-airjinkela@gmail.com> (raw)
From: StarField Xu <airjinkela@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@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@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>;
};
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@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 {
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@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
reply other threads:[~2026-10-28 13:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261028134544.594888-1-airjinkela@gmail.com \
--to=airjinkela@gmail.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=devicetree@vger.kernel.org \
--cc=frank-w@public-files.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=sjoerd@collabora.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®