Re: [PATCH net-next v4 2/2] net: dsa: mxl-gsw1xx: reset the switch through reset-gpios
From: Daniel Golle
Date: Wed Nov 18 2026 - 08:07:51 EST
On Sun, Nov 15, 2026 at 05:33:46PM -0500, Joseph Telaak via B4 Relay wrote:
> From: Joseph Telaak <joseph@xxxxxxxxxx>
>
> 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@xxxxxxxxxx>
Reviewed-by: Daniel Golle <daniel@xxxxxxxxxxxxxx>