Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: mscc: Enable all ports in QSGMII

When Ocelot phy-mode is QSGMII, all 4 ports involved in
QSGMII shall be kept out of reset and
Tx lanes shall be enabled to pass the data.

Fixes: a556c76adc05 ("net: mscc: Add initial Ocelot switch support")
Signed-off-by: Kavya Sree Kotagiri <kavyasree.kotagiri@microchip.com>
Signed-off-by: Steen Hegelund <Steen.Hegelund@microchip.com>
Co-developed-by: Steen Hegelund <Steen.Hegelund@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Kavya Sree Kotagiri and committed by
David S. Miller
084e5bb1 46b1c18f

+11 -3
+11 -3
drivers/net/ethernet/mscc/ocelot_board.c
··· 267 267 struct phy *serdes; 268 268 void __iomem *regs; 269 269 char res_name[8]; 270 + int phy_mode; 270 271 u32 port; 271 272 272 273 if (of_property_read_u32(portnp, "reg", &port)) ··· 293 292 if (err) 294 293 return err; 295 294 296 - err = of_get_phy_mode(portnp); 297 - if (err < 0) 295 + phy_mode = of_get_phy_mode(portnp); 296 + if (phy_mode < 0) 298 297 ocelot->ports[port]->phy_mode = PHY_INTERFACE_MODE_NA; 299 298 else 300 - ocelot->ports[port]->phy_mode = err; 299 + ocelot->ports[port]->phy_mode = phy_mode; 301 300 302 301 switch (ocelot->ports[port]->phy_mode) { 303 302 case PHY_INTERFACE_MODE_NA: ··· 305 304 case PHY_INTERFACE_MODE_SGMII: 306 305 break; 307 306 case PHY_INTERFACE_MODE_QSGMII: 307 + /* Ensure clock signals and speed is set on all 308 + * QSGMII links 309 + */ 310 + ocelot_port_writel(ocelot->ports[port], 311 + DEV_CLOCK_CFG_LINK_SPEED 312 + (OCELOT_SPEED_1000), 313 + DEV_CLOCK_CFG); 308 314 break; 309 315 default: 310 316 dev_err(ocelot->dev,