2020-12-09 11:20:25

by Wong, Vee Khee

[permalink] [raw]
Subject: [PATCH net-next 1/1] net: stmmac: allow stmmac to probe for C45 PHY devices

Assign stmmac's mdio_bus probe capabilities to MDIOBUS_C22_C45.
This extends the probing of C45 PHY devices on the MDIO bus.

Signed-off-by: Wong Vee Khee <[email protected]>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
index b2a707e2ef43..9f96bb7d27db 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
@@ -364,6 +364,7 @@ int stmmac_mdio_register(struct net_device *ndev)
memcpy(new_bus->irq, mdio_bus_data->irqs, sizeof(new_bus->irq));

new_bus->name = "stmmac";
+ new_bus->probe_capabilities = MDIOBUS_C22_C45;

if (priv->plat->has_xgmac) {
new_bus->read = &stmmac_xgmac2_mdio_read;
--
2.17.0


2020-12-09 16:14:59

by Andrew Lunn

[permalink] [raw]
Subject: Re: [PATCH net-next 1/1] net: stmmac: allow stmmac to probe for C45 PHY devices

On Wed, Dec 09, 2020 at 07:19:33PM +0800, Wong Vee Khee wrote:
> Assign stmmac's mdio_bus probe capabilities to MDIOBUS_C22_C45.
> This extends the probing of C45 PHY devices on the MDIO bus.
>
> Signed-off-by: Wong Vee Khee <[email protected]>
> ---
> drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
> index b2a707e2ef43..9f96bb7d27db 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
> @@ -364,6 +364,7 @@ int stmmac_mdio_register(struct net_device *ndev)
> memcpy(new_bus->irq, mdio_bus_data->irqs, sizeof(new_bus->irq));
>
> new_bus->name = "stmmac";
> + new_bus->probe_capabilities = MDIOBUS_C22_C45;

It looks like this needs to be conditional on the version. xgmax2
supports C45. And gmac4. But other versions don't.

Andrew

2020-12-09 22:41:37

by Wong, Vee Khee

[permalink] [raw]
Subject: RE: [PATCH net-next 1/1] net: stmmac: allow stmmac to probe for C45 PHY devices



> -----Original Message-----
> From: Andrew Lunn <[email protected]>
> Sent: Thursday, December 10, 2020 12:09 AM
> To: Wong, Vee Khee <[email protected]>
> Cc: Giuseppe Cavallaro <[email protected]>; Alexandre Torgue
> <[email protected]>; Jose Abreu <[email protected]>; David
> S . Miller <[email protected]>; Jakub Kicinski <[email protected]>;
> Maxime Coquelin <[email protected]>; Voon, Weifeng
> <[email protected]>; [email protected]; linux-
> [email protected]; Ong, Boon Leong <[email protected]>;
> [email protected]; linux-arm-
> [email protected]
> Subject: Re: [PATCH net-next 1/1] net: stmmac: allow stmmac to probe for
> C45 PHY devices
>
> On Wed, Dec 09, 2020 at 07:19:33PM +0800, Wong Vee Khee wrote:
> > Assign stmmac's mdio_bus probe capabilities to MDIOBUS_C22_C45.
> > This extends the probing of C45 PHY devices on the MDIO bus.
> >
> > Signed-off-by: Wong Vee Khee <[email protected]>
> > ---
> > drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
> b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
> > index b2a707e2ef43..9f96bb7d27db 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
> > @@ -364,6 +364,7 @@ int stmmac_mdio_register(struct net_device *ndev)
> > memcpy(new_bus->irq, mdio_bus_data->irqs,
> sizeof(new_bus->irq));
> >
> > new_bus->name = "stmmac";
> > + new_bus->probe_capabilities = MDIOBUS_C22_C45;
>
> It looks like this needs to be conditional on the version. xgmax2
> supports C45. And gmac4. But other versions don't.
>
> Andrew

I will send a v2 with conditional checking for gmac4.
I do not have a xgmac2 hardware setup to test this.