]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: lan966x: Fix port configuration when using SGMII interface
authorHoratiu Vultur <horatiu.vultur@microchip.com>
Wed, 24 Jan 2024 10:17:58 +0000 (11:17 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 27 Jan 2024 10:02:01 +0000 (10:02 +0000)
In case the interface between the MAC and the PHY is SGMII, then the bit
GIGA_MODE on the MAC side needs to be set regardless of the speed at
which it is running.

Fixes: d28d6d2e37d1 ("net: lan966x: add port module support")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/microchip/lan966x/lan966x_port.c

index 92108d354051c31c44c64b207fb11411d0b4295b..2e83bbb9477e0693f236e83be30277d3e92df235 100644 (file)
@@ -168,9 +168,10 @@ static void lan966x_port_link_up(struct lan966x_port *port)
        lan966x_taprio_speed_set(port, config->speed);
 
        /* Also the GIGA_MODE_ENA(1) needs to be set regardless of the
-        * port speed for QSGMII ports.
+        * port speed for QSGMII or SGMII ports.
         */
-       if (phy_interface_num_ports(config->portmode) == 4)
+       if (phy_interface_num_ports(config->portmode) == 4 ||
+           config->portmode == PHY_INTERFACE_MODE_SGMII)
                mode = DEV_MAC_MODE_CFG_GIGA_MODE_ENA_SET(1);
 
        lan_wr(config->duplex | mode,