Re: [PATCH net-next V2 4/5] net: lan743x: Implement phylink pcs

From: Raju Lakkaraju
Date: Thu Sep 12 2024 - 02:58:30 EST


Hi Andrew,

The 09/11/2024 19:26, Andrew Lunn wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> > +static int pci11x1x_pcs_read(struct mii_bus *bus, int addr, int devnum,
> > + int regnum)
> > +{
> > + struct lan743x_adapter *adapter = bus->priv;
> > +
> > + if (addr)
> > + return -EOPNOTSUPP;
> > +
> > + return lan743x_sgmii_read(adapter, devnum, regnum);
> > +}
>
> > static int lan743x_mdiobus_init(struct lan743x_adapter *adapter)
> > {
> > + struct dw_xpcs *xpcs;
> > u32 sgmii_ctl;
> > int ret;
> >
> > @@ -3783,8 +3823,17 @@ static int lan743x_mdiobus_init(struct lan743x_adapter *adapter)
> > "SGMII operation\n");
> > adapter->mdiobus->read = lan743x_mdiobus_read_c22;
> > adapter->mdiobus->write = lan743x_mdiobus_write_c22;
> > - adapter->mdiobus->read_c45 = lan743x_mdiobus_read_c45;
> > - adapter->mdiobus->write_c45 = lan743x_mdiobus_write_c45;
> > + if (adapter->is_sfp_support_en) {
> > + adapter->mdiobus->read_c45 =
> > + pci11x1x_pcs_read;
> > + adapter->mdiobus->write_c45 =
> > + pci11x1x_pcs_write;
>
> As you can see, the naming convention is to put the bus transaction
> type on the end. So please name these pci11x1x_pcs_read_c45...

Accpeted. I will fix

>
> Also, am i reading this correct. C22 transfers will go out a
> completely different bus to C45 transfers when there is an SFP?

No. You are correct.
This LAN743x driver support following chips
1. LAN7430 - C22 only with GMII/RGMII I/F
2. LAN7431 - C22 only with MII I/F
3. PCI11010/PCI11414 - C45 with RGMII or SGMII/1000Base-X/2500Base-X
If SFP enable, then XPCS's C45 PCS access
If SGMII only enable, then SGMII (PCS) C45 access

>
> If there are two physical MDIO busses, please instantiate two Linux
> MDIO busses.
>

XPCS driver is doing.
Am i miss anything there?

> Andrew
>
> ---
> pw-bot: cr

--
Thanks,
Raju