[PATCH v2] net: mtk_sgmii: implement mtk_pcs_ops

Bjørn Mork bjorn at mork.no
Mon Jan 16 10:30:27 PST 2023


"Russell King (Oracle)" <linux at armlinux.org.uk> 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 at OpenWrt:/# mdio mdio-bus 6:30 raw 8
0x34da
root at OpenWrt:/# mdio mdio-bus 6:30 raw 9
0x000e
root at OpenWrt:/# mdio mdio-bus 6:30 raw 8 0x36da
root at OpenWrt:/# mdio mdio-bus 6:30 raw 8
0x34da
root at OpenWrt:/# mdio mdio-bus 6:30 raw 9
0x000e


Bjørn



More information about the linux-arm-kernel mailing list