Thread View: linux.kernel.netdev
2 messages
2 total messages
Started by Nicolai Buchwitz
Sun, 15 Nov 2026 18:59
Re: [PATCH net-next 3/3] net: mdio: mdio-bcm-unimac: Add Clause 45 support
Author: Nicolai Buchwitz
Date: Sun, 15 Nov 2026 18:59
Date: Sun, 15 Nov 2026 18:59
58 lines
10780 bytes
10780 bytes
Hi Florian On 13.11.2026 22:15, Florian Fainelli wrote: > Add Clause 45 read/write support to the UniMAC MDIO bus controller > driver > by implementing the read_c45/write_c45 bus callbacks. Each access > performs > the two-step C45 sequence (ADDR cycle followed by a READ/WRITE cycle) > under > the bus lock and switches MDIO_CFG between C22 and C45 mode as needed; > MDIO_CFG is only written when the mode actually changes. > > Also skip the BMSR workaround read in unimac_mdio_reset() for children > compatible with "ethernet-phy-ieee802.3-c45", since such PHYs are not > expected to respond to C22 accesses. > > Note that providing read_c45/write_c45 also makes the MDIO core scan > for > C45 PHYs at registration time, on addresses that are not masked and do > not > already have a C22 device. > > Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com> > Co-developed-by: Carlos Soto <carlos.soto@broadcom.com> > Signed-off-by: Carlos Soto <carlos.soto@broadcom.com> > Co-developed-by: Justin Chen <justin.chen@broadcom.com> > Signed-off-by: Justin Chen <justin.chen@broadcom.com> > --- > drivers/net/mdio/mdio-bcm-unimac.c | 105 +++++++++++++++++++++++++++-- > 1 file changed, 98 insertions(+), 7 deletions(-) > > diff --git a/drivers/net/mdio/mdio-bcm-unimac.c > b/drivers/net/mdio/mdio-bcm-unimac.c > [...] > @@ -301,6 +390,8 @@ static int unimac_mdio_probe(struct platform_device > *pdev) > bus->parent = &pdev->dev; > bus->read = unimac_mdio_read; > bus->write = unimac_mdio_write; > + bus->read_c45 = unimac_mdio_read_c45; > + bus->write_c45 = unimac_mdio_write_c45; AFAIU this breaks GENET without DT (e.g. Pi 4 with ACPI). Arguably an edge case, but last time I tried it worked at least. With your changes all addresses get a C45 scan there for which the empty ones return -EIO. get_phy_c45_ids() passes that up instead of mapping it to -ENODEV like the C22 path. A cheap fix would be to do the same mapping in get_phy_c45_ids() as we have for C22. Thanks, Nicolai
Re: [PATCH net-next 3/3] net: mdio: mdio-bcm-unimac: Add Clause 45 support
Author: Nicolai Buchwitz
Date: Tue, 17 Nov 2026 09:32
Date: Tue, 17 Nov 2026 09:32
35 lines
9988 bytes
9988 bytes
Hi Florian On 16.11.2026 19:54, Florian Fainelli wrote: > [...] >>> @@ -301,6 +390,8 @@ static int unimac_mdio_probe(struct >>> platform_device *pdev) >>> bus->parent = &pdev->dev; >>> bus->read = unimac_mdio_read; >>> bus->write = unimac_mdio_write; >>> + bus->read_c45 = unimac_mdio_read_c45; >>> + bus->write_c45 = unimac_mdio_write_c45; >> >> AFAIU this breaks GENET without DT (e.g. Pi 4 with ACPI). Arguably an >> edge case, >> but last time I tried it worked at least. With your changes all >> addresses get >> a C45 scan there for which the empty ones return -EIO. >> get_phy_c45_ids() passes >> that up instead of mapping it to -ENODEV like the C22 path. >> >> A cheap fix would be to do the same mapping in get_phy_c45_ids() as we >> have for C22. > > OK, are we the only platform where that is happening? Alignment would > make sense, and I don't assume we will be breaking someone's use case > AFAICT. The only other I could find ois orion_mdio_xsmi_read_c45 (marvell/mvmdio.c) Regards Nicolai
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads