2021-10-06 06:37:56

by Horatiu Vultur

[permalink] [raw]
Subject: [PATCH v2 0/3] Add driver for lan966x Serdes driver

This patch serie adds support for Microchip lan966x serdes. The lan966x
device which contains this serdes has 8 interfaces, consisting of 2
copper transceivers, 3 Serdes and 2 RGMII interfaces and 2 of the
Serdes support QSGMII.

The following table shows which interfaces can be supported by the port.

PortNumber Max Speed Ethernet interface options
0 1Gbps CuPHY, 1G SGMII or QSGMII
1 1Gbps CuPHY, 1G SGMII or QSGMII
2 2.5Gbps 2.5G SGMII, QSGMII, RGMII
3 2.5Gbps 2.5G SGMII, QSGMII, RGMII
4 2.5Gbps 2.5G SGMII, QSGMII
5 1Gbps QSGMII, RGMII
6 1Gbps QSGMII, RGMII
7 1Gbps QSGMII

v1 -> v2:
- replace the regmap with iomem
- update DT bindings


Horatiu Vultur (3):
dt-bindings: phy: Add lan966x-serdes binding
dt-bindings: phy: Add binding includes for lan966x serdes
phy: Add lan966x ethernet serdes PHY driver

.../phy/microchip,lan966x-serdes.yaml | 43 ++
drivers/phy/microchip/Kconfig | 8 +
drivers/phy/microchip/Makefile | 1 +
drivers/phy/microchip/lan966x_serdes.c | 542 ++++++++++++++++++
drivers/phy/microchip/lan966x_serdes_regs.h | 482 ++++++++++++++++
include/dt-bindings/phy/lan966x_serdes.h | 14 +
6 files changed, 1090 insertions(+)
create mode 100644 Documentation/devicetree/bindings/phy/microchip,lan966x-serdes.yaml
create mode 100644 drivers/phy/microchip/lan966x_serdes.c
create mode 100644 drivers/phy/microchip/lan966x_serdes_regs.h
create mode 100644 include/dt-bindings/phy/lan966x_serdes.h

--
2.33.0


2021-10-06 06:38:31

by Horatiu Vultur

[permalink] [raw]
Subject: [PATCH v2 2/3] dt-bindings: phy: Add binding includes for lan966x serdes

Add include bindings for lan966x serdes

Signed-off-by: Horatiu Vultur <[email protected]>
---
include/dt-bindings/phy/lan966x_serdes.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
create mode 100644 include/dt-bindings/phy/lan966x_serdes.h

diff --git a/include/dt-bindings/phy/lan966x_serdes.h b/include/dt-bindings/phy/lan966x_serdes.h
new file mode 100644
index 000000000000..06e529473475
--- /dev/null
+++ b/include/dt-bindings/phy/lan966x_serdes.h
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
+
+#ifndef __LAN966X_SERDES_H__
+#define __LAN966X_SERDES_H__
+
+#define CU(x) (x)
+#define CU_MAX CU(2)
+#define SERDES6G(x) (CU_MAX + 1 + (x))
+#define SERDES6G_MAX SERDES6G(3)
+#define RG(x) (SERDES6G_MAX + 1 + (x))
+#define RG_MAX RG(2)
+#define SERDES_MAX (RG_MAX + 1)
+
+#endif
--
2.33.0

2021-10-14 22:30:08

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v2 2/3] dt-bindings: phy: Add binding includes for lan966x serdes

On Wed, Oct 06, 2021 at 08:35:22AM +0200, Horatiu Vultur wrote:
> Add include bindings for lan966x serdes
>
> Signed-off-by: Horatiu Vultur <[email protected]>
> ---
> include/dt-bindings/phy/lan966x_serdes.h | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
> create mode 100644 include/dt-bindings/phy/lan966x_serdes.h
>
> diff --git a/include/dt-bindings/phy/lan966x_serdes.h b/include/dt-bindings/phy/lan966x_serdes.h
> new file mode 100644
> index 000000000000..06e529473475
> --- /dev/null
> +++ b/include/dt-bindings/phy/lan966x_serdes.h
> @@ -0,0 +1,14 @@
> +/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
> +
> +#ifndef __LAN966X_SERDES_H__
> +#define __LAN966X_SERDES_H__
> +
> +#define CU(x) (x)
> +#define CU_MAX CU(2)
> +#define SERDES6G(x) (CU_MAX + 1 + (x))
> +#define SERDES6G_MAX SERDES6G(3)
> +#define RG(x) (SERDES6G_MAX + 1 + (x))
> +#define RG_MAX RG(2)
> +#define SERDES_MAX (RG_MAX + 1)

I'm guessing these are used for the phy cells? If so, I can't figure out
how and I shouldn't have to search the driver to figure it out.

What's CU? What's RG?

2021-10-15 16:28:27

by Horatiu Vultur

[permalink] [raw]
Subject: Re: [PATCH v2 2/3] dt-bindings: phy: Add binding includes for lan966x serdes

The 10/14/2021 13:25, Rob Herring wrote:

>
> On Wed, Oct 06, 2021 at 08:35:22AM +0200, Horatiu Vultur wrote:
> > Add include bindings for lan966x serdes
> >
> > Signed-off-by: Horatiu Vultur <[email protected]>
> > ---
> > include/dt-bindings/phy/lan966x_serdes.h | 14 ++++++++++++++
> > 1 file changed, 14 insertions(+)
> > create mode 100644 include/dt-bindings/phy/lan966x_serdes.h
> >
> > diff --git a/include/dt-bindings/phy/lan966x_serdes.h b/include/dt-bindings/phy/lan966x_serdes.h
> > new file mode 100644
> > index 000000000000..06e529473475
> > --- /dev/null
> > +++ b/include/dt-bindings/phy/lan966x_serdes.h
> > @@ -0,0 +1,14 @@
> > +/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
> > +
> > +#ifndef __LAN966X_SERDES_H__
> > +#define __LAN966X_SERDES_H__
> > +
> > +#define CU(x) (x)
> > +#define CU_MAX CU(2)
> > +#define SERDES6G(x) (CU_MAX + 1 + (x))
> > +#define SERDES6G_MAX SERDES6G(3)
> > +#define RG(x) (SERDES6G_MAX + 1 + (x))
> > +#define RG_MAX RG(2)
> > +#define SERDES_MAX (RG_MAX + 1)
>
> I'm guessing these are used for the phy cells? If so, I can't figure out
> how and I shouldn't have to search the driver to figure it out.

These are just some constatns to be able to select between the
integrated PHYs, RGMII, SerDes interfaces. Because these interfaces
needs to be muxed according to the HW.

This is something similar with the Ocelot Serdes where there are only
2 Serdes types.

>
> What's CU? What's RG?

Cu - copper PHY
RG - RGMII

I will create a new version where I will improve the log message.

--
/Horatiu