* [PATCH] ARM64: dts: mediatek: fix MT7531 reset polarity and reset sequence
@ 2025-11-20 16:22 Chen Minqiang
2025-11-20 16:45 ` Jakub Kicinski
2025-11-20 21:09 ` Andrew Lunn
0 siblings, 2 replies; 3+ messages in thread
From: Chen Minqiang @ 2025-11-20 16:22 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
AngeloGioacchino Del Regno, Chester A. Unal, Daniel Golle,
DENG Qingfang, Sean Wang, Andrew Lunn
Cc: linux-kernel, linux-arm-kernel, linux-mediatek, netdev,
Chen Minqiang
The MT7531 reset pin is active-low, but multiple MediaTek boards describe
the reset-gpios property without GPIO_ACTIVE_LOW or incorrectly mark it
as active-high. With an active-low GPIO, gpiod_set_value(1) drives the
line low (assert reset) and gpiod_set_value(0) drives it high (deassert).
Update all affected DTS files to explicitly use GPIO_ACTIVE_LOW so that
the reset polarity matches the hardware design.
Additionally, adjust the mt7530 driver reset sequence to correctly assert
reset by driving the GPIO low first, wait for the reset interval, and
then deassert reset by driving the GPIO high.
Boards fixed:
- mt7622-bananapi-bpi-r64
- mt7622-rfb1
- mt7986a-bananapi-bpi-r3
- mt7986a-rfb
- mt7986b-rfb
This ensures the MT7531 receives a proper low-to-high active-low reset
pulse and initializes reliably.
Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
---
arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts | 2 +-
arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts | 2 +-
arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 2 +-
arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts | 2 +-
arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts | 2 +-
drivers/net/dsa/mt7530.c | 4 ++--
6 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
index 9f100b18a676..6f29ce828fdb 100644
--- a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
+++ b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
@@ -155,7 +155,7 @@
interrupt-controller;
#interrupt-cells = <1>;
interrupts-extended = <&pio 53 IRQ_TYPE_LEVEL_HIGH>;
- reset-gpios = <&pio 54 0>;
+ reset-gpios = <&pio 54 GPIO_ACTIVE_LOW>;
ports {
#address-cells = <1>;
diff --git a/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts b/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts
index 8c3e2e2578bc..6600f06ccebf 100644
--- a/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts
+++ b/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts
@@ -137,7 +137,7 @@
switch@0 {
compatible = "mediatek,mt7531";
reg = <0>;
- reset-gpios = <&pio 54 0>;
+ reset-gpios = <&pio 54 GPIO_ACTIVE_LOW>;
ports {
#address-cells = <1>;
diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
index e7654dc9a1c9..8ec2ec78ee46 100644
--- a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
+++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
@@ -203,7 +203,7 @@
interrupt-parent = <&pio>;
interrupts = <66 IRQ_TYPE_LEVEL_HIGH>;
#interrupt-cells = <1>;
- reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>;
+ reset-gpios = <&pio 5 GPIO_ACTIVE_LOW>;
};
};
diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts b/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts
index 5d8e3d3f6c20..732dc4f5244f 100644
--- a/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts
+++ b/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts
@@ -87,7 +87,7 @@
switch: switch@0 {
compatible = "mediatek,mt7531";
reg = <31>;
- reset-gpios = <&pio 5 0>;
+ reset-gpios = <&pio 5 GPIO_ACTIVE_LOW>;
};
};
diff --git a/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts b/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts
index 58f77d932429..91809cdb4499 100644
--- a/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts
+++ b/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts
@@ -64,7 +64,7 @@
switch@0 {
compatible = "mediatek,mt7531";
reg = <31>;
- reset-gpios = <&pio 5 0>;
+ reset-gpios = <&pio 5 GPIO_ACTIVE_LOW>;
ports {
#address-cells = <1>;
diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
index 548b85befbf4..e4caedc3eee5 100644
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2405,9 +2405,9 @@ mt7530_setup(struct dsa_switch *ds)
usleep_range(5000, 5100);
reset_control_deassert(priv->rstc);
} else {
- gpiod_set_value_cansleep(priv->reset, 0);
- usleep_range(5000, 5100);
gpiod_set_value_cansleep(priv->reset, 1);
+ usleep_range(5000, 5100);
+ gpiod_set_value_cansleep(priv->reset, 0);
}
/* Waiting for MT7530 got to stable */
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ARM64: dts: mediatek: fix MT7531 reset polarity and reset sequence
2025-11-20 16:22 [PATCH] ARM64: dts: mediatek: fix MT7531 reset polarity and reset sequence Chen Minqiang
@ 2025-11-20 16:45 ` Jakub Kicinski
2025-11-20 21:09 ` Andrew Lunn
1 sibling, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2025-11-20 16:45 UTC (permalink / raw)
To: Chen Minqiang
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
AngeloGioacchino Del Regno, Chester A. Unal, Daniel Golle,
DENG Qingfang, Sean Wang, Andrew Lunn, linux-kernel,
linux-arm-kernel, linux-mediatek, netdev
On Fri, 21 Nov 2025 00:22:24 +0800 Chen Minqiang wrote:
> arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts | 2 +-
> arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts | 2 +-
> arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 2 +-
> arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts | 2 +-
> arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts | 2 +-
> drivers/net/dsa/mt7530.c | 4 ++--
The dts and drivers/net changes must be in separate patches, they go
via different trees. Please note that we ask contributors to wait
24h before reposting in case there's more feedback for this version:
https://www.kernel.org/doc/html/next/process/maintainer-netdev.html
--
pw-bot: cr
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ARM64: dts: mediatek: fix MT7531 reset polarity and reset sequence
2025-11-20 16:22 [PATCH] ARM64: dts: mediatek: fix MT7531 reset polarity and reset sequence Chen Minqiang
2025-11-20 16:45 ` Jakub Kicinski
@ 2025-11-20 21:09 ` Andrew Lunn
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2025-11-20 21:09 UTC (permalink / raw)
To: Chen Minqiang
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
AngeloGioacchino Del Regno, Chester A. Unal, Daniel Golle,
DENG Qingfang, Sean Wang, linux-kernel, linux-arm-kernel,
linux-mediatek, netdev
On Fri, Nov 21, 2025 at 12:22:24AM +0800, Chen Minqiang wrote:
> The MT7531 reset pin is active-low, but multiple MediaTek boards describe
> the reset-gpios property without GPIO_ACTIVE_LOW or incorrectly mark it
> as active-high. With an active-low GPIO, gpiod_set_value(1) drives the
> line low (assert reset) and gpiod_set_value(0) drives it high (deassert).
>
> Update all affected DTS files to explicitly use GPIO_ACTIVE_LOW so that
> the reset polarity matches the hardware design.
>
> Additionally, adjust the mt7530 driver reset sequence to correctly assert
> reset by driving the GPIO low first, wait for the reset interval, and
> then deassert reset by driving the GPIO high.
>
> Boards fixed:
> - mt7622-bananapi-bpi-r64
> - mt7622-rfb1
> - mt7986a-bananapi-bpi-r3
> - mt7986a-rfb
> - mt7986b-rfb
>
> This ensures the MT7531 receives a proper low-to-high active-low reset
> pulse and initializes reliably.
Please add a comment to the commit message about backwards/forwards
compatibility, how this is safe when booting an old DT blob on a new
kernel. Or a new DT blob on an old kernel. We don't expect regressions
in such cases, and it is good to indicate in the commit message you
have thought about this and don't expect problems.
Andrew
---
pw-bot: cr
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-11-20 21:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-20 16:22 [PATCH] ARM64: dts: mediatek: fix MT7531 reset polarity and reset sequence Chen Minqiang
2025-11-20 16:45 ` Jakub Kicinski
2025-11-20 21:09 ` Andrew Lunn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).