* [PATCH net-next v4 0/2] net: dsa: mxl-gsw1xx: reset the switch through reset-gpios
@ 2026-11-15 22:33 Joseph Telaak via B4 Relay
2026-11-15 22:33 ` [PATCH net-next v4 1/2] dt-bindings: net: dsa: lantiq,gswip: add reset-gpios Joseph Telaak via B4 Relay
2026-11-15 22:33 ` [PATCH net-next v4 2/2] net: dsa: mxl-gsw1xx: reset the switch through reset-gpios Joseph Telaak via B4 Relay
0 siblings, 2 replies; 4+ messages in thread
From: Joseph Telaak via B4 Relay @ 2026-11-15 22:33 UTC (permalink / raw)
To: Hauke Mehrtens, Andrew Lunn, Vladimir Oltean, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: Daniel Golle, Philipp Zabel, netdev, devicetree, linux-kernel,
Joseph Telaak
The GSW1xx driver never resets the switch, and the MDIO core does not
handle reset-gpios for non-PHY devices, so the driver works with whatever
the bootloader configured. On the GL.iNet GL-SFT1200 (Siflower SF19A2890 +
GSW150), nothing answers at internal MDIO address 0 after the bootloader,
and each port's address answers with the neighboring port's PHY, so the
WAN port has no PHY. Describing the PHYs at the addresses they answer at
is not enough: with them at 1 to 3 and no reset, neither LAN port passes
traffic. A hardware reset puts the switch back in its power-on state, as
GL.iNet's own firmware does from Linux.
Patch 1 allows reset-gpios in the binding for the standalone switches.
Patch 2 pulses it at probe. A device tree without reset-gpios behaves as
before.
Tested on a GL.iNet GL-SFT1200 (Intel GSW150 / PEB7084 at SMI address
0x1f, reset on an active-low SoC GPIO), on OpenWrt's 6.18 kernel with
the lantiq_gswip and mxl-gsw1xx drivers backported from mainline and
CONFIG_RESET_GPIO=y: after a warm reboot and after a cold power-on, all
three ports find their PHYs at addresses 0 to 2 and link at 1 Gbit/s.
Without the patch, port 0 fails with -ENODEV after every boot.
There is no in-tree user yet, and mainline can't run this board's
switch yet: it sits on the MDIO bus of the SoC's GMAC, which mainline
does not support. The GL-SFT1200's device tree is under review on
linux-mips without the switch, which follows once the GMAC is.
---
Changes in v4:
- Cover letter: explain that describing the PHYs at the addresses the
bootloader leaves them at is not enough (Andrew, Daniel), drop the
unrelated reference to commit 82e2c7db0830 (Andrew), and correct the
tested kernel: v3 said v7.4-rc1, but the board runs OpenWrt's 6.18
with the drivers backported from mainline.
- Patch 2: say the same in the commit message.
- Patch 2: imply RESET_GPIO, which reset-gpios needs, and say so in the
help text. Without it the reset core skips the optional reset.
- Patch 2: say that the GSW150 timing is used for all the GSW1xx parts,
as no other is known.
- Patch 2 keeps the reset controller API, as Daniel asked for in v1,
rather than requesting the GPIO itself.
- Patch 2 still pulses the reset in probe, so a deferred probe repeats
it. This matches the realtek DSA drivers, and moving it into setup
would also mean redoing the SGMII and pin mux writes and the SMDIO
page cache that probe sets up.
- Patch 2 doesn't assert the reset on remove or after a failed probe:
the switch was left running there before, as in the realtek DSA
drivers. The reset-assert-us and reset-deassert-us properties are
for the MDIO core's own reset handling, which covers only PHYs, so
the timing stays in the driver.
- Patch 1 keeps the GSW1xx switches in lantiq,gswip.yaml. Splitting the
schema would be a change of its own.
- Rebase on net-next.
- Link to v3: https://patch.msgid.link/20261112-mxl-gsw1xx-reset-v3-0-863e82074893@telaak.dev
Changes in v3:
- Patch 1: say in the slew-rate descriptions that, without the
properties, a reset through reset-gpios leaves the power-on defaults.
Rob's Ack is kept: reset-gpios itself is unchanged.
- Patch 2: say the same in the commit message, and wrap a line over 80
columns.
- Cc Philipp Zabel for the reset controller API.
- Link to v2: https://patch.msgid.link/20261108-mxl-gsw1xx-reset-v2-0-46c1da093893@telaak.dev
Changes in v2:
- Use the reset controller API, so reset-gpios goes through reset-gpio,
instead of driving the GPIO from the driver (Daniel).
- Use the vendor driver's reset timing, 250 ms asserted and 1 s before
the first access. v1 gave 2 ms and 100 ms as the vendor's, which they
are not.
- Patch 1: add Rob's Ack.
- Link to v1: https://patch.msgid.link/20261104-mxl-gsw1xx-reset-v1-0-53839bf5c88e@telaak.dev
---
Joseph Telaak (2):
dt-bindings: net: dsa: lantiq,gswip: add reset-gpios
net: dsa: mxl-gsw1xx: reset the switch through reset-gpios
.../devicetree/bindings/net/dsa/lantiq,gswip.yaml | 12 ++++++++--
drivers/net/dsa/lantiq/Kconfig | 5 +++++
drivers/net/dsa/lantiq/mxl-gsw1xx.c | 26 ++++++++++++++++++++++
drivers/net/dsa/lantiq/mxl-gsw1xx.h | 6 +++++
4 files changed, 47 insertions(+), 2 deletions(-)
---
base-commit: 6964ff21c5d8b75649211a52dbfd92753e605649
change-id: 20261102-mxl-gsw1xx-reset-37ac836b31fe
Best regards,
--
Joseph Telaak <joseph@telaak.dev>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net-next v4 1/2] dt-bindings: net: dsa: lantiq,gswip: add reset-gpios
2026-11-15 22:33 [PATCH net-next v4 0/2] net: dsa: mxl-gsw1xx: reset the switch through reset-gpios Joseph Telaak via B4 Relay
@ 2026-11-15 22:33 ` Joseph Telaak via B4 Relay
2026-11-16 22:34 ` sashiko-bot
2026-11-15 22:33 ` [PATCH net-next v4 2/2] net: dsa: mxl-gsw1xx: reset the switch through reset-gpios Joseph Telaak via B4 Relay
1 sibling, 1 reply; 4+ messages in thread
From: Joseph Telaak via B4 Relay @ 2026-11-15 22:33 UTC (permalink / raw)
To: Hauke Mehrtens, Andrew Lunn, Vladimir Oltean, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: Daniel Golle, Philipp Zabel, netdev, devicetree, linux-kernel,
Joseph Telaak
From: Joseph Telaak <joseph@telaak.dev>
The standalone GSW1xx switches have a hardware reset input, and boards
wire it to a SoC GPIO. Allow describing it. The SoC-integrated GSWIP
variants have no such pin.
A reset through it returns the RGMII slew rates to their power-on
defaults, so say so where the slew-rate properties say that the
bootloader's configuration is otherwise preserved.
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Joseph Telaak <joseph@telaak.dev>
---
Documentation/devicetree/bindings/net/dsa/lantiq,gswip.yaml | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/dsa/lantiq,gswip.yaml b/Documentation/devicetree/bindings/net/dsa/lantiq,gswip.yaml
index 49af5573e4..89f78a1bc1 100644
--- a/Documentation/devicetree/bindings/net/dsa/lantiq,gswip.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/lantiq,gswip.yaml
@@ -40,6 +40,11 @@ properties:
- const: mdio
- const: mii
+ reset-gpios:
+ maxItems: 1
+ description:
+ GPIO connected to the hardware reset input of a standalone switch.
+
mdio:
$ref: /schemas/net/mdio.yaml#
unevaluatedProperties: false
@@ -120,7 +125,8 @@ patternProperties:
1: Slow
If not present, the configuration made by the switch bootloader is
- preserved.
+ preserved, or the power-on default after a reset through
+ reset-gpios.
maxlinear,slew-rate-txd:
$ref: /schemas/types.yaml#/definitions/uint32
enum: [0, 1]
@@ -131,7 +137,8 @@ patternProperties:
1: Slow
If not present, the configuration made by the switch bootloader is
- preserved.
+ preserved, or the power-on default after a reset through
+ reset-gpios.
maxlinear,rmii-refclk-out:
type: boolean
description:
@@ -173,6 +180,7 @@ allOf:
mdio:
required:
- compatible
+ reset-gpios: false
else:
properties:
reg:
--
Git-155)
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH net-next v4 2/2] net: dsa: mxl-gsw1xx: reset the switch through reset-gpios
2026-11-15 22:33 [PATCH net-next v4 0/2] net: dsa: mxl-gsw1xx: reset the switch through reset-gpios Joseph Telaak via B4 Relay
2026-11-15 22:33 ` [PATCH net-next v4 1/2] dt-bindings: net: dsa: lantiq,gswip: add reset-gpios Joseph Telaak via B4 Relay
@ 2026-11-15 22:33 ` Joseph Telaak via B4 Relay
1 sibling, 0 replies; 4+ messages in thread
From: Joseph Telaak via B4 Relay @ 2026-11-15 22:33 UTC (permalink / raw)
To: Hauke Mehrtens, Andrew Lunn, Vladimir Oltean, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: Daniel Golle, Philipp Zabel, netdev, devicetree, linux-kernel,
Joseph Telaak
From: Joseph Telaak <joseph@telaak.dev>
The switch keeps the configuration the bootloader left in it, and the
driver never resets it. The MDIO core asserts and releases reset-gpios
only for PHY devices, so a reset line described on the switch node has
no effect either.
On the GL.iNet GL-SFT1200, nothing answers at internal MDIO address 0
after the bootloader, and the PHY that answers at each port's address
belongs to the neighboring port, so port 0 fails with "failed to
connect to PHY: -ENODEV". Describing the PHYs at the addresses they
answer at is not enough: with them at 1 to 3 and no reset, neither LAN
port passes traffic. After a hardware reset every PHY is back at its
port's address and all ports work. GL.iNet's own firmware resets the
switch from Linux too.
Get the reset through the reset controller API and pulse it before the
first register access. The reset core hands a reset-gpios property to
the reset-gpio driver, so a board that wires the reset this way needs
CONFIG_RESET_GPIO; without it the reset is skipped. Imply it, so it is
enabled by default, and say so in the help text. The timing follows the
vendor's driver for the GSW150: asserted for 250 ms, then 1 s before the
switch is accessed. No timing is known for the other GSW1xx parts, so
they get the same.
The reset also returns the RGMII slew rates to their power-on defaults,
so a board that uses reset-gpios sets the ones it needs in its device
tree.
Signed-off-by: Joseph Telaak <joseph@telaak.dev>
---
drivers/net/dsa/lantiq/Kconfig | 5 +++++
drivers/net/dsa/lantiq/mxl-gsw1xx.c | 26 ++++++++++++++++++++++++++
drivers/net/dsa/lantiq/mxl-gsw1xx.h | 6 ++++++
3 files changed, 37 insertions(+)
diff --git a/drivers/net/dsa/lantiq/Kconfig b/drivers/net/dsa/lantiq/Kconfig
index 98efeef266..c0f2e36bf6 100644
--- a/drivers/net/dsa/lantiq/Kconfig
+++ b/drivers/net/dsa/lantiq/Kconfig
@@ -16,6 +16,7 @@ config NET_DSA_MXL_GSW1XX
select NET_DSA_TAG_MXL_GSW1XX
select NET_DSA_LANTIQ_COMMON
select PHY_COMMON_PROPS
+ imply RESET_GPIO
help
This enables support for the Intel/MaxLinear GSW1xx family of 1GE
switches.
@@ -25,3 +26,7 @@ config NET_DSA_MXL_GSW1XX
GSW141 6 port, 4 PHYs, RGMII & SGMII
GSW145 6 port, 4 PHYs, RGMII & SGMII/2500Base-X, industrial temperature
GSW150 7 port, 5 PHYs, 1x GMII/RGMII, 1x RGMII
+
+ A switch whose hardware reset is described with reset-gpios is
+ only reset when RESET_GPIO is enabled as well, which this option
+ does by default.
diff --git a/drivers/net/dsa/lantiq/mxl-gsw1xx.c b/drivers/net/dsa/lantiq/mxl-gsw1xx.c
index 0c7ea242a6..33b73b2ed5 100644
--- a/drivers/net/dsa/lantiq/mxl-gsw1xx.c
+++ b/drivers/net/dsa/lantiq/mxl-gsw1xx.c
@@ -18,6 +18,7 @@
#include <linux/phy/phy-common-props.h>
#include <linux/property.h>
#include <linux/regmap.h>
+#include <linux/reset.h>
#include <linux/workqueue.h>
#include <net/dsa.h>
@@ -719,6 +720,7 @@ static int gsw1xx_serdes_pcs_init(struct gsw1xx_priv *priv)
static int gsw1xx_probe(struct mdio_device *mdiodev)
{
struct device *dev = &mdiodev->dev;
+ struct reset_control *reset;
struct gsw1xx_priv *priv;
u32 version, val;
u8 shellver;
@@ -737,6 +739,30 @@ static int gsw1xx_probe(struct mdio_device *mdiodev)
if (!priv->gswip.hw_info)
return -EINVAL;
+ /* The MDIO core handles reset-gpios only for PHYs. Reset the switch
+ * here, so it does not run with whatever the bootloader configured.
+ */
+ reset = devm_reset_control_get_optional_exclusive(dev, NULL);
+ if (IS_ERR(reset))
+ return dev_err_probe(dev, PTR_ERR(reset),
+ "failed to get reset control\n");
+
+ if (reset) {
+ ret = reset_control_assert(reset);
+ if (ret)
+ return dev_err_probe(dev, ret,
+ "failed to assert reset\n");
+
+ fsleep(GSW1XX_RESET_ASSERT_US);
+
+ ret = reset_control_deassert(reset);
+ if (ret)
+ return dev_err_probe(dev, ret,
+ "failed to deassert reset\n");
+
+ fsleep(GSW1XX_RESET_DEASSERT_US);
+ }
+
priv->gswip.gswip = gsw1xx_regmap_init(priv, "switch",
GSW1XX_SWITCH_BASE, 0xfff);
if (IS_ERR(priv->gswip.gswip))
diff --git a/drivers/net/dsa/lantiq/mxl-gsw1xx.h b/drivers/net/dsa/lantiq/mxl-gsw1xx.h
index 81bc00eabb..7d91a7b7e2 100644
--- a/drivers/net/dsa/lantiq/mxl-gsw1xx.h
+++ b/drivers/net/dsa/lantiq/mxl-gsw1xx.h
@@ -19,6 +19,12 @@
#define GSW1XX_SYS_CLK_FREQ 340000000
+/* Hardware reset timing of the vendor's driver for the GSW150, which is the
+ * only one known and is used for all the GSW1xx parts
+ */
+#define GSW1XX_RESET_ASSERT_US 250000
+#define GSW1XX_RESET_DEASSERT_US 1000000
+
/* SMDIO switch register base address */
#define GSW1XX_SMDIO_BADR 0x1f
#define GSW1XX_SMDIO_BADR_UNKNOWN -1
--
Git-155)
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next v4 1/2] dt-bindings: net: dsa: lantiq,gswip: add reset-gpios
2026-11-15 22:33 ` [PATCH net-next v4 1/2] dt-bindings: net: dsa: lantiq,gswip: add reset-gpios Joseph Telaak via B4 Relay
@ 2026-11-16 22:34 ` sashiko-bot
0 siblings, 0 replies; 4+ messages in thread
From: sashiko-bot @ 2026-11-16 22:34 UTC (permalink / raw)
To: Joseph Telaak; +Cc: devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] dt-bindings: net: dsa: lantiq,gswip: split GSW1xx into separate
schema
--
commit 01a5dca493e3ff68856f4f4d443a02d28d47883f
Author: Joseph Telaak <joseph@telaak.dev>
dt-bindings: net: dsa: lantiq,gswip: add reset-gpios
This commit adds the reset-gpios property for standalone GSW1xx switches and
notes its effect on the default RGMII slew-rate configuration.
> diff --git a/Documentation/devicetree/bindings/net/dsa/lantiq,gswip.yaml b/Documentation/devicetree/bindings/net/dsa/lantiq,gswip.yaml
> index 49af5573e452d..89f78a1bc113d 100644
> --- a/Documentation/devicetree/bindings/net/dsa/lantiq,gswip.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/lantiq,gswip.yaml
> @@ -40,6 +40,11 @@ properties:
> - const: mdio
> - const: mii
>
> + reset-gpios:
> + maxItems: 1
> + description:
> + GPIO connected to the hardware reset input of a standalone switch.
> +
> mdio:
> $ref: /schemas/net/mdio.yaml#
> unevaluatedProperties: false
[ ... ]
> @@ -173,6 +180,7 @@ allOf:
> mdio:
> required:
> - compatible
> + reset-gpios: false
> else:
> properties:
> reg:
[Severity: Low]
This isn't a bug, but would it make sense to split the standalone MDIO-based
GSW1xx switches into a separate binding schema instead of adding more
per-compatible conditionals here?
The SoC-integrated MMIO GSWIP variants and the standalone MDIO GSW1xx switches
sit on different buses and already require overriding or disallowing nearly
every top-level property outside compatible and ports (reg, reg-names, mdio,
gphy-fw, and now reset-gpios) in the allOf if-then-else block, alongside the
MaxLinear-specific port properties.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261115-mxl-gsw1xx-reset-v4-0-4ecd18c922e2@telaak.dev?part=1
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-11-16 22:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-15 22:33 [PATCH net-next v4 0/2] net: dsa: mxl-gsw1xx: reset the switch through reset-gpios Joseph Telaak via B4 Relay
2026-11-15 22:33 ` [PATCH net-next v4 1/2] dt-bindings: net: dsa: lantiq,gswip: add reset-gpios Joseph Telaak via B4 Relay
2026-11-16 22:34 ` sashiko-bot
2026-11-15 22:33 ` [PATCH net-next v4 2/2] net: dsa: mxl-gsw1xx: reset the switch through reset-gpios Joseph Telaak via B4 Relay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox