Re: [RFC net-next v2] net:dsa:yt922x: Add support for Motorcomm YT922x

From: Andrew Lunn

Date: Fri Aug 28 2026 - 09:20:27 EST


> > > +static int yt922x_port_sds_init(struct yt921x_priv *priv, int port,
> > > + phy_interface_t interface)
> > > +{
> > > + int addr;
> > > + u16 data;
> > > + int res;
> > > +
> > > + addr = yt922x_sds_phyaddr_get(port,
> > > + YT922X_PHY_REG_TYPE_SDS_COMMON_EXT,
> > > + YT922X_PHY_REG_SPACE_SGMII);
> > > + if (addr < 0)
> > > + return -EINVAL;
> > > + /* write protect */
> > > + res = yt921x_intif_ext_write(priv, addr, 0x4be, 0xd);
> > > + if (res)
> > > + return res;
> > > + /* CDR */
> > > + if (interface == PHY_INTERFACE_MODE_100BASEX) {
> > > + res = yt921x_intif_ext_write(priv, addr, 0x406, 0x0);
> > > + if (res)
> > > + return res;
> > > + res = yt921x_intif_ext_write(priv, addr, 0x416, 0x3458);
> > > + if (res)
> > > + return res;
> > > + } else {
> > > + res = yt921x_intif_ext_write(priv, addr, 0x406, 0x800);
> > > + if (res)
> > > + return res;
> > > + res = yt921x_intif_ext_write(priv, addr, 0x416, 0x4558);
> > > + if (res)
> > > + return res;
> > > + }
> > > + /* PLL */
> > > + if (interface == PHY_INTERFACE_MODE_USXGMII) {
> > > + res = yt921x_intif_ext_write(priv, addr, 0x43a, 0x1006);
> > > + if (res)
> > > + return res;
> > > + res = yt921x_intif_ext_write(priv, addr, 0x43f, 0x3029);
> > > + if (res)
> > What is this function doing?
> Ans: Complete some init configuration according to serdes interface mode.

Sorry, missed this email until today.

Which SERDES? The switches SERDES, or the PHY SERDES.

We normally refer to the switch SERDES as a PCS, and have a PCS driver
for it. Sometimes you also need a generic PHY. Please look around at
other devices and understand the architecture.

The PHYs SERDES interface is configured by the PHY driver. The MAC
driver should never touch PHY registers. Same as the PHY driver should
never touch MAC registers.

Andrew