Re: [PATCH v2] net: mtk_sgmii: implement mtk_pcs_ops

From: Bjørn Mork
Date: Mon Jan 16 2023 - 13:39:47 EST


"Russell King (Oracle)" <linux@xxxxxxxxxxxxxxx> writes:

> That all looks fine. However, I'm running out of ideas.

Thanks a lot for the effort in any case. It's comforting that even the
top experts can't figure out this one :-)


> What we seem to have is:
>
> PHY:
> VSPEC1_SGMII_CTRL = 0x34da
> VSPEC1_SGMII_STAT = 0x000e
>
> The PHY is programmed to exchange SGMII with the host PCS, and it
> says that it hasn't completed that exchange (bit 5 of STAT).
>
> The Mediatek PCS says:
> BMCR = 0x1140 AN enabled
> BMSR = 0x0008 AN capable
> ADVERTISE = 0x0001 SGMII response (bit 14 is clear, hardware is
> supposed to manage that bit)
> LPA = 0x0000 SGMII received control word (nothing)
> SGMII_MODE = 0x011b SGMII mode, duplex AN, 1000M, Full duplex,
> Remote fault disable
>
> which all looks like it should work - but it isn't.
>
> One last thing I can think of trying at the moment would be writing
> the VSPEC1_SGMII_CTRL with 0x36da, setting bit 9 which allegedly
> restarts the SGMII exchange. There's some comments in the PHY driver
> that this may be needed - maybe it's necessary once the MAC's PCS
> has been switched to SGMII mode.


Tried that now. Didn't change anything. And still no packets.

root@OpenWrt:/# mdio mdio-bus 6:30 raw 8
0x34da
root@OpenWrt:/# mdio mdio-bus 6:30 raw 9
0x000e
root@OpenWrt:/# mdio mdio-bus 6:30 raw 8 0x36da
root@OpenWrt:/# mdio mdio-bus 6:30 raw 8
0x34da
root@OpenWrt:/# mdio mdio-bus 6:30 raw 9
0x000e


Bjørn