linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 net-next 0/2] Remainder for "DT bindings for Felix DSA switch on LS1028A"
@ 2020-02-24 12:15 Vladimir Oltean
  2020-02-24 12:15 ` [PATCH v4 net-next 1/2] net: dsa: felix: Use PHY_INTERFACE_MODE_INTERNAL instead of GMII Vladimir Oltean
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Vladimir Oltean @ 2020-02-24 12:15 UTC (permalink / raw)
  To: davem, netdev
  Cc: shawnguo, robh+dt, mark.rutland, devicetree, andrew,
	vivien.didelot, f.fainelli, alexandru.marginean, claudiu.manoil,
	michael, linux-kernel

From: Vladimir Oltean <vladimir.oltean@nxp.com>

This series is the remainder of patchset [0] which has been merged
through Shawn Guo's devicetree tree.

It contains changes to the PHY mode validation in the Felix driver
("gmii" to "internal") and the documentation for the DT bindings.

[0]: https://patchwork.ozlabs.org/cover/1242716/

Vladimir Oltean (2):
  net: dsa: felix: Use PHY_INTERFACE_MODE_INTERNAL instead of GMII
  dt-bindings: net: dsa: ocelot: document the vsc9959 core

 .../devicetree/bindings/net/dsa/ocelot.txt    | 116 ++++++++++++++++++
 drivers/net/dsa/ocelot/felix.c                |   3 +-
 drivers/net/dsa/ocelot/felix_vsc9959.c        |   3 +-
 3 files changed, 118 insertions(+), 4 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/dsa/ocelot.txt

-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v4 net-next 1/2] net: dsa: felix: Use PHY_INTERFACE_MODE_INTERNAL instead of GMII
  2020-02-24 12:15 [PATCH v4 net-next 0/2] Remainder for "DT bindings for Felix DSA switch on LS1028A" Vladimir Oltean
@ 2020-02-24 12:15 ` Vladimir Oltean
  2020-02-24 12:15 ` [PATCH v4 net-next 2/2] dt-bindings: net: dsa: ocelot: document the vsc9959 core Vladimir Oltean
  2020-02-24 23:12 ` [PATCH v4 net-next 0/2] Remainder for "DT bindings for Felix DSA switch on LS1028A" David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Vladimir Oltean @ 2020-02-24 12:15 UTC (permalink / raw)
  To: davem, netdev
  Cc: shawnguo, robh+dt, mark.rutland, devicetree, andrew,
	vivien.didelot, f.fainelli, alexandru.marginean, claudiu.manoil,
	michael, linux-kernel

From: Vladimir Oltean <vladimir.oltean@nxp.com>

phy-mode = "gmii" is confusing because it may mean that the port
supports the 8-bit-wide parallel data interface pinout, which it
doesn't.

It may also be confusing because one of the "gmii" internal ports is
actually overclocked to run at 2.5Gbps (even though, yes, as far as the
switch MAC is concerned, it still thinks it's gigabit).

So use the phy-mode = "internal" property to describe the internal ports
inside the NXP LS1028A chip (the ones facing the ENETC). The change
should be fine, because the device tree bindings document is yet to be
introduced, and there are no stable DT blobs in use.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Michael Walle <michael@walle.cc>
---
Changes in v4:
None.

Changes in v3:
None.

Changes in v2:
Patch is new.

 drivers/net/dsa/ocelot/felix.c         | 3 +--
 drivers/net/dsa/ocelot/felix_vsc9959.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c
index 3257962c147e..35124ef7e75b 100644
--- a/drivers/net/dsa/ocelot/felix.c
+++ b/drivers/net/dsa/ocelot/felix.c
@@ -176,8 +176,7 @@ static void felix_phylink_validate(struct dsa_switch *ds, int port,
 	phylink_set(mask, 100baseT_Full);
 	phylink_set(mask, 1000baseT_Full);
 
-	/* The internal ports that run at 2.5G are overclocked GMII */
-	if (state->interface == PHY_INTERFACE_MODE_GMII ||
+	if (state->interface == PHY_INTERFACE_MODE_INTERNAL ||
 	    state->interface == PHY_INTERFACE_MODE_2500BASEX ||
 	    state->interface == PHY_INTERFACE_MODE_USXGMII) {
 		phylink_set(mask, 2500baseT_Full);
diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c b/drivers/net/dsa/ocelot/felix_vsc9959.c
index 2c812b481778..93800e81cdd4 100644
--- a/drivers/net/dsa/ocelot/felix_vsc9959.c
+++ b/drivers/net/dsa/ocelot/felix_vsc9959.c
@@ -955,8 +955,7 @@ static int vsc9959_prevalidate_phy_mode(struct ocelot *ocelot, int port,
 					phy_interface_t phy_mode)
 {
 	switch (phy_mode) {
-	case PHY_INTERFACE_MODE_GMII:
-		/* Only supported on internal to-CPU ports */
+	case PHY_INTERFACE_MODE_INTERNAL:
 		if (port != 4 && port != 5)
 			return -ENOTSUPP;
 		return 0;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v4 net-next 2/2] dt-bindings: net: dsa: ocelot: document the vsc9959 core
  2020-02-24 12:15 [PATCH v4 net-next 0/2] Remainder for "DT bindings for Felix DSA switch on LS1028A" Vladimir Oltean
  2020-02-24 12:15 ` [PATCH v4 net-next 1/2] net: dsa: felix: Use PHY_INTERFACE_MODE_INTERNAL instead of GMII Vladimir Oltean
@ 2020-02-24 12:15 ` Vladimir Oltean
  2020-02-24 23:12 ` [PATCH v4 net-next 0/2] Remainder for "DT bindings for Felix DSA switch on LS1028A" David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Vladimir Oltean @ 2020-02-24 12:15 UTC (permalink / raw)
  To: davem, netdev
  Cc: shawnguo, robh+dt, mark.rutland, devicetree, andrew,
	vivien.didelot, f.fainelli, alexandru.marginean, claudiu.manoil,
	michael, linux-kernel

From: Vladimir Oltean <vladimir.oltean@nxp.com>

This patch adds the required documentation for the embedded L2 switch
inside the NXP LS1028A chip.

I've submitted it in the legacy format instead of yaml schema, because
DSA itself has not yet been converted to yaml, and this driver defines
no custom bindings.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
Changes in v4:
None.

Changes in v3:
- Clarify the real restriction regarding enetc_port2 which can't be
  disabled.
- Document the supported phy-modes on Felix switch ports.

Changes in v2:
Adapted phy-mode = "gmii" to phy-mode = "internal".

 .../devicetree/bindings/net/dsa/ocelot.txt    | 116 ++++++++++++++++++
 1 file changed, 116 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/dsa/ocelot.txt

diff --git a/Documentation/devicetree/bindings/net/dsa/ocelot.txt b/Documentation/devicetree/bindings/net/dsa/ocelot.txt
new file mode 100644
index 000000000000..66a129fea705
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/dsa/ocelot.txt
@@ -0,0 +1,116 @@
+Microchip Ocelot switch driver family
+=====================================
+
+Felix
+-----
+
+The VSC9959 core is currently the only switch supported by the driver, and is
+found in the NXP LS1028A. It is a PCI device, part of the larger ENETC root
+complex. As a result, the ethernet-switch node is a sub-node of the PCIe root
+complex node and its "reg" property conforms to the parent node bindings:
+
+* reg: Specifies PCIe Device Number and Function Number of the endpoint device,
+  in this case for the Ethernet L2Switch it is PF5 (of device 0, bus 0).
+
+It does not require a "compatible" string.
+
+The interrupt line is used to signal availability of PTP TX timestamps and for
+TSN frame preemption.
+
+For the external switch ports, depending on board configuration, "phy-mode" and
+"phy-handle" are populated by board specific device tree instances. Ports 4 and
+5 are fixed as internal ports in the NXP LS1028A instantiation.
+
+The CPU port property ("ethernet") configures the feature called "NPI port" in
+the Ocelot hardware core. The CPU port in Ocelot is a set of queues, which are
+connected, in the Node Processor Interface (NPI) mode, to an Ethernet port.
+By default, in fsl-ls1028a.dtsi, the NPI port is assigned to the internal
+2.5Gbps port@4, but can be moved to the 1Gbps port@5, depending on the specific
+use case.  Moving the NPI port to an external switch port is hardware possible,
+but there is no platform support for the Linux system on the LS1028A chip to
+operate as an entire slave DSA chip.  NPI functionality (and therefore DSA
+tagging) is supported on a single port at a time.
+
+Any port can be disabled (and in fsl-ls1028a.dtsi, they are indeed all disabled
+by default, and should be enabled on a per-board basis). But if any external
+switch port is enabled at all, the ENETC PF2 (enetc_port2) should be enabled as
+well, regardless of whether it is configured as the DSA master or not. This is
+because the Felix PHYLINK implementation accesses the MAC PCS registers, which
+in hardware truly belong to the ENETC port #2 and not to Felix.
+
+Supported PHY interface types (appropriate SerDes protocol setting changes are
+needed in the RCW binary):
+
+* phy_mode = "internal": on ports 4 and 5
+* phy_mode = "sgmii": on ports 0, 1, 2, 3
+* phy_mode = "qsgmii": on ports 0, 1, 2, 3
+* phy_mode = "usxgmii": on ports 0, 1, 2, 3
+* phy_mode = "2500base-x": on ports 0, 1, 2, 3
+
+For the rest of the device tree binding definitions, which are standard DSA and
+PCI, refer to the following documents:
+
+Documentation/devicetree/bindings/net/dsa/dsa.txt
+Documentation/devicetree/bindings/pci/pci.txt
+
+Example:
+
+&soc {
+	pcie@1f0000000 { /* Integrated Endpoint Root Complex */
+		ethernet-switch@0,5 {
+			reg = <0x000500 0 0 0 0>;
+			/* IEP INT_B */
+			interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>;
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				/* External ports */
+				port@0 {
+					reg = <0>;
+					label = "swp0";
+				};
+
+				port@1 {
+					reg = <1>;
+					label = "swp1";
+				};
+
+				port@2 {
+					reg = <2>;
+					label = "swp2";
+				};
+
+				port@3 {
+					reg = <3>;
+					label = "swp3";
+				};
+
+				/* Tagging CPU port */
+				port@4 {
+					reg = <4>;
+					ethernet = <&enetc_port2>;
+					phy-mode = "internal";
+
+					fixed-link {
+						speed = <2500>;
+						full-duplex;
+					};
+				};
+
+				/* Non-tagging CPU port */
+				port@5 {
+					reg = <5>;
+					phy-mode = "internal";
+					status = "disabled";
+
+					fixed-link {
+						speed = <1000>;
+						full-duplex;
+					};
+				};
+			};
+		};
+	};
+};
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v4 net-next 0/2] Remainder for "DT bindings for Felix DSA switch on LS1028A"
  2020-02-24 12:15 [PATCH v4 net-next 0/2] Remainder for "DT bindings for Felix DSA switch on LS1028A" Vladimir Oltean
  2020-02-24 12:15 ` [PATCH v4 net-next 1/2] net: dsa: felix: Use PHY_INTERFACE_MODE_INTERNAL instead of GMII Vladimir Oltean
  2020-02-24 12:15 ` [PATCH v4 net-next 2/2] dt-bindings: net: dsa: ocelot: document the vsc9959 core Vladimir Oltean
@ 2020-02-24 23:12 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-02-24 23:12 UTC (permalink / raw)
  To: olteanv
  Cc: netdev, shawnguo, robh+dt, mark.rutland, devicetree, andrew,
	vivien.didelot, f.fainelli, alexandru.marginean, claudiu.manoil,
	michael, linux-kernel

From: Vladimir Oltean <olteanv@gmail.com>
Date: Mon, 24 Feb 2020 14:15:32 +0200

> From: Vladimir Oltean <vladimir.oltean@nxp.com>
> 
> This series is the remainder of patchset [0] which has been merged
> through Shawn Guo's devicetree tree.
> 
> It contains changes to the PHY mode validation in the Felix driver
> ("gmii" to "internal") and the documentation for the DT bindings.
> 
> [0]: https://patchwork.ozlabs.org/cover/1242716/

Series applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-02-24 23:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-24 12:15 [PATCH v4 net-next 0/2] Remainder for "DT bindings for Felix DSA switch on LS1028A" Vladimir Oltean
2020-02-24 12:15 ` [PATCH v4 net-next 1/2] net: dsa: felix: Use PHY_INTERFACE_MODE_INTERNAL instead of GMII Vladimir Oltean
2020-02-24 12:15 ` [PATCH v4 net-next 2/2] dt-bindings: net: dsa: ocelot: document the vsc9959 core Vladimir Oltean
2020-02-24 23:12 ` [PATCH v4 net-next 0/2] Remainder for "DT bindings for Felix DSA switch on LS1028A" David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).