[PATCH net-next v2 0/2] Add support for PIC64-HPSC/HX MDIO controller

Charles Perry posted 2 patches 1 week, 5 days ago
.../net/microchip,pic64hpsc-mdio.yaml         |  68 +++++++
drivers/net/mdio/Kconfig                      |   7 +
drivers/net/mdio/Makefile                     |   1 +
drivers/net/mdio/mdio-pic64hpsc.c             | 192 ++++++++++++++++++
4 files changed, 268 insertions(+)
create mode 100644 Documentation/devicetree/bindings/net/microchip,pic64hpsc-mdio.yaml
create mode 100644 drivers/net/mdio/mdio-pic64hpsc.c
[PATCH net-next v2 0/2] Add support for PIC64-HPSC/HX MDIO controller
Posted by Charles Perry 1 week, 5 days ago
Hello,

This series adds a driver for the two MDIO controllers of PIC64-HPSC/HX.
The hardware supports C22 and C45 but only C22 is implemented for now.

This MDIO hardware is based on a Microsemi design supported in Linux by
mdio-mscc-miim.c. However, The register interface is completely different
with pic64hpsc, hence the need for a separate driver.

The documentation recommends an input clock of 156.25MHz and a prescaler of
39, which yields an MDIO clock of 1.95MHz.

This was tested on Microchip HB1301 evalkit which has a VSC8574 and a
VSC8541 with clock frequencies of 0.6, 1.95 and 2.5 MHz.

Thanks,
Charles

Changes in v2:
- 1/2: Make "clocks" and "interrupts" required (Andrew)
- 1/2: Add a default value to "clock-frequency" (Andrew)
- 2/2: Remove #define for unused registers (Maxime)
- 2/2: Add "c22" to clause 22 read/write ops (Maxime)
- 2/2: Remove the call to platform_set_drvdata() (Andrew)
- 2/2: Make the clock mandatory (Andrew)
- 2/2: Use 2.5MHz if no clock-frequency was specified (Andrew)
- 2/2: Change the error message for bad clock-frequency (Andrew)
- 2/2: Fix a use without initialization on bus_freq (Andrew)

Charles Perry (2):
  dt-bindings: net: document Microchip PIC64-HPSC/HX MDIO controller
  net: mdio: add a driver for PIC64-HPSC/HX MDIO controller

 .../net/microchip,pic64hpsc-mdio.yaml         |  68 +++++++
 drivers/net/mdio/Kconfig                      |   7 +
 drivers/net/mdio/Makefile                     |   1 +
 drivers/net/mdio/mdio-pic64hpsc.c             | 192 ++++++++++++++++++
 4 files changed, 268 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/microchip,pic64hpsc-mdio.yaml
 create mode 100644 drivers/net/mdio/mdio-pic64hpsc.c

-- 
2.47.3
Re: [PATCH net-next v2 0/2] Add support for PIC64-HPSC/HX MDIO controller
Posted by Jakub Kicinski 1 week, 2 days ago
On Mon, 23 Mar 2026 15:02:52 -0700 Charles Perry wrote:
>  .../net/microchip,pic64hpsc-mdio.yaml         |  68 +++++++
>  drivers/net/mdio/Kconfig                      |   7 +
>  drivers/net/mdio/Makefile                     |   1 +
>  drivers/net/mdio/mdio-pic64hpsc.c             | 192 ++++++++++++++++++

Speaking under correction from PHY maintainers but I think we need 
a MAINTAINERS entry that will cover Microchip MDIO, or at least the
files you're adding. Important read:
https://docs.kernel.org/next/maintainer/feature-and-driver-maintainers.html
-- 
pw-bot: cr
Re: [PATCH net-next v2 0/2] Add support for PIC64-HPSC/HX MDIO controller
Posted by Charles Perry 1 week, 2 days ago
On Thu, Mar 26, 2026 at 08:33:09PM -0700, Jakub Kicinski wrote:
> On Mon, 23 Mar 2026 15:02:52 -0700 Charles Perry wrote:
> >  .../net/microchip,pic64hpsc-mdio.yaml         |  68 +++++++
> >  drivers/net/mdio/Kconfig                      |   7 +
> >  drivers/net/mdio/Makefile                     |   1 +
> >  drivers/net/mdio/mdio-pic64hpsc.c             | 192 ++++++++++++++++++
> 
> Speaking under correction from PHY maintainers but I think we need 
> a MAINTAINERS entry that will cover Microchip MDIO, or at least the
> files you're adding. Important read:
> https://docs.kernel.org/next/maintainer/feature-and-driver-maintainers.html

Sure, I think this should go under "RISC-V MICROCHIP SUPPORT" or maybe a
new "MICROCHIP PIC64-HPSC/HX DRIVER" entry if the former was meant only for
Polarfire SoC.

I'll add something in v3.

Thanks,
Charles

> -- 
> pw-bot: cr
Re: [PATCH net-next v2 0/2] Add support for PIC64-HPSC/HX MDIO controller
Posted by Jakub Kicinski 1 week, 1 day ago
On Fri, 27 Mar 2026 05:34:32 -0700 Charles Perry wrote:
> On Thu, Mar 26, 2026 at 08:33:09PM -0700, Jakub Kicinski wrote:
> > On Mon, 23 Mar 2026 15:02:52 -0700 Charles Perry wrote:  
> > >  .../net/microchip,pic64hpsc-mdio.yaml         |  68 +++++++
> > >  drivers/net/mdio/Kconfig                      |   7 +
> > >  drivers/net/mdio/Makefile                     |   1 +
> > >  drivers/net/mdio/mdio-pic64hpsc.c             | 192 ++++++++++++++++++  
> > 
> > Speaking under correction from PHY maintainers but I think we need 
> > a MAINTAINERS entry that will cover Microchip MDIO, or at least the
> > files you're adding. Important read:
> > https://docs.kernel.org/next/maintainer/feature-and-driver-maintainers.html  
> 
> Sure, I think this should go under "RISC-V MICROCHIP SUPPORT" or maybe a
> new "MICROCHIP PIC64-HPSC/HX DRIVER" entry if the former was meant only for
> Polarfire SoC.
> 
> I'll add something in v3.

Thanks! FWIW I'd prefer the latter - smaller entries make the
responsibility clear. Under a big arch entry the maintainers are
usually seeing too many random patches to act. You can add
_both_ dedicated a entry and add the files to RISC-V MICROCHIP,
if you prefer, too.
Re: [PATCH net-next v2 0/2] Add support for PIC64-HPSC/HX MDIO controller
Posted by Charles Perry 5 days, 23 hours ago
On Fri, Mar 27, 2026 at 04:51:58PM -0700, Jakub Kicinski wrote:
> On Fri, 27 Mar 2026 05:34:32 -0700 Charles Perry wrote:
> > On Thu, Mar 26, 2026 at 08:33:09PM -0700, Jakub Kicinski wrote:
> > > On Mon, 23 Mar 2026 15:02:52 -0700 Charles Perry wrote:  
> > > >  .../net/microchip,pic64hpsc-mdio.yaml         |  68 +++++++
> > > >  drivers/net/mdio/Kconfig                      |   7 +
> > > >  drivers/net/mdio/Makefile                     |   1 +
> > > >  drivers/net/mdio/mdio-pic64hpsc.c             | 192 ++++++++++++++++++  
> > > 
> > > Speaking under correction from PHY maintainers but I think we need 
> > > a MAINTAINERS entry that will cover Microchip MDIO, or at least the
> > > files you're adding. Important read:
> > > https://docs.kernel.org/next/maintainer/feature-and-driver-maintainers.html  
> > 
> > Sure, I think this should go under "RISC-V MICROCHIP SUPPORT" or maybe a
> > new "MICROCHIP PIC64-HPSC/HX DRIVER" entry if the former was meant only for
> > Polarfire SoC.
> > 
> > I'll add something in v3.
> 
> Thanks! FWIW I'd prefer the latter - smaller entries make the
> responsibility clear. Under a big arch entry the maintainers are
> usually seeing too many random patches to act. You can add
> _both_ dedicated a entry and add the files to RISC-V MICROCHIP,
> if you prefer, too.

Ok, thank you for the suggestion.

I'll go with "MICROCHIP PIC64-HPSC/HX DRIVERS" for all the small SoC
drivers (MDIO, GPIO, timers, etc.) and a separate entry for the big things
like RDMA or FRER hw accelerator, if we ever get there.

I won't add anything to RISC-V MICROCHIP SUPPORT even if PIC64-HPSC is
indeed a RISC-V chip since this entry is all Polarfire.

Thanks,
Charles