RE: [PATCH net-next v2] net: dsa: microchip: Add SGMII port support to KSZ9477 switch
From: Tristram.Ha
Date: Fri Jan 17 2025 - 19:59:46 EST
> > The KSZ9477 SGMII module does use DesignWare IP, but its implementation
> > is probably too old as some registers do not match.
>
> Is there a revision value somewhere in the registers? Maybe the lower
> nibble of ID registers 2 and 3?
>
I am not aware of getting the version of the DesignWare IP to
differentiate different implementations. I will find out from hardware
designers.
> > When using XPCS
> > driver link detection works but the SGMII port does not pass traffic for
> > some SFPs. It is probably doable to update the XPCS driver to work in
> > KSZ9477, but there is no way to submit that patch as that may affect
> > other hardware implementation.
>
> We have PHY drivers which change their behaviour based on the
> revision. So it is possible. And XPCS is used quite a bit, so i don't
> think it will be an issue finding somebody to do some regression
> testing.
>
> Using a PCS driver is the correct way to go here. So either you need
> to copy/paste/edit the XPCS driver to create a version specific for
> you hardware, or you need to extend the XPCS driver so it supports
> your hardware.
Some of the register definitions are not present in the XPCS driver so I
need to add them.
Some register bits programmed by the XPCS driver do not have effect.
Actually KSZ9477 has a bug in SGMII implementation and needs a software
workaround. I am not sure if the generic XCPS driver can cover that.