devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v7 00/10] net: dpaa: Convert to phylink
@ 2022-10-17 20:22 Sean Anderson
  2022-10-17 20:22 ` [PATCH net-next v7 01/10] dt-bindings: net: Expand pcs-handle to an array Sean Anderson
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Sean Anderson @ 2022-10-17 20:22 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Madalin Bucur,
	Camelia Alexandra Groza, netdev
  Cc: Eric Dumazet, linuxppc-dev @ lists . ozlabs . org,
	linux-arm-kernel, linux-kernel, Russell King, Paolo Abeni,
	Sean Anderson, Benjamin Herrenschmidt, Ioana Ciornei,
	Krzysztof Kozlowski, Li Yang, Michael Ellerman, Paul Mackerras,
	Rob Herring, Shawn Guo, devicetree

This series converts the DPAA driver to phylink.

I have tried to maintain backwards compatibility with existing device
trees whereever possible. However, one area where I was unable to
achieve this was with QSGMII. Please refer to patch 2 for details.

All mac drivers have now been converted. I would greatly appreciate if
anyone has T-series or P-series boards they can test/debug this series
on. I only have an LS1046ARDB. Everything but QSGMII should work without
breakage; QSGMII needs patches 7 and 8. For this reason, the last 4
patches in this series should be applied together (and should not go
through separate trees).

Changes in v7:
- provide phylink_validate_mask_caps() helper
- Fix oops if memac_pcs_create returned -EPROBE_DEFER
- Fix using pcs-names instead of pcs-handle-names
- Fix not checking for -ENODATA when looking for sgmii pcs
- Fix 81-character line
- Simplify memac_validate with phylink_validate_mask_caps

Changes in v6:
- Remove unnecessary $ref from renesas,rzn1-a5psw
- Remove unnecessary type from pcs-handle-names
- Add maxItems to pcs-handle
- Fix 81-character line
- Fix uninitialized variable in dtsec_mac_config

Changes in v5:
- Add Lynx PCS binding

Changes in v4:
- Use pcs-handle-names instead of pcs-names, as discussed
- Don't fail if phy support was not compiled in
- Split off rate adaptation series
- Split off DPAA "preparation" series
- Split off Lynx 10G support
- t208x: Mark MAC1 and MAC2 as 10G
- Add XFI PCS for t208x MAC1/MAC2

Changes in v3:
- Expand pcs-handle to an array
- Add vendor prefix 'fsl,' to rgmii and mii properties.
- Set maxItems for pcs-names
- Remove phy-* properties from example because dt-schema complains and I
  can't be bothered to figure out how to make it work.
- Add pcs-handle as a preferred version of pcsphy-handle
- Deprecate pcsphy-handle
- Remove mii/rmii properties
- Put the PCS mdiodev only after we are done with it (since the PCS
  does not perform a get itself).
- Remove _return label from memac_initialization in favor of returning
  directly
- Fix grabbing the default PCS not checking for -ENODATA from
  of_property_match_string
- Set DTSEC_ECNTRL_R100M in dtsec_link_up instead of dtsec_mac_config
- Remove rmii/mii properties
- Replace 1000Base... with 1000BASE... to match IEEE capitalization
- Add compatibles for QSGMII PCSs
- Split arm and powerpcs dts updates

Changes in v2:
- Better document how we select which PCS to use in the default case
- Move PCS_LYNX dependency to fman Kconfig
- Remove unused variable slow_10g_if
- Restrict valid link modes based on the phy interface. This is easier
  to set up, and mostly captures what I intended to do the first time.
  We now have a custom validate which restricts half-duplex for some SoCs
  for RGMII, but generally just uses the default phylink validate.
- Configure the SerDes in enable/disable
- Properly implement all ethtool ops and ioctls. These were mostly
  stubbed out just enough to compile last time.
- Convert 10GEC and dTSEC as well
- Fix capitalization of mEMAC in commit messages
- Add nodes for QSGMII PCSs
- Add nodes for QSGMII PCSs

Russell King (Oracle) (1):
  net: phylink: provide phylink_validate_mask_caps() helper

Sean Anderson (9):
  dt-bindings: net: Expand pcs-handle to an array
  dt-bindings: net: Add Lynx PCS binding
  dt-bindings: net: fman: Add additional interface properties
  net: fman: memac: Add serdes support
  net: fman: memac: Use lynx pcs driver
  net: dpaa: Convert to phylink
  powerpc: dts: t208x: Mark MAC1 and MAC2 as 10G
  powerpc: dts: qoriq: Add nodes for QSGMII PCSs
  arm64: dts: layerscape: Add nodes for QSGMII PCSs

 .../bindings/net/dsa/renesas,rzn1-a5psw.yaml  |   2 +-
 .../bindings/net/ethernet-controller.yaml     |  11 +-
 .../bindings/net/fsl,fman-dtsec.yaml          |  53 +-
 .../bindings/net/fsl,qoriq-mc-dpmac.yaml      |   2 +-
 .../devicetree/bindings/net/fsl-fman.txt      |   5 +-
 .../bindings/net/pcs/fsl,lynx-pcs.yaml        |  40 +
 .../boot/dts/freescale/fsl-ls1043-post.dtsi   |  24 +
 .../boot/dts/freescale/fsl-ls1046-post.dtsi   |  25 +
 .../fsl/qoriq-fman3-0-10g-0-best-effort.dtsi  |   3 +-
 .../boot/dts/fsl/qoriq-fman3-0-10g-0.dtsi     |  10 +-
 .../fsl/qoriq-fman3-0-10g-1-best-effort.dtsi  |  10 +-
 .../boot/dts/fsl/qoriq-fman3-0-10g-1.dtsi     |  10 +-
 .../boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi     |  45 ++
 .../boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi     |  45 ++
 .../boot/dts/fsl/qoriq-fman3-0-1g-0.dtsi      |   3 +-
 .../boot/dts/fsl/qoriq-fman3-0-1g-1.dtsi      |  10 +-
 .../boot/dts/fsl/qoriq-fman3-0-1g-2.dtsi      |  10 +-
 .../boot/dts/fsl/qoriq-fman3-0-1g-3.dtsi      |  10 +-
 .../boot/dts/fsl/qoriq-fman3-0-1g-4.dtsi      |   3 +-
 .../boot/dts/fsl/qoriq-fman3-0-1g-5.dtsi      |  10 +-
 .../boot/dts/fsl/qoriq-fman3-1-10g-0.dtsi     |  10 +-
 .../boot/dts/fsl/qoriq-fman3-1-10g-1.dtsi     |  10 +-
 .../boot/dts/fsl/qoriq-fman3-1-1g-0.dtsi      |   3 +-
 .../boot/dts/fsl/qoriq-fman3-1-1g-1.dtsi      |  10 +-
 .../boot/dts/fsl/qoriq-fman3-1-1g-2.dtsi      |  10 +-
 .../boot/dts/fsl/qoriq-fman3-1-1g-3.dtsi      |  10 +-
 .../boot/dts/fsl/qoriq-fman3-1-1g-4.dtsi      |   3 +-
 .../boot/dts/fsl/qoriq-fman3-1-1g-5.dtsi      |  10 +-
 arch/powerpc/boot/dts/fsl/t2081si-post.dtsi   |   4 +-
 drivers/net/ethernet/freescale/dpaa/Kconfig   |   4 +-
 .../net/ethernet/freescale/dpaa/dpaa_eth.c    |  89 +--
 .../ethernet/freescale/dpaa/dpaa_ethtool.c    |  90 +--
 drivers/net/ethernet/freescale/fman/Kconfig   |   4 +-
 .../net/ethernet/freescale/fman/fman_dtsec.c  | 460 +++++------
 .../net/ethernet/freescale/fman/fman_mac.h    |  10 -
 .../net/ethernet/freescale/fman/fman_memac.c  | 744 +++++++++---------
 .../net/ethernet/freescale/fman/fman_tgec.c   | 131 ++-
 drivers/net/ethernet/freescale/fman/mac.c     | 168 +---
 drivers/net/ethernet/freescale/fman/mac.h     |  23 +-
 drivers/net/phy/phylink.c                     |  43 +-
 include/linux/phylink.h                       |   3 +
 41 files changed, 1106 insertions(+), 1064 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/pcs/fsl,lynx-pcs.yaml
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi

-- 
2.35.1.1320.gc452695387.dirty


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

* [PATCH net-next v7 01/10] dt-bindings: net: Expand pcs-handle to an array
  2022-10-17 20:22 [PATCH net-next v7 00/10] net: dpaa: Convert to phylink Sean Anderson
@ 2022-10-17 20:22 ` Sean Anderson
  2022-10-17 20:22 ` [PATCH net-next v7 02/10] dt-bindings: net: Add Lynx PCS binding Sean Anderson
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Sean Anderson @ 2022-10-17 20:22 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Madalin Bucur,
	Camelia Alexandra Groza, netdev
  Cc: Eric Dumazet, linuxppc-dev @ lists . ozlabs . org,
	linux-arm-kernel, linux-kernel, Russell King, Paolo Abeni,
	Sean Anderson, Rob Herring, Krzysztof Kozlowski, Rob Herring,
	devicetree

This allows multiple phandles to be specified for pcs-handle, such as
when multiple PCSs are present for a single MAC. To differentiate
between them, also add a pcs-handle-names property.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Rob Herring <robh@kernel.org>
---
This was previously submitted as [1]. I expect to update this series
more, so I have moved it here. Changes from that version include:
- Add maxItems to existing bindings
- Add a dependency from pcs-names to pcs-handle.

[1] https://lore.kernel.org/netdev/20220711160519.741990-3-sean.anderson@seco.com/

(no changes since v6)

Changes in v6:
- Remove unnecessary $ref from renesas,rzn1-a5psw
- Remove unnecessary type from pcs-handle-names
- Add maxItems to pcs-handle

Changes in v4:
- Use pcs-handle-names instead of pcs-names, as discussed

Changes in v3:
- New

 .../bindings/net/dsa/renesas,rzn1-a5psw.yaml          |  2 +-
 .../devicetree/bindings/net/ethernet-controller.yaml  | 11 ++++++++++-
 .../devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml   |  2 +-
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
index 7ca9c19a157c..0a0d62b6c00e 100644
--- a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
@@ -74,10 +74,10 @@ properties:
 
         properties:
           pcs-handle:
+            maxItems: 1
             description:
               phandle pointing to a PCS sub-node compatible with
               renesas,rzn1-miic.yaml#
-            $ref: /schemas/types.yaml#/definitions/phandle
 
 unevaluatedProperties: false
 
diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
index 4b3c590fcebf..3aef506fa158 100644
--- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml
+++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
@@ -108,11 +108,17 @@ properties:
     $ref: "#/properties/phy-connection-type"
 
   pcs-handle:
-    $ref: /schemas/types.yaml#/definitions/phandle
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    items:
+      maxItems: 1
     description:
       Specifies a reference to a node representing a PCS PHY device on a MDIO
       bus to link with an external PHY (phy-handle) if exists.
 
+  pcs-handle-names:
+    description:
+      The name of each PCS in pcs-handle.
+
   phy-handle:
     $ref: /schemas/types.yaml#/definitions/phandle
     description:
@@ -216,6 +222,9 @@ properties:
         required:
           - speed
 
+dependencies:
+  pcs-handle-names: [pcs-handle]
+
 allOf:
   - if:
       properties:
diff --git a/Documentation/devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml b/Documentation/devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml
index 7f620a71a972..600240281e8c 100644
--- a/Documentation/devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml
+++ b/Documentation/devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml
@@ -31,7 +31,7 @@ properties:
   phy-mode: true
 
   pcs-handle:
-    $ref: /schemas/types.yaml#/definitions/phandle
+    maxItems: 1
     description:
       A reference to a node representing a PCS PHY device found on
       the internal MDIO bus.
-- 
2.35.1.1320.gc452695387.dirty


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

* [PATCH net-next v7 02/10] dt-bindings: net: Add Lynx PCS binding
  2022-10-17 20:22 [PATCH net-next v7 00/10] net: dpaa: Convert to phylink Sean Anderson
  2022-10-17 20:22 ` [PATCH net-next v7 01/10] dt-bindings: net: Expand pcs-handle to an array Sean Anderson
@ 2022-10-17 20:22 ` Sean Anderson
  2022-10-17 20:22 ` [PATCH net-next v7 03/10] dt-bindings: net: fman: Add additional interface properties Sean Anderson
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Sean Anderson @ 2022-10-17 20:22 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Madalin Bucur,
	Camelia Alexandra Groza, netdev
  Cc: Eric Dumazet, linuxppc-dev @ lists . ozlabs . org,
	linux-arm-kernel, linux-kernel, Russell King, Paolo Abeni,
	Sean Anderson, Rob Herring, Ioana Ciornei, Krzysztof Kozlowski,
	Rob Herring, devicetree

This binding is fairly bare-bones for now, since the Lynx driver doesn't
parse any properties (or match based on the compatible). We just need it
in order to prevent the PCS nodes from having phy devices attached to
them. This is not really a problem, but it is a bit inefficient.

This binding is really for three separate PCSs (SGMII, QSGMII, and XFI).
However, the driver treats all of them the same. This works because the
SGMII and XFI devices typically use the same address, and the SerDes
driver (or RCW) muxes between them. The QSGMII PCSs have the same
register layout as the SGMII PCSs. To do things properly, we'd probably
do something like

	ethernet-pcs@0 {
		#pcs-cells = <1>;
		compatible = "fsl,lynx-pcs";
		reg = <0>, <1>, <2>, <3>;
	};

but that would add complexity, and we can describe the hardware just
fine using separate PCSs for now.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Rob Herring <robh@kernel.org>
---

(no changes since v5)

Changes in v5:
- New

 .../bindings/net/pcs/fsl,lynx-pcs.yaml        | 40 +++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/pcs/fsl,lynx-pcs.yaml

diff --git a/Documentation/devicetree/bindings/net/pcs/fsl,lynx-pcs.yaml b/Documentation/devicetree/bindings/net/pcs/fsl,lynx-pcs.yaml
new file mode 100644
index 000000000000..fbedf696c555
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/pcs/fsl,lynx-pcs.yaml
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/pcs/fsl,lynx-pcs.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP Lynx PCS
+
+maintainers:
+  - Ioana Ciornei <ioana.ciornei@nxp.com>
+
+description: |
+  NXP Lynx 10G and 28G SerDes have Ethernet PCS devices which can be used as
+  protocol controllers. They are accessible over the Ethernet interface's MDIO
+  bus.
+
+properties:
+  compatible:
+    const: fsl,lynx-pcs
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    mdio-bus {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      qsgmii_pcs1: ethernet-pcs@1 {
+        compatible = "fsl,lynx-pcs";
+        reg = <1>;
+      };
+    };
-- 
2.35.1.1320.gc452695387.dirty


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

* [PATCH net-next v7 03/10] dt-bindings: net: fman: Add additional interface properties
  2022-10-17 20:22 [PATCH net-next v7 00/10] net: dpaa: Convert to phylink Sean Anderson
  2022-10-17 20:22 ` [PATCH net-next v7 01/10] dt-bindings: net: Expand pcs-handle to an array Sean Anderson
  2022-10-17 20:22 ` [PATCH net-next v7 02/10] dt-bindings: net: Add Lynx PCS binding Sean Anderson
@ 2022-10-17 20:22 ` Sean Anderson
  2022-10-17 20:22 ` [PATCH net-next v7 08/10] powerpc: dts: t208x: Mark MAC1 and MAC2 as 10G Sean Anderson
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Sean Anderson @ 2022-10-17 20:22 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Madalin Bucur,
	Camelia Alexandra Groza, netdev
  Cc: Eric Dumazet, linuxppc-dev @ lists . ozlabs . org,
	linux-arm-kernel, linux-kernel, Russell King, Paolo Abeni,
	Sean Anderson, Rob Herring, Krzysztof Kozlowski, Rob Herring,
	devicetree

At the moment, mEMACs are configured almost completely based on the
phy-connection-type. That is, if the phy interface is RGMII, it assumed
that RGMII is supported. For some interfaces, it is assumed that the
RCW/bootloader has set up the SerDes properly. This is generally OK, but
restricts runtime reconfiguration. The actual link state is never
reported.

To address these shortcomings, the driver will need additional
information. First, it needs to know how to access the PCS/PMAs (in
order to configure them and get the link status). The SGMII PCS/PMA is
the only currently-described PCS/PMA. Add the XFI and QSGMII PCS/PMAs as
well. The XFI (and 10GBASE-KR) PCS/PMA is a c45 "phy" which sits on the
same MDIO bus as SGMII PCS/PMA. By default they will have conflicting
addresses, but they are also not enabled at the same time by default.
Therefore, we can let the XFI PCS/PMA be the default when
phy-connection-type is xgmii. This will allow for
backwards-compatibility.

QSGMII, however, cannot work with the current binding. This is because
the QSGMII PCS/PMAs are only present on one MAC's MDIO bus. At the
moment this is worked around by having every MAC write to the PCS/PMA
addresses (without checking if they are present). This only works if
each MAC has the same configuration, and only if we don't need to know
the status. Because the QSGMII PCS/PMA will typically be located on a
different MDIO bus than the MAC's SGMII PCS/PMA, there is no fallback
for the QSGMII PCS/PMA.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Rob Herring <robh@kernel.org>
---

(no changes since v3)

Changes in v3:
- Add vendor prefix 'fsl,' to rgmii and mii properties.
- Set maxItems for pcs-names
- Remove phy-* properties from example because dt-schema complains and I
  can't be bothered to figure out how to make it work.
- Add pcs-handle as a preferred version of pcsphy-handle
- Deprecate pcsphy-handle
- Remove mii/rmii properties

Changes in v2:
- Better document how we select which PCS to use in the default case

 .../bindings/net/fsl,fman-dtsec.yaml          | 53 ++++++++++++++-----
 .../devicetree/bindings/net/fsl-fman.txt      |  5 +-
 2 files changed, 43 insertions(+), 15 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/fsl,fman-dtsec.yaml b/Documentation/devicetree/bindings/net/fsl,fman-dtsec.yaml
index 3a35ac1c260d..c80c880a9dab 100644
--- a/Documentation/devicetree/bindings/net/fsl,fman-dtsec.yaml
+++ b/Documentation/devicetree/bindings/net/fsl,fman-dtsec.yaml
@@ -85,9 +85,39 @@ properties:
     $ref: /schemas/types.yaml#/definitions/phandle
     description: A reference to the IEEE1588 timer
 
+  phys:
+    description: A reference to the SerDes lane(s)
+    maxItems: 1
+
+  phy-names:
+    items:
+      - const: serdes
+
   pcsphy-handle:
-    $ref: /schemas/types.yaml#/definitions/phandle
-    description: A reference to the PCS (typically found on the SerDes)
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    minItems: 1
+    maxItems: 3
+    deprecated: true
+    description: See pcs-handle.
+
+  pcs-handle:
+    minItems: 1
+    maxItems: 3
+    description: |
+      A reference to the various PCSs (typically found on the SerDes). If
+      pcs-handle-names is absent, and phy-connection-type is "xgmii", then the first
+      reference will be assumed to be for "xfi". Otherwise, if pcs-handle-names is
+      absent, then the first reference will be assumed to be for "sgmii".
+
+  pcs-handle-names:
+    minItems: 1
+    maxItems: 3
+    items:
+      enum:
+        - sgmii
+        - qsgmii
+        - xfi
+    description: The type of each PCS in pcsphy-handle.
 
   tbi-handle:
     $ref: /schemas/types.yaml#/definitions/phandle
@@ -100,6 +130,10 @@ required:
   - fsl,fman-ports
   - ptp-timer
 
+dependencies:
+  pcs-handle-names:
+    - pcs-handle
+
 allOf:
   - $ref: ethernet-controller.yaml#
   - if:
@@ -110,14 +144,6 @@ allOf:
     then:
       required:
         - tbi-handle
-  - if:
-      properties:
-        compatible:
-          contains:
-            const: fsl,fman-memac
-    then:
-      required:
-        - pcsphy-handle
 
 unevaluatedProperties: false
 
@@ -138,8 +164,9 @@ examples:
             reg = <0xe8000 0x1000>;
             fsl,fman-ports = <&fman0_rx_0x0c &fman0_tx_0x2c>;
             ptp-timer = <&ptp_timer0>;
-            pcsphy-handle = <&pcsphy4>;
-            phy-handle = <&sgmii_phy1>;
-            phy-connection-type = "sgmii";
+            pcs-handle = <&pcsphy4>, <&qsgmiib_pcs1>;
+            pcs-handle-names = "sgmii", "qsgmii";
+            phys = <&serdes1 1>;
+            phy-names = "serdes";
     };
 ...
diff --git a/Documentation/devicetree/bindings/net/fsl-fman.txt b/Documentation/devicetree/bindings/net/fsl-fman.txt
index b9055335db3b..bda4b41af074 100644
--- a/Documentation/devicetree/bindings/net/fsl-fman.txt
+++ b/Documentation/devicetree/bindings/net/fsl-fman.txt
@@ -320,8 +320,9 @@ For internal PHY device on internal mdio bus, a PHY node should be created.
 See the definition of the PHY node in booting-without-of.txt for an
 example of how to define a PHY (Internal PHY has no interrupt line).
 - For "fsl,fman-mdio" compatible internal mdio bus, the PHY is TBI PHY.
-- For "fsl,fman-memac-mdio" compatible internal mdio bus, the PHY is PCS PHY,
-  PCS PHY addr must be '0'.
+- For "fsl,fman-memac-mdio" compatible internal mdio bus, the PHY is PCS PHY.
+  The PCS PHY address should correspond to the value of the appropriate
+  MDEV_PORT.
 
 EXAMPLE
 
-- 
2.35.1.1320.gc452695387.dirty


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

* [PATCH net-next v7 08/10] powerpc: dts: t208x: Mark MAC1 and MAC2 as 10G
  2022-10-17 20:22 [PATCH net-next v7 00/10] net: dpaa: Convert to phylink Sean Anderson
                   ` (2 preceding siblings ...)
  2022-10-17 20:22 ` [PATCH net-next v7 03/10] dt-bindings: net: fman: Add additional interface properties Sean Anderson
@ 2022-10-17 20:22 ` Sean Anderson
  2022-10-28 16:30   ` Camelia Alexandra Groza
  2022-10-17 20:22 ` [PATCH net-next v7 09/10] powerpc: dts: qoriq: Add nodes for QSGMII PCSs Sean Anderson
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 12+ messages in thread
From: Sean Anderson @ 2022-10-17 20:22 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Madalin Bucur,
	Camelia Alexandra Groza, netdev
  Cc: Eric Dumazet, linuxppc-dev @ lists . ozlabs . org,
	linux-arm-kernel, linux-kernel, Russell King, Paolo Abeni,
	Sean Anderson, Benjamin Herrenschmidt, Krzysztof Kozlowski,
	Li Yang, Michael Ellerman, Paul Mackerras, Rob Herring,
	devicetree

On the T208X SoCs, MAC1 and MAC2 support XGMII. Add some new MAC dtsi
fragments, and mark the QMAN ports as 10G.

Fixes: da414bb923d9 ("powerpc/mpc85xx: Add FSL QorIQ DPAA FMan support to the SoC device tree(s)")
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
---

(no changes since v4)

Changes in v4:
- New

 .../boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi     | 44 +++++++++++++++++++
 .../boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi     | 44 +++++++++++++++++++
 arch/powerpc/boot/dts/fsl/t2081si-post.dtsi   |  4 +-
 3 files changed, 90 insertions(+), 2 deletions(-)
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi

diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi
new file mode 100644
index 000000000000..437dab3fc017
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi
@@ -0,0 +1,44 @@
+// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later
+/*
+ * QorIQ FMan v3 10g port #2 device tree stub [ controller @ offset 0x400000 ]
+ *
+ * Copyright 2022 Sean Anderson <sean.anderson@seco.com>
+ * Copyright 2012 - 2015 Freescale Semiconductor Inc.
+ */
+
+fman@400000 {
+	fman0_rx_0x08: port@88000 {
+		cell-index = <0x8>;
+		compatible = "fsl,fman-v3-port-rx";
+		reg = <0x88000 0x1000>;
+		fsl,fman-10g-port;
+	};
+
+	fman0_tx_0x28: port@a8000 {
+		cell-index = <0x28>;
+		compatible = "fsl,fman-v3-port-tx";
+		reg = <0xa8000 0x1000>;
+		fsl,fman-10g-port;
+	};
+
+	ethernet@e0000 {
+		cell-index = <0>;
+		compatible = "fsl,fman-memac";
+		reg = <0xe0000 0x1000>;
+		fsl,fman-ports = <&fman0_rx_0x08 &fman0_tx_0x28>;
+		ptp-timer = <&ptp_timer0>;
+		pcsphy-handle = <&pcsphy0>;
+	};
+
+	mdio@e1000 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
+		reg = <0xe1000 0x1000>;
+		fsl,erratum-a011043; /* must ignore read errors */
+
+		pcsphy0: ethernet-phy@0 {
+			reg = <0x0>;
+		};
+	};
+};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi
new file mode 100644
index 000000000000..ad116b17850a
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi
@@ -0,0 +1,44 @@
+// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later
+/*
+ * QorIQ FMan v3 10g port #3 device tree stub [ controller @ offset 0x400000 ]
+ *
+ * Copyright 2022 Sean Anderson <sean.anderson@seco.com>
+ * Copyright 2012 - 2015 Freescale Semiconductor Inc.
+ */
+
+fman@400000 {
+	fman0_rx_0x09: port@89000 {
+		cell-index = <0x9>;
+		compatible = "fsl,fman-v3-port-rx";
+		reg = <0x89000 0x1000>;
+		fsl,fman-10g-port;
+	};
+
+	fman0_tx_0x29: port@a9000 {
+		cell-index = <0x29>;
+		compatible = "fsl,fman-v3-port-tx";
+		reg = <0xa9000 0x1000>;
+		fsl,fman-10g-port;
+	};
+
+	ethernet@e2000 {
+		cell-index = <1>;
+		compatible = "fsl,fman-memac";
+		reg = <0xe2000 0x1000>;
+		fsl,fman-ports = <&fman0_rx_0x09 &fman0_tx_0x29>;
+		ptp-timer = <&ptp_timer0>;
+		pcsphy-handle = <&pcsphy1>;
+	};
+
+	mdio@e3000 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
+		reg = <0xe3000 0x1000>;
+		fsl,erratum-a011043; /* must ignore read errors */
+
+		pcsphy1: ethernet-phy@0 {
+			reg = <0x0>;
+		};
+	};
+};
diff --git a/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi b/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
index ecbb447920bc..74e17e134387 100644
--- a/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
@@ -609,8 +609,8 @@ usb1: usb@211000 {
 /include/ "qoriq-bman1.dtsi"
 
 /include/ "qoriq-fman3-0.dtsi"
-/include/ "qoriq-fman3-0-1g-0.dtsi"
-/include/ "qoriq-fman3-0-1g-1.dtsi"
+/include/ "qoriq-fman3-0-10g-2.dtsi"
+/include/ "qoriq-fman3-0-10g-3.dtsi"
 /include/ "qoriq-fman3-0-1g-2.dtsi"
 /include/ "qoriq-fman3-0-1g-3.dtsi"
 /include/ "qoriq-fman3-0-1g-4.dtsi"
-- 
2.35.1.1320.gc452695387.dirty


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

* [PATCH net-next v7 09/10] powerpc: dts: qoriq: Add nodes for QSGMII PCSs
  2022-10-17 20:22 [PATCH net-next v7 00/10] net: dpaa: Convert to phylink Sean Anderson
                   ` (3 preceding siblings ...)
  2022-10-17 20:22 ` [PATCH net-next v7 08/10] powerpc: dts: t208x: Mark MAC1 and MAC2 as 10G Sean Anderson
@ 2022-10-17 20:22 ` Sean Anderson
  2022-10-17 20:22 ` [PATCH net-next v7 10/10] arm64: dts: layerscape: " Sean Anderson
  2022-10-19 13:00 ` [PATCH net-next v7 00/10] net: dpaa: Convert to phylink patchwork-bot+netdevbpf
  6 siblings, 0 replies; 12+ messages in thread
From: Sean Anderson @ 2022-10-17 20:22 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Madalin Bucur,
	Camelia Alexandra Groza, netdev
  Cc: Eric Dumazet, linuxppc-dev @ lists . ozlabs . org,
	linux-arm-kernel, linux-kernel, Russell King, Paolo Abeni,
	Sean Anderson, Benjamin Herrenschmidt, Krzysztof Kozlowski,
	Li Yang, Michael Ellerman, Paul Mackerras, Rob Herring,
	devicetree

Now that we actually read registers from QSGMII PCSs, it's important
that we have the correct address (instead of hoping that we're the MAC
with all the QSGMII PCSs on its bus). This adds nodes for the QSGMII
PCSs. They have the same addresses on all SoCs (e.g. if QSGMIIA is
present it's used for MACs 1 through 4).

Since the first QSGMII PCSs share an address with the SGMII and XFI
PCSs, we only add new nodes for PCSs 2-4. This avoids address conflicts
on the bus.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
---

(no changes since v4)

Changes in v4:
- Add XFI PCS for t208x MAC1/MAC2

Changes in v3:
- Add compatibles for QSGMII PCSs
- Split arm and powerpcs dts updates

Changes in v2:
- New

 .../boot/dts/fsl/qoriq-fman3-0-10g-0-best-effort.dtsi  |  3 ++-
 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0.dtsi     | 10 +++++++++-
 .../boot/dts/fsl/qoriq-fman3-0-10g-1-best-effort.dtsi  | 10 +++++++++-
 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1.dtsi     | 10 +++++++++-
 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi     |  3 ++-
 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi     |  3 ++-
 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-0.dtsi      |  3 ++-
 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-1.dtsi      | 10 +++++++++-
 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-2.dtsi      | 10 +++++++++-
 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-3.dtsi      | 10 +++++++++-
 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-4.dtsi      |  3 ++-
 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-5.dtsi      | 10 +++++++++-
 arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-0.dtsi     | 10 +++++++++-
 arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-1.dtsi     | 10 +++++++++-
 arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-0.dtsi      |  3 ++-
 arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-1.dtsi      | 10 +++++++++-
 arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-2.dtsi      | 10 +++++++++-
 arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-3.dtsi      | 10 +++++++++-
 arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-4.dtsi      |  3 ++-
 arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-5.dtsi      | 10 +++++++++-
 20 files changed, 131 insertions(+), 20 deletions(-)

diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0-best-effort.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0-best-effort.dtsi
index baa0c503e741..7e70977f282a 100644
--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0-best-effort.dtsi
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0-best-effort.dtsi
@@ -55,7 +55,8 @@ ethernet@e0000 {
 		reg = <0xe0000 0x1000>;
 		fsl,fman-ports = <&fman0_rx_0x08 &fman0_tx_0x28>;
 		ptp-timer = <&ptp_timer0>;
-		pcsphy-handle = <&pcsphy0>;
+		pcsphy-handle = <&pcsphy0>, <&pcsphy0>;
+		pcs-handle-names = "sgmii", "qsgmii";
 	};
 
 	mdio@e1000 {
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0.dtsi
index 93095600e808..5f89f7c1761f 100644
--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0.dtsi
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0.dtsi
@@ -52,7 +52,15 @@ ethernet@f0000 {
 		compatible = "fsl,fman-memac";
 		reg = <0xf0000 0x1000>;
 		fsl,fman-ports = <&fman0_rx_0x10 &fman0_tx_0x30>;
-		pcsphy-handle = <&pcsphy6>;
+		pcsphy-handle = <&pcsphy6>, <&qsgmiib_pcs2>, <&pcsphy6>;
+		pcs-handle-names = "sgmii", "qsgmii", "xfi";
+	};
+
+	mdio@e9000 {
+		qsgmiib_pcs2: ethernet-pcs@2 {
+			compatible = "fsl,lynx-pcs";
+			reg = <2>;
+		};
 	};
 
 	mdio@f1000 {
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1-best-effort.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1-best-effort.dtsi
index ff4bd38f0645..71eb75e82c2e 100644
--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1-best-effort.dtsi
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1-best-effort.dtsi
@@ -55,7 +55,15 @@ ethernet@e2000 {
 		reg = <0xe2000 0x1000>;
 		fsl,fman-ports = <&fman0_rx_0x09 &fman0_tx_0x29>;
 		ptp-timer = <&ptp_timer0>;
-		pcsphy-handle = <&pcsphy1>;
+		pcsphy-handle = <&pcsphy1>, <&qsgmiia_pcs1>;
+		pcs-handle-names = "sgmii", "qsgmii";
+	};
+
+	mdio@e1000 {
+		qsgmiia_pcs1: ethernet-pcs@1 {
+			compatible = "fsl,lynx-pcs";
+			reg = <1>;
+		};
 	};
 
 	mdio@e3000 {
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1.dtsi
index 1fa38ed6f59e..fb7032ddb7fc 100644
--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1.dtsi
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1.dtsi
@@ -52,7 +52,15 @@ ethernet@f2000 {
 		compatible = "fsl,fman-memac";
 		reg = <0xf2000 0x1000>;
 		fsl,fman-ports = <&fman0_rx_0x11 &fman0_tx_0x31>;
-		pcsphy-handle = <&pcsphy7>;
+		pcsphy-handle = <&pcsphy7>, <&qsgmiib_pcs3>, <&pcsphy7>;
+		pcs-handle-names = "sgmii", "qsgmii", "xfi";
+	};
+
+	mdio@e9000 {
+		qsgmiib_pcs3: ethernet-pcs@3 {
+			compatible = "fsl,lynx-pcs";
+			reg = <3>;
+		};
 	};
 
 	mdio@f3000 {
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi
index 437dab3fc017..6b3609574b0f 100644
--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi
@@ -27,7 +27,8 @@ ethernet@e0000 {
 		reg = <0xe0000 0x1000>;
 		fsl,fman-ports = <&fman0_rx_0x08 &fman0_tx_0x28>;
 		ptp-timer = <&ptp_timer0>;
-		pcsphy-handle = <&pcsphy0>;
+		pcsphy-handle = <&pcsphy0>, <&pcsphy0>;
+		pcs-handle-names = "sgmii", "xfi";
 	};
 
 	mdio@e1000 {
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi
index ad116b17850a..28ed1a85a436 100644
--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi
@@ -27,7 +27,8 @@ ethernet@e2000 {
 		reg = <0xe2000 0x1000>;
 		fsl,fman-ports = <&fman0_rx_0x09 &fman0_tx_0x29>;
 		ptp-timer = <&ptp_timer0>;
-		pcsphy-handle = <&pcsphy1>;
+		pcsphy-handle = <&pcsphy1>, <&pcsphy1>;
+		pcs-handle-names = "sgmii", "xfi";
 	};
 
 	mdio@e3000 {
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-0.dtsi
index a8cc9780c0c4..1089d6861bfb 100644
--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-0.dtsi
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-0.dtsi
@@ -51,7 +51,8 @@ ethernet@e0000 {
 		reg = <0xe0000 0x1000>;
 		fsl,fman-ports = <&fman0_rx_0x08 &fman0_tx_0x28>;
 		ptp-timer = <&ptp_timer0>;
-		pcsphy-handle = <&pcsphy0>;
+		pcsphy-handle = <&pcsphy0>, <&pcsphy0>;
+		pcs-handle-names = "sgmii", "qsgmii";
 	};
 
 	mdio@e1000 {
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-1.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-1.dtsi
index 8b8bd70c9382..a95bbb4fc827 100644
--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-1.dtsi
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-1.dtsi
@@ -51,7 +51,15 @@ ethernet@e2000 {
 		reg = <0xe2000 0x1000>;
 		fsl,fman-ports = <&fman0_rx_0x09 &fman0_tx_0x29>;
 		ptp-timer = <&ptp_timer0>;
-		pcsphy-handle = <&pcsphy1>;
+		pcsphy-handle = <&pcsphy1>, <&qsgmiia_pcs1>;
+		pcs-handle-names = "sgmii", "qsgmii";
+	};
+
+	mdio@e1000 {
+		qsgmiia_pcs1: ethernet-pcs@1 {
+			compatible = "fsl,lynx-pcs";
+			reg = <1>;
+		};
 	};
 
 	mdio@e3000 {
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-2.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-2.dtsi
index 619c880b54d8..7d5af0147a25 100644
--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-2.dtsi
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-2.dtsi
@@ -51,7 +51,15 @@ ethernet@e4000 {
 		reg = <0xe4000 0x1000>;
 		fsl,fman-ports = <&fman0_rx_0x0a &fman0_tx_0x2a>;
 		ptp-timer = <&ptp_timer0>;
-		pcsphy-handle = <&pcsphy2>;
+		pcsphy-handle = <&pcsphy2>, <&qsgmiia_pcs2>;
+		pcs-handle-names = "sgmii", "qsgmii";
+	};
+
+	mdio@e1000 {
+		qsgmiia_pcs2: ethernet-pcs@2 {
+			compatible = "fsl,lynx-pcs";
+			reg = <2>;
+		};
 	};
 
 	mdio@e5000 {
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-3.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-3.dtsi
index d7ebb73a400d..61e5466ec854 100644
--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-3.dtsi
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-3.dtsi
@@ -51,7 +51,15 @@ ethernet@e6000 {
 		reg = <0xe6000 0x1000>;
 		fsl,fman-ports = <&fman0_rx_0x0b &fman0_tx_0x2b>;
 		ptp-timer = <&ptp_timer0>;
-		pcsphy-handle = <&pcsphy3>;
+		pcsphy-handle = <&pcsphy3>, <&qsgmiia_pcs3>;
+		pcs-handle-names = "sgmii", "qsgmii";
+	};
+
+	mdio@e1000 {
+		qsgmiia_pcs3: ethernet-pcs@3 {
+			compatible = "fsl,lynx-pcs";
+			reg = <3>;
+		};
 	};
 
 	mdio@e7000 {
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-4.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-4.dtsi
index b151d696a069..3ba0cdafc069 100644
--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-4.dtsi
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-4.dtsi
@@ -51,7 +51,8 @@ ethernet@e8000 {
 		reg = <0xe8000 0x1000>;
 		fsl,fman-ports = <&fman0_rx_0x0c &fman0_tx_0x2c>;
 		ptp-timer = <&ptp_timer0>;
-		pcsphy-handle = <&pcsphy4>;
+		pcsphy-handle = <&pcsphy4>, <&pcsphy4>;
+		pcs-handle-names = "sgmii", "qsgmii";
 	};
 
 	mdio@e9000 {
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-5.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-5.dtsi
index adc0ae0013a3..51748de0a289 100644
--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-5.dtsi
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-5.dtsi
@@ -51,7 +51,15 @@ ethernet@ea000 {
 		reg = <0xea000 0x1000>;
 		fsl,fman-ports = <&fman0_rx_0x0d &fman0_tx_0x2d>;
 		ptp-timer = <&ptp_timer0>;
-		pcsphy-handle = <&pcsphy5>;
+		pcsphy-handle = <&pcsphy5>, <&qsgmiib_pcs1>;
+		pcs-handle-names = "sgmii", "qsgmii";
+	};
+
+	mdio@e9000 {
+		qsgmiib_pcs1: ethernet-pcs@1 {
+			compatible = "fsl,lynx-pcs";
+			reg = <1>;
+		};
 	};
 
 	mdio@eb000 {
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-0.dtsi
index 435047e0e250..ee4f5170f632 100644
--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-0.dtsi
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-0.dtsi
@@ -52,7 +52,15 @@ ethernet@f0000 {
 		compatible = "fsl,fman-memac";
 		reg = <0xf0000 0x1000>;
 		fsl,fman-ports = <&fman1_rx_0x10 &fman1_tx_0x30>;
-		pcsphy-handle = <&pcsphy14>;
+		pcsphy-handle = <&pcsphy14>, <&qsgmiid_pcs2>, <&pcsphy14>;
+		pcs-handle-names = "sgmii", "qsgmii", "xfi";
+	};
+
+	mdio@e9000 {
+		qsgmiid_pcs2: ethernet-pcs@2 {
+			compatible = "fsl,lynx-pcs";
+			reg = <2>;
+		};
 	};
 
 	mdio@f1000 {
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-1.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-1.dtsi
index c098657cca0a..83d2e0ce8f7b 100644
--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-1.dtsi
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-1.dtsi
@@ -52,7 +52,15 @@ ethernet@f2000 {
 		compatible = "fsl,fman-memac";
 		reg = <0xf2000 0x1000>;
 		fsl,fman-ports = <&fman1_rx_0x11 &fman1_tx_0x31>;
-		pcsphy-handle = <&pcsphy15>;
+		pcsphy-handle = <&pcsphy15>, <&qsgmiid_pcs3>, <&pcsphy15>;
+		pcs-handle-names = "sgmii", "qsgmii", "xfi";
+	};
+
+	mdio@e9000 {
+		qsgmiid_pcs3: ethernet-pcs@3 {
+			compatible = "fsl,lynx-pcs";
+			reg = <3>;
+		};
 	};
 
 	mdio@f3000 {
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-0.dtsi
index 9d06824815f3..3132fc73f133 100644
--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-0.dtsi
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-0.dtsi
@@ -51,7 +51,8 @@ ethernet@e0000 {
 		reg = <0xe0000 0x1000>;
 		fsl,fman-ports = <&fman1_rx_0x08 &fman1_tx_0x28>;
 		ptp-timer = <&ptp_timer1>;
-		pcsphy-handle = <&pcsphy8>;
+		pcsphy-handle = <&pcsphy8>, <&pcsphy8>;
+		pcs-handle-names = "sgmii", "qsgmii";
 	};
 
 	mdio@e1000 {
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-1.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-1.dtsi
index 70e947730c4b..75e904d96602 100644
--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-1.dtsi
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-1.dtsi
@@ -51,7 +51,15 @@ ethernet@e2000 {
 		reg = <0xe2000 0x1000>;
 		fsl,fman-ports = <&fman1_rx_0x09 &fman1_tx_0x29>;
 		ptp-timer = <&ptp_timer1>;
-		pcsphy-handle = <&pcsphy9>;
+		pcsphy-handle = <&pcsphy9>, <&qsgmiic_pcs1>;
+		pcs-handle-names = "sgmii", "qsgmii";
+	};
+
+	mdio@e1000 {
+		qsgmiic_pcs1: ethernet-pcs@1 {
+			compatible = "fsl,lynx-pcs";
+			reg = <1>;
+		};
 	};
 
 	mdio@e3000 {
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-2.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-2.dtsi
index ad96e6529595..69f2cc7b8f19 100644
--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-2.dtsi
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-2.dtsi
@@ -51,7 +51,15 @@ ethernet@e4000 {
 		reg = <0xe4000 0x1000>;
 		fsl,fman-ports = <&fman1_rx_0x0a &fman1_tx_0x2a>;
 		ptp-timer = <&ptp_timer1>;
-		pcsphy-handle = <&pcsphy10>;
+		pcsphy-handle = <&pcsphy10>, <&qsgmiic_pcs2>;
+		pcs-handle-names = "sgmii", "qsgmii";
+	};
+
+	mdio@e1000 {
+		qsgmiic_pcs2: ethernet-pcs@2 {
+			compatible = "fsl,lynx-pcs";
+			reg = <2>;
+		};
 	};
 
 	mdio@e5000 {
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-3.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-3.dtsi
index 034bc4b71f7a..b3aaf01d7da0 100644
--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-3.dtsi
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-3.dtsi
@@ -51,7 +51,15 @@ ethernet@e6000 {
 		reg = <0xe6000 0x1000>;
 		fsl,fman-ports = <&fman1_rx_0x0b &fman1_tx_0x2b>;
 		ptp-timer = <&ptp_timer1>;
-		pcsphy-handle = <&pcsphy11>;
+		pcsphy-handle = <&pcsphy11>, <&qsgmiic_pcs3>;
+		pcs-handle-names = "sgmii", "qsgmii";
+	};
+
+	mdio@e1000 {
+		qsgmiic_pcs3: ethernet-pcs@3 {
+			compatible = "fsl,lynx-pcs";
+			reg = <3>;
+		};
 	};
 
 	mdio@e7000 {
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-4.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-4.dtsi
index 93ca23d82b39..18e020432807 100644
--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-4.dtsi
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-4.dtsi
@@ -51,7 +51,8 @@ ethernet@e8000 {
 		reg = <0xe8000 0x1000>;
 		fsl,fman-ports = <&fman1_rx_0x0c &fman1_tx_0x2c>;
 		ptp-timer = <&ptp_timer1>;
-		pcsphy-handle = <&pcsphy12>;
+		pcsphy-handle = <&pcsphy12>, <&pcsphy12>;
+		pcs-handle-names = "sgmii", "qsgmii";
 	};
 
 	mdio@e9000 {
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-5.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-5.dtsi
index 23b3117a2fd2..55f329d13f19 100644
--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-5.dtsi
+++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-5.dtsi
@@ -51,7 +51,15 @@ ethernet@ea000 {
 		reg = <0xea000 0x1000>;
 		fsl,fman-ports = <&fman1_rx_0x0d &fman1_tx_0x2d>;
 		ptp-timer = <&ptp_timer1>;
-		pcsphy-handle = <&pcsphy13>;
+		pcsphy-handle = <&pcsphy13>, <&qsgmiid_pcs1>;
+		pcs-handle-names = "sgmii", "qsgmii";
+	};
+
+	mdio@e9000 {
+		qsgmiid_pcs1: ethernet-pcs@1 {
+			compatible = "fsl,lynx-pcs";
+			reg = <1>;
+		};
 	};
 
 	mdio@eb000 {
-- 
2.35.1.1320.gc452695387.dirty


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

* [PATCH net-next v7 10/10] arm64: dts: layerscape: Add nodes for QSGMII PCSs
  2022-10-17 20:22 [PATCH net-next v7 00/10] net: dpaa: Convert to phylink Sean Anderson
                   ` (4 preceding siblings ...)
  2022-10-17 20:22 ` [PATCH net-next v7 09/10] powerpc: dts: qoriq: Add nodes for QSGMII PCSs Sean Anderson
@ 2022-10-17 20:22 ` Sean Anderson
  2022-10-19 13:00 ` [PATCH net-next v7 00/10] net: dpaa: Convert to phylink patchwork-bot+netdevbpf
  6 siblings, 0 replies; 12+ messages in thread
From: Sean Anderson @ 2022-10-17 20:22 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Madalin Bucur,
	Camelia Alexandra Groza, netdev
  Cc: Eric Dumazet, linuxppc-dev @ lists . ozlabs . org,
	linux-arm-kernel, linux-kernel, Russell King, Paolo Abeni,
	Sean Anderson, Benjamin Herrenschmidt, Krzysztof Kozlowski,
	Li Yang, Michael Ellerman, Paul Mackerras, Rob Herring, Shawn Guo,
	devicetree

Now that we actually read registers from QSGMII PCSs, it's important
that we have the correct address (instead of hoping that we're the MAC
with all the QSGMII PCSs on its bus). This adds nodes for the QSGMII
PCSs.  The exact mapping of QSGMII to MACs depends on the SoC.

Since the first QSGMII PCSs share an address with the SGMII and XFI
PCSs, we only add new nodes for PCSs 2-4. This avoids address conflicts
on the bus.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
---

(no changes since v3)

Changes in v3:
- Split this patch off from the previous one

Changes in v2:
- New

 .../boot/dts/freescale/fsl-ls1043-post.dtsi   | 24 ++++++++++++++++++
 .../boot/dts/freescale/fsl-ls1046-post.dtsi   | 25 +++++++++++++++++++
 2 files changed, 49 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1043-post.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1043-post.dtsi
index d237162a8744..5c4d7eef8b61 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1043-post.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1043-post.dtsi
@@ -24,9 +24,12 @@ &fman0 {
 
 	/* these aliases provide the FMan ports mapping */
 	enet0: ethernet@e0000 {
+		pcs-handle-names = "qsgmii";
 	};
 
 	enet1: ethernet@e2000 {
+		pcsphy-handle = <&pcsphy1>, <&qsgmiib_pcs1>;
+		pcs-handle-names = "sgmii", "qsgmii";
 	};
 
 	enet2: ethernet@e4000 {
@@ -36,11 +39,32 @@ enet3: ethernet@e6000 {
 	};
 
 	enet4: ethernet@e8000 {
+		pcsphy-handle = <&pcsphy4>, <&qsgmiib_pcs2>;
+		pcs-handle-names = "sgmii", "qsgmii";
 	};
 
 	enet5: ethernet@ea000 {
+		pcsphy-handle = <&pcsphy5>, <&qsgmiib_pcs3>;
+		pcs-handle-names = "sgmii", "qsgmii";
 	};
 
 	enet6: ethernet@f0000 {
 	};
+
+	mdio@e1000 {
+		qsgmiib_pcs1: ethernet-pcs@1 {
+			compatible = "fsl,lynx-pcs";
+			reg = <0x1>;
+		};
+
+		qsgmiib_pcs2: ethernet-pcs@2 {
+			compatible = "fsl,lynx-pcs";
+			reg = <0x2>;
+		};
+
+		qsgmiib_pcs3: ethernet-pcs@3 {
+			compatible = "fsl,lynx-pcs";
+			reg = <0x3>;
+		};
+	};
 };
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1046-post.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1046-post.dtsi
index d6caaea57d90..4e3345093943 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1046-post.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1046-post.dtsi
@@ -23,6 +23,8 @@ &soc {
 &fman0 {
 	/* these aliases provide the FMan ports mapping */
 	enet0: ethernet@e0000 {
+		pcsphy-handle = <&qsgmiib_pcs3>;
+		pcs-handle-names = "qsgmii";
 	};
 
 	enet1: ethernet@e2000 {
@@ -35,14 +37,37 @@ enet3: ethernet@e6000 {
 	};
 
 	enet4: ethernet@e8000 {
+		pcsphy-handle = <&pcsphy4>, <&qsgmiib_pcs1>;
+		pcs-handle-names = "sgmii", "qsgmii";
 	};
 
 	enet5: ethernet@ea000 {
+		pcsphy-handle = <&pcsphy5>, <&pcsphy5>;
+		pcs-handle-names = "sgmii", "qsgmii";
 	};
 
 	enet6: ethernet@f0000 {
 	};
 
 	enet7: ethernet@f2000 {
+		pcsphy-handle = <&pcsphy7>, <&qsgmiib_pcs2>, <&pcsphy7>;
+		pcs-handle-names = "sgmii", "qsgmii", "xfi";
+	};
+
+	mdio@eb000 {
+		qsgmiib_pcs1: ethernet-pcs@1 {
+			compatible = "fsl,lynx-pcs";
+			reg = <0x1>;
+		};
+
+		qsgmiib_pcs2: ethernet-pcs@2 {
+			compatible = "fsl,lynx-pcs";
+			reg = <0x2>;
+		};
+
+		qsgmiib_pcs3: ethernet-pcs@3 {
+			compatible = "fsl,lynx-pcs";
+			reg = <0x3>;
+		};
 	};
 };
-- 
2.35.1.1320.gc452695387.dirty


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

* Re: [PATCH net-next v7 00/10] net: dpaa: Convert to phylink
  2022-10-17 20:22 [PATCH net-next v7 00/10] net: dpaa: Convert to phylink Sean Anderson
                   ` (5 preceding siblings ...)
  2022-10-17 20:22 ` [PATCH net-next v7 10/10] arm64: dts: layerscape: " Sean Anderson
@ 2022-10-19 13:00 ` patchwork-bot+netdevbpf
  6 siblings, 0 replies; 12+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-10-19 13:00 UTC (permalink / raw)
  To: Sean Anderson
  Cc: davem, kuba, madalin.bucur, camelia.groza, netdev, edumazet,
	linuxppc-dev, linux-arm-kernel, linux-kernel, linux, pabeni, benh,
	ioana.ciornei, krzysztof.kozlowski+dt, leoyang.li, mpe, paulus,
	robh+dt, shawnguo, devicetree

Hello:

This series was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Mon, 17 Oct 2022 16:22:31 -0400 you wrote:
> This series converts the DPAA driver to phylink.
> 
> I have tried to maintain backwards compatibility with existing device
> trees whereever possible. However, one area where I was unable to
> achieve this was with QSGMII. Please refer to patch 2 for details.
> 
> All mac drivers have now been converted. I would greatly appreciate if
> anyone has T-series or P-series boards they can test/debug this series
> on. I only have an LS1046ARDB. Everything but QSGMII should work without
> breakage; QSGMII needs patches 7 and 8. For this reason, the last 4
> patches in this series should be applied together (and should not go
> through separate trees).
> 
> [...]

Here is the summary with links:
  - [net-next,v7,01/10] dt-bindings: net: Expand pcs-handle to an array
    https://git.kernel.org/netdev/net-next/c/76025ee53b7d
  - [net-next,v7,02/10] dt-bindings: net: Add Lynx PCS binding
    https://git.kernel.org/netdev/net-next/c/00af103d06b3
  - [net-next,v7,03/10] dt-bindings: net: fman: Add additional interface properties
    https://git.kernel.org/netdev/net-next/c/045d05018a2d
  - [net-next,v7,04/10] net: phylink: provide phylink_validate_mask_caps() helper
    (no matching commit)
  - [net-next,v7,05/10] net: fman: memac: Add serdes support
    https://git.kernel.org/netdev/net-next/c/0fc83bd79589
  - [net-next,v7,06/10] net: fman: memac: Use lynx pcs driver
    https://git.kernel.org/netdev/net-next/c/a7c2a32e7f22
  - [net-next,v7,07/10] net: dpaa: Convert to phylink
    (no matching commit)
  - [net-next,v7,08/10] powerpc: dts: t208x: Mark MAC1 and MAC2 as 10G
    https://git.kernel.org/netdev/net-next/c/36926a7d70c2
  - [net-next,v7,09/10] powerpc: dts: qoriq: Add nodes for QSGMII PCSs
    https://git.kernel.org/netdev/net-next/c/4e31b808fad1
  - [net-next,v7,10/10] arm64: dts: layerscape: Add nodes for QSGMII PCSs
    https://git.kernel.org/netdev/net-next/c/4e748b1bd7c0

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

* RE: [PATCH net-next v7 08/10] powerpc: dts: t208x: Mark MAC1 and MAC2 as 10G
  2022-10-17 20:22 ` [PATCH net-next v7 08/10] powerpc: dts: t208x: Mark MAC1 and MAC2 as 10G Sean Anderson
@ 2022-10-28 16:30   ` Camelia Alexandra Groza
  2022-10-28 16:54     ` Sean Anderson
  0 siblings, 1 reply; 12+ messages in thread
From: Camelia Alexandra Groza @ 2022-10-28 16:30 UTC (permalink / raw)
  To: Sean Anderson, David S . Miller, Jakub Kicinski, Madalin Bucur,
	netdev@vger.kernel.org
  Cc: Eric Dumazet, linuxppc-dev @ lists . ozlabs . org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Russell King, Paolo Abeni,
	Sean Anderson, Benjamin Herrenschmidt, Krzysztof Kozlowski,
	Leo Li, Michael Ellerman, Paul Mackerras, Rob Herring,
	devicetree@vger.kernel.org

> -----Original Message-----
> From: Sean Anderson <sean.anderson@seco.com>
> Sent: Monday, October 17, 2022 23:23
> To: David S . Miller <davem@davemloft.net>; Jakub Kicinski
> <kuba@kernel.org>; Madalin Bucur <madalin.bucur@nxp.com>; Camelia
> Alexandra Groza <camelia.groza@nxp.com>; netdev@vger.kernel.org
> Cc: Eric Dumazet <edumazet@google.com>; linuxppc-dev @ lists . ozlabs .
> org <linuxppc-dev@lists.ozlabs.org>; linux-arm-kernel@lists.infradead.org;
> linux-kernel@vger.kernel.org; Russell King <linux@armlinux.org.uk>; Paolo
> Abeni <pabeni@redhat.com>; Sean Anderson <sean.anderson@seco.com>;
> Benjamin Herrenschmidt <benh@kernel.crashing.org>; Krzysztof Kozlowski
> <krzysztof.kozlowski+dt@linaro.org>; Leo Li <leoyang.li@nxp.com>; Michael
> Ellerman <mpe@ellerman.id.au>; Paul Mackerras <paulus@samba.org>; Rob
> Herring <robh+dt@kernel.org>; devicetree@vger.kernel.org
> Subject: [PATCH net-next v7 08/10] powerpc: dts: t208x: Mark MAC1 and
> MAC2 as 10G
> 
> On the T208X SoCs, MAC1 and MAC2 support XGMII. Add some new MAC
> dtsi
> fragments, and mark the QMAN ports as 10G.
> 
> Fixes: da414bb923d9 ("powerpc/mpc85xx: Add FSL QorIQ DPAA FMan
> support to the SoC device tree(s)")
> Signed-off-by: Sean Anderson <sean.anderson@seco.com>
> ---
> 
> (no changes since v4)
> 
> Changes in v4:
> - New

Hi Sean,

These changes prevent MAC2 from probing on T2080RDB due to insufficient FMan hardware resources.

fsl-fman ffe400000.fman: set_num_of_tasks: Requested num_of_tasks and extra tasks pool for fm0 exceed total num_of_tasks.
fsl_dpa: dpaa_eth_init_tx_port: fm_port_init failed
fsl_dpa: probe of dpaa-ethernet.5 failed with error -11

The distribution of resources depends on the port type, and different FMan hardware revisions have different amounts of resources.

The current distribution of resources can be reconsidered, but this change should be reverted for now.

Regards,
Camelia


>  .../boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi     | 44 +++++++++++++++++++
>  .../boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi     | 44 +++++++++++++++++++
>  arch/powerpc/boot/dts/fsl/t2081si-post.dtsi   |  4 +-
>  3 files changed, 90 insertions(+), 2 deletions(-)
>  create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi
>  create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi
> 
> diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi
> b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi
> new file mode 100644
> index 000000000000..437dab3fc017
> --- /dev/null
> +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi
> @@ -0,0 +1,44 @@
> +// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later
> +/*
> + * QorIQ FMan v3 10g port #2 device tree stub [ controller @ offset
> 0x400000 ]
> + *
> + * Copyright 2022 Sean Anderson <sean.anderson@seco.com>
> + * Copyright 2012 - 2015 Freescale Semiconductor Inc.
> + */
> +
> +fman@400000 {
> +	fman0_rx_0x08: port@88000 {
> +		cell-index = <0x8>;
> +		compatible = "fsl,fman-v3-port-rx";
> +		reg = <0x88000 0x1000>;
> +		fsl,fman-10g-port;
> +	};
> +
> +	fman0_tx_0x28: port@a8000 {
> +		cell-index = <0x28>;
> +		compatible = "fsl,fman-v3-port-tx";
> +		reg = <0xa8000 0x1000>;
> +		fsl,fman-10g-port;
> +	};
> +
> +	ethernet@e0000 {
> +		cell-index = <0>;
> +		compatible = "fsl,fman-memac";
> +		reg = <0xe0000 0x1000>;
> +		fsl,fman-ports = <&fman0_rx_0x08 &fman0_tx_0x28>;
> +		ptp-timer = <&ptp_timer0>;
> +		pcsphy-handle = <&pcsphy0>;
> +	};
> +
> +	mdio@e1000 {
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +		compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
> +		reg = <0xe1000 0x1000>;
> +		fsl,erratum-a011043; /* must ignore read errors */
> +
> +		pcsphy0: ethernet-phy@0 {
> +			reg = <0x0>;
> +		};
> +	};
> +};
> diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi
> b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi
> new file mode 100644
> index 000000000000..ad116b17850a
> --- /dev/null
> +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi
> @@ -0,0 +1,44 @@
> +// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later
> +/*
> + * QorIQ FMan v3 10g port #3 device tree stub [ controller @ offset
> 0x400000 ]
> + *
> + * Copyright 2022 Sean Anderson <sean.anderson@seco.com>
> + * Copyright 2012 - 2015 Freescale Semiconductor Inc.
> + */
> +
> +fman@400000 {
> +	fman0_rx_0x09: port@89000 {
> +		cell-index = <0x9>;
> +		compatible = "fsl,fman-v3-port-rx";
> +		reg = <0x89000 0x1000>;
> +		fsl,fman-10g-port;
> +	};
> +
> +	fman0_tx_0x29: port@a9000 {
> +		cell-index = <0x29>;
> +		compatible = "fsl,fman-v3-port-tx";
> +		reg = <0xa9000 0x1000>;
> +		fsl,fman-10g-port;
> +	};
> +
> +	ethernet@e2000 {
> +		cell-index = <1>;
> +		compatible = "fsl,fman-memac";
> +		reg = <0xe2000 0x1000>;
> +		fsl,fman-ports = <&fman0_rx_0x09 &fman0_tx_0x29>;
> +		ptp-timer = <&ptp_timer0>;
> +		pcsphy-handle = <&pcsphy1>;
> +	};
> +
> +	mdio@e3000 {
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +		compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
> +		reg = <0xe3000 0x1000>;
> +		fsl,erratum-a011043; /* must ignore read errors */
> +
> +		pcsphy1: ethernet-phy@0 {
> +			reg = <0x0>;
> +		};
> +	};
> +};
> diff --git a/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
> b/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
> index ecbb447920bc..74e17e134387 100644
> --- a/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
> +++ b/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
> @@ -609,8 +609,8 @@ usb1: usb@211000 {
>  /include/ "qoriq-bman1.dtsi"
> 
>  /include/ "qoriq-fman3-0.dtsi"
> -/include/ "qoriq-fman3-0-1g-0.dtsi"
> -/include/ "qoriq-fman3-0-1g-1.dtsi"
> +/include/ "qoriq-fman3-0-10g-2.dtsi"
> +/include/ "qoriq-fman3-0-10g-3.dtsi"
>  /include/ "qoriq-fman3-0-1g-2.dtsi"
>  /include/ "qoriq-fman3-0-1g-3.dtsi"
>  /include/ "qoriq-fman3-0-1g-4.dtsi"
> --
> 2.35.1.1320.gc452695387.dirty


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

* Re: [PATCH net-next v7 08/10] powerpc: dts: t208x: Mark MAC1 and MAC2 as 10G
  2022-10-28 16:30   ` Camelia Alexandra Groza
@ 2022-10-28 16:54     ` Sean Anderson
  2022-10-31 14:12       ` Camelia Alexandra Groza
  0 siblings, 1 reply; 12+ messages in thread
From: Sean Anderson @ 2022-10-28 16:54 UTC (permalink / raw)
  To: Camelia Alexandra Groza, Sean Anderson, David S . Miller,
	Jakub Kicinski, Madalin Bucur, netdev@vger.kernel.org
  Cc: Eric Dumazet, linuxppc-dev @ lists . ozlabs . org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Russell King, Paolo Abeni,
	Benjamin Herrenschmidt, Krzysztof Kozlowski, Leo Li,
	Michael Ellerman, Paul Mackerras, Rob Herring,
	devicetree@vger.kernel.org

On 10/28/22 12:30, Camelia Alexandra Groza wrote:
>> -----Original Message-----
>> From: Sean Anderson <sean.anderson@seco.com>
>> Sent: Monday, October 17, 2022 23:23
>> To: David S . Miller <davem@davemloft.net>; Jakub Kicinski
>> <kuba@kernel.org>; Madalin Bucur <madalin.bucur@nxp.com>; Camelia
>> Alexandra Groza <camelia.groza@nxp.com>; netdev@vger.kernel.org
>> Cc: Eric Dumazet <edumazet@google.com>; linuxppc-dev @ lists . ozlabs .
>> org <linuxppc-dev@lists.ozlabs.org>; linux-arm-kernel@lists.infradead.org;
>> linux-kernel@vger.kernel.org; Russell King <linux@armlinux.org.uk>; Paolo
>> Abeni <pabeni@redhat.com>; Sean Anderson <sean.anderson@seco.com>;
>> Benjamin Herrenschmidt <benh@kernel.crashing.org>; Krzysztof Kozlowski
>> <krzysztof.kozlowski+dt@linaro.org>; Leo Li <leoyang.li@nxp.com>; Michael
>> Ellerman <mpe@ellerman.id.au>; Paul Mackerras <paulus@samba.org>; Rob
>> Herring <robh+dt@kernel.org>; devicetree@vger.kernel.org
>> Subject: [PATCH net-next v7 08/10] powerpc: dts: t208x: Mark MAC1 and
>> MAC2 as 10G
>>
>> On the T208X SoCs, MAC1 and MAC2 support XGMII. Add some new MAC
>> dtsi
>> fragments, and mark the QMAN ports as 10G.
>>
>> Fixes: da414bb923d9 ("powerpc/mpc85xx: Add FSL QorIQ DPAA FMan
>> support to the SoC device tree(s)")
>> Signed-off-by: Sean Anderson <sean.anderson@seco.com>
>> ---
>>
>> (no changes since v4)
>>
>> Changes in v4:
>> - New
> 
> Hi Sean,
> 
> These changes prevent MAC2 from probing on T2080RDB due to insufficient FMan hardware resources.
> 
> fsl-fman ffe400000.fman: set_num_of_tasks: Requested num_of_tasks and extra tasks pool for fm0 exceed total num_of_tasks.
> fsl_dpa: dpaa_eth_init_tx_port: fm_port_init failed
> fsl_dpa: probe of dpaa-ethernet.5 failed with error -11
> 
> The distribution of resources depends on the port type, and different FMan hardware revisions have different amounts of resources.
> 
> The current distribution of resources can be reconsidered, but this change should be reverted for now.

OK, so this patch does two things:

@@ -37,12 +11,14 @@
  		cell-index = <0x8>;
  		compatible = "fsl,fman-v3-port-rx";
  		reg = <0x88000 0x1000>;
+		fsl,fman-10g-port;
  	};
  
  	fman0_tx_0x28: port@a8000 {
  		cell-index = <0x28>;
  		compatible = "fsl,fman-v3-port-tx";
  		reg = <0xa8000 0x1000>;
+		fsl,fman-10g-port;
  	};
  
  	ethernet@e0000 {
@@ -52,7 +28,7 @@
  		fsl,fman-ports = <&fman0_rx_0x08 &fman0_tx_0x28>;
  		ptp-timer = <&ptp_timer0>;
  		pcsphy-handle = <&pcsphy0>, <&pcsphy0>;
-		pcs-handle-names = "sgmii", "qsgmii";
+		pcs-handle-names = "sgmii", "xfi";
  	};
  
  	mdio@e1000 {

First, it marks the ports as 10g. I believe this is what's causing the
resource problems above. Second, it removes support for QSGMII and adds
support for XFI. This is a matter of correctness; these MACs really
don't support QSGMII, and do support XFI. As I understand it, you can
run a 10g port at 1g speeds, it just won't perform as well. So I think a
more minimal revert would be to delete the fsl,fman-10g-port properties
in t2081si-post.dtsi.

That said, is 10g even being used on these ports? I included this patch
in order to avoid breaking any existing users.

--Sean

> Regards,
> Camelia
> 
> 
>>   .../boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi     | 44 +++++++++++++++++++
>>   .../boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi     | 44 +++++++++++++++++++
>>   arch/powerpc/boot/dts/fsl/t2081si-post.dtsi   |  4 +-
>>   3 files changed, 90 insertions(+), 2 deletions(-)
>>   create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi
>>   create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi
>>
>> diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi
>> b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi
>> new file mode 100644
>> index 000000000000..437dab3fc017
>> --- /dev/null
>> +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi
>> @@ -0,0 +1,44 @@
>> +// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later
>> +/*
>> + * QorIQ FMan v3 10g port #2 device tree stub [ controller @ offset
>> 0x400000 ]
>> + *
>> + * Copyright 2022 Sean Anderson <sean.anderson@seco.com>
>> + * Copyright 2012 - 2015 Freescale Semiconductor Inc.
>> + */
>> +
>> +fman@400000 {
>> +	fman0_rx_0x08: port@88000 {
>> +		cell-index = <0x8>;
>> +		compatible = "fsl,fman-v3-port-rx";
>> +		reg = <0x88000 0x1000>;
>> +		fsl,fman-10g-port;
>> +	};
>> +
>> +	fman0_tx_0x28: port@a8000 {
>> +		cell-index = <0x28>;
>> +		compatible = "fsl,fman-v3-port-tx";
>> +		reg = <0xa8000 0x1000>;
>> +		fsl,fman-10g-port;
>> +	};
>> +
>> +	ethernet@e0000 {
>> +		cell-index = <0>;
>> +		compatible = "fsl,fman-memac";
>> +		reg = <0xe0000 0x1000>;
>> +		fsl,fman-ports = <&fman0_rx_0x08 &fman0_tx_0x28>;
>> +		ptp-timer = <&ptp_timer0>;
>> +		pcsphy-handle = <&pcsphy0>;
>> +	};
>> +
>> +	mdio@e1000 {
>> +		#address-cells = <1>;
>> +		#size-cells = <0>;
>> +		compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
>> +		reg = <0xe1000 0x1000>;
>> +		fsl,erratum-a011043; /* must ignore read errors */
>> +
>> +		pcsphy0: ethernet-phy@0 {
>> +			reg = <0x0>;
>> +		};
>> +	};
>> +};
>> diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi
>> b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi
>> new file mode 100644
>> index 000000000000..ad116b17850a
>> --- /dev/null
>> +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi
>> @@ -0,0 +1,44 @@
>> +// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later
>> +/*
>> + * QorIQ FMan v3 10g port #3 device tree stub [ controller @ offset
>> 0x400000 ]
>> + *
>> + * Copyright 2022 Sean Anderson <sean.anderson@seco.com>
>> + * Copyright 2012 - 2015 Freescale Semiconductor Inc.
>> + */
>> +
>> +fman@400000 {
>> +	fman0_rx_0x09: port@89000 {
>> +		cell-index = <0x9>;
>> +		compatible = "fsl,fman-v3-port-rx";
>> +		reg = <0x89000 0x1000>;
>> +		fsl,fman-10g-port;
>> +	};
>> +
>> +	fman0_tx_0x29: port@a9000 {
>> +		cell-index = <0x29>;
>> +		compatible = "fsl,fman-v3-port-tx";
>> +		reg = <0xa9000 0x1000>;
>> +		fsl,fman-10g-port;
>> +	};
>> +
>> +	ethernet@e2000 {
>> +		cell-index = <1>;
>> +		compatible = "fsl,fman-memac";
>> +		reg = <0xe2000 0x1000>;
>> +		fsl,fman-ports = <&fman0_rx_0x09 &fman0_tx_0x29>;
>> +		ptp-timer = <&ptp_timer0>;
>> +		pcsphy-handle = <&pcsphy1>;
>> +	};
>> +
>> +	mdio@e3000 {
>> +		#address-cells = <1>;
>> +		#size-cells = <0>;
>> +		compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
>> +		reg = <0xe3000 0x1000>;
>> +		fsl,erratum-a011043; /* must ignore read errors */
>> +
>> +		pcsphy1: ethernet-phy@0 {
>> +			reg = <0x0>;
>> +		};
>> +	};
>> +};
>> diff --git a/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
>> b/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
>> index ecbb447920bc..74e17e134387 100644
>> --- a/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
>> +++ b/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
>> @@ -609,8 +609,8 @@ usb1: usb@211000 {
>>   /include/ "qoriq-bman1.dtsi"
>>
>>   /include/ "qoriq-fman3-0.dtsi"
>> -/include/ "qoriq-fman3-0-1g-0.dtsi"
>> -/include/ "qoriq-fman3-0-1g-1.dtsi"
>> +/include/ "qoriq-fman3-0-10g-2.dtsi"
>> +/include/ "qoriq-fman3-0-10g-3.dtsi"
>>   /include/ "qoriq-fman3-0-1g-2.dtsi"
>>   /include/ "qoriq-fman3-0-1g-3.dtsi"
>>   /include/ "qoriq-fman3-0-1g-4.dtsi"
>> --
>> 2.35.1.1320.gc452695387.dirty
> 


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

* RE: [PATCH net-next v7 08/10] powerpc: dts: t208x: Mark MAC1 and MAC2 as 10G
  2022-10-28 16:54     ` Sean Anderson
@ 2022-10-31 14:12       ` Camelia Alexandra Groza
  2022-10-31 22:19         ` Sean Anderson
  0 siblings, 1 reply; 12+ messages in thread
From: Camelia Alexandra Groza @ 2022-10-31 14:12 UTC (permalink / raw)
  To: Sean Anderson, Sean Anderson, David S . Miller, Jakub Kicinski,
	Madalin Bucur, netdev@vger.kernel.org
  Cc: Eric Dumazet, linuxppc-dev @ lists . ozlabs . org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Russell King, Paolo Abeni,
	Benjamin Herrenschmidt, Krzysztof Kozlowski, Leo Li,
	Michael Ellerman, Paul Mackerras, Rob Herring,
	devicetree@vger.kernel.org

> -----Original Message-----
> From: Sean Anderson <sean.anderson@seco.com>
> Sent: Friday, October 28, 2022 19:55
> To: Camelia Alexandra Groza <camelia.groza@nxp.com>; Sean Anderson
> <sean.anderson@seco.com>; David S . Miller <davem@davemloft.net>;
> Jakub Kicinski <kuba@kernel.org>; Madalin Bucur
> <madalin.bucur@nxp.com>; netdev@vger.kernel.org
> Cc: Eric Dumazet <edumazet@google.com>; linuxppc-dev @ lists . ozlabs .
> org <linuxppc-dev@lists.ozlabs.org>; linux-arm-kernel@lists.infradead.org;
> linux-kernel@vger.kernel.org; Russell King <linux@armlinux.org.uk>; Paolo
> Abeni <pabeni@redhat.com>; Benjamin Herrenschmidt
> <benh@kernel.crashing.org>; Krzysztof Kozlowski
> <krzysztof.kozlowski+dt@linaro.org>; Leo Li <leoyang.li@nxp.com>; Michael
> Ellerman <mpe@ellerman.id.au>; Paul Mackerras <paulus@samba.org>; Rob
> Herring <robh+dt@kernel.org>; devicetree@vger.kernel.org
> Subject: Re: [PATCH net-next v7 08/10] powerpc: dts: t208x: Mark MAC1 and
> MAC2 as 10G
> 
> On 10/28/22 12:30, Camelia Alexandra Groza wrote:
> >> -----Original Message-----
> >> From: Sean Anderson <sean.anderson@seco.com>
> >> Sent: Monday, October 17, 2022 23:23
> >> To: David S . Miller <davem@davemloft.net>; Jakub Kicinski
> >> <kuba@kernel.org>; Madalin Bucur <madalin.bucur@nxp.com>; Camelia
> >> Alexandra Groza <camelia.groza@nxp.com>; netdev@vger.kernel.org
> >> Cc: Eric Dumazet <edumazet@google.com>; linuxppc-dev @ lists . ozlabs .
> >> org <linuxppc-dev@lists.ozlabs.org>; linux-arm-
> kernel@lists.infradead.org;
> >> linux-kernel@vger.kernel.org; Russell King <linux@armlinux.org.uk>;
> Paolo
> >> Abeni <pabeni@redhat.com>; Sean Anderson
> <sean.anderson@seco.com>;
> >> Benjamin Herrenschmidt <benh@kernel.crashing.org>; Krzysztof
> Kozlowski
> >> <krzysztof.kozlowski+dt@linaro.org>; Leo Li <leoyang.li@nxp.com>;
> Michael
> >> Ellerman <mpe@ellerman.id.au>; Paul Mackerras <paulus@samba.org>;
> Rob
> >> Herring <robh+dt@kernel.org>; devicetree@vger.kernel.org
> >> Subject: [PATCH net-next v7 08/10] powerpc: dts: t208x: Mark MAC1 and
> >> MAC2 as 10G
> >>
> >> On the T208X SoCs, MAC1 and MAC2 support XGMII. Add some new MAC
> >> dtsi
> >> fragments, and mark the QMAN ports as 10G.
> >>
> >> Fixes: da414bb923d9 ("powerpc/mpc85xx: Add FSL QorIQ DPAA FMan
> >> support to the SoC device tree(s)")
> >> Signed-off-by: Sean Anderson <sean.anderson@seco.com>
> >> ---
> >>
> >> (no changes since v4)
> >>
> >> Changes in v4:
> >> - New
> >
> > Hi Sean,
> >
> > These changes prevent MAC2 from probing on T2080RDB due to
> insufficient FMan hardware resources.
> >
> > fsl-fman ffe400000.fman: set_num_of_tasks: Requested num_of_tasks
> and extra tasks pool for fm0 exceed total num_of_tasks.
> > fsl_dpa: dpaa_eth_init_tx_port: fm_port_init failed
> > fsl_dpa: probe of dpaa-ethernet.5 failed with error -11
> >
> > The distribution of resources depends on the port type, and different
> FMan hardware revisions have different amounts of resources.
> >
> > The current distribution of resources can be reconsidered, but this change
> should be reverted for now.
> 
> OK, so this patch does two things:
> 
> @@ -37,12 +11,14 @@
>   		cell-index = <0x8>;
>   		compatible = "fsl,fman-v3-port-rx";
>   		reg = <0x88000 0x1000>;
> +		fsl,fman-10g-port;
>   	};
> 
>   	fman0_tx_0x28: port@a8000 {
>   		cell-index = <0x28>;
>   		compatible = "fsl,fman-v3-port-tx";
>   		reg = <0xa8000 0x1000>;
> +		fsl,fman-10g-port;
>   	};
> 
>   	ethernet@e0000 {
> @@ -52,7 +28,7 @@
>   		fsl,fman-ports = <&fman0_rx_0x08 &fman0_tx_0x28>;
>   		ptp-timer = <&ptp_timer0>;
>   		pcsphy-handle = <&pcsphy0>, <&pcsphy0>;
> -		pcs-handle-names = "sgmii", "qsgmii";
> +		pcs-handle-names = "sgmii", "xfi";
>   	};
> 
>   	mdio@e1000 {
> 
> First, it marks the ports as 10g. I believe this is what's causing the
> resource problems above.

That's right.

> Second, it removes support for QSGMII and adds
> support for XFI. This is a matter of correctness; these MACs really
> don't support QSGMII, and do support XFI.

Correct, these MACs don't support QSGMII on this SoC.

> As I understand it, you can
> run a 10g port at 1g speeds, it just won't perform as well. So I think a
> more minimal revert would be to delete the fsl,fman-10g-port properties
> in t2081si-post.dtsi.

Since these two new dtsi files are included by only one SoC, I don't see an
advantage in adding these properties and then deleting them. No other
users benefit from adding them in the first place. 

> That said, is 10g even being used on these ports? I included this patch
> in order to avoid breaking any existing users.

It is used, though less efficiently, with fewer FMan hardware resources.

Camelia

> --Sean
> 
> > Regards,
> > Camelia
> >
> >
> >>   .../boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi     | 44 +++++++++++++++++++
> >>   .../boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi     | 44 +++++++++++++++++++
> >>   arch/powerpc/boot/dts/fsl/t2081si-post.dtsi   |  4 +-
> >>   3 files changed, 90 insertions(+), 2 deletions(-)
> >>   create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-
> 2.dtsi
> >>   create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-
> 3.dtsi
> >>
> >> diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi
> >> b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi
> >> new file mode 100644
> >> index 000000000000..437dab3fc017
> >> --- /dev/null
> >> +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi
> >> @@ -0,0 +1,44 @@
> >> +// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later
> >> +/*
> >> + * QorIQ FMan v3 10g port #2 device tree stub [ controller @ offset
> >> 0x400000 ]
> >> + *
> >> + * Copyright 2022 Sean Anderson <sean.anderson@seco.com>
> >> + * Copyright 2012 - 2015 Freescale Semiconductor Inc.
> >> + */
> >> +
> >> +fman@400000 {
> >> +	fman0_rx_0x08: port@88000 {
> >> +		cell-index = <0x8>;
> >> +		compatible = "fsl,fman-v3-port-rx";
> >> +		reg = <0x88000 0x1000>;
> >> +		fsl,fman-10g-port;
> >> +	};
> >> +
> >> +	fman0_tx_0x28: port@a8000 {
> >> +		cell-index = <0x28>;
> >> +		compatible = "fsl,fman-v3-port-tx";
> >> +		reg = <0xa8000 0x1000>;
> >> +		fsl,fman-10g-port;
> >> +	};
> >> +
> >> +	ethernet@e0000 {
> >> +		cell-index = <0>;
> >> +		compatible = "fsl,fman-memac";
> >> +		reg = <0xe0000 0x1000>;
> >> +		fsl,fman-ports = <&fman0_rx_0x08 &fman0_tx_0x28>;
> >> +		ptp-timer = <&ptp_timer0>;
> >> +		pcsphy-handle = <&pcsphy0>;
> >> +	};
> >> +
> >> +	mdio@e1000 {
> >> +		#address-cells = <1>;
> >> +		#size-cells = <0>;
> >> +		compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
> >> +		reg = <0xe1000 0x1000>;
> >> +		fsl,erratum-a011043; /* must ignore read errors */
> >> +
> >> +		pcsphy0: ethernet-phy@0 {
> >> +			reg = <0x0>;
> >> +		};
> >> +	};
> >> +};
> >> diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi
> >> b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi
> >> new file mode 100644
> >> index 000000000000..ad116b17850a
> >> --- /dev/null
> >> +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi
> >> @@ -0,0 +1,44 @@
> >> +// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later
> >> +/*
> >> + * QorIQ FMan v3 10g port #3 device tree stub [ controller @ offset
> >> 0x400000 ]
> >> + *
> >> + * Copyright 2022 Sean Anderson <sean.anderson@seco.com>
> >> + * Copyright 2012 - 2015 Freescale Semiconductor Inc.
> >> + */
> >> +
> >> +fman@400000 {
> >> +	fman0_rx_0x09: port@89000 {
> >> +		cell-index = <0x9>;
> >> +		compatible = "fsl,fman-v3-port-rx";
> >> +		reg = <0x89000 0x1000>;
> >> +		fsl,fman-10g-port;
> >> +	};
> >> +
> >> +	fman0_tx_0x29: port@a9000 {
> >> +		cell-index = <0x29>;
> >> +		compatible = "fsl,fman-v3-port-tx";
> >> +		reg = <0xa9000 0x1000>;
> >> +		fsl,fman-10g-port;
> >> +	};
> >> +
> >> +	ethernet@e2000 {
> >> +		cell-index = <1>;
> >> +		compatible = "fsl,fman-memac";
> >> +		reg = <0xe2000 0x1000>;
> >> +		fsl,fman-ports = <&fman0_rx_0x09 &fman0_tx_0x29>;
> >> +		ptp-timer = <&ptp_timer0>;
> >> +		pcsphy-handle = <&pcsphy1>;
> >> +	};
> >> +
> >> +	mdio@e3000 {
> >> +		#address-cells = <1>;
> >> +		#size-cells = <0>;
> >> +		compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
> >> +		reg = <0xe3000 0x1000>;
> >> +		fsl,erratum-a011043; /* must ignore read errors */
> >> +
> >> +		pcsphy1: ethernet-phy@0 {
> >> +			reg = <0x0>;
> >> +		};
> >> +	};
> >> +};
> >> diff --git a/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
> >> b/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
> >> index ecbb447920bc..74e17e134387 100644
> >> --- a/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
> >> +++ b/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
> >> @@ -609,8 +609,8 @@ usb1: usb@211000 {
> >>   /include/ "qoriq-bman1.dtsi"
> >>
> >>   /include/ "qoriq-fman3-0.dtsi"
> >> -/include/ "qoriq-fman3-0-1g-0.dtsi"
> >> -/include/ "qoriq-fman3-0-1g-1.dtsi"
> >> +/include/ "qoriq-fman3-0-10g-2.dtsi"
> >> +/include/ "qoriq-fman3-0-10g-3.dtsi"
> >>   /include/ "qoriq-fman3-0-1g-2.dtsi"
> >>   /include/ "qoriq-fman3-0-1g-3.dtsi"
> >>   /include/ "qoriq-fman3-0-1g-4.dtsi"
> >> --
> >> 2.35.1.1320.gc452695387.dirty
> >


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

* Re: [PATCH net-next v7 08/10] powerpc: dts: t208x: Mark MAC1 and MAC2 as 10G
  2022-10-31 14:12       ` Camelia Alexandra Groza
@ 2022-10-31 22:19         ` Sean Anderson
  0 siblings, 0 replies; 12+ messages in thread
From: Sean Anderson @ 2022-10-31 22:19 UTC (permalink / raw)
  To: Camelia Alexandra Groza, David S . Miller, Jakub Kicinski,
	Madalin Bucur, netdev@vger.kernel.org
  Cc: Eric Dumazet, linuxppc-dev @ lists . ozlabs . org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Russell King, Paolo Abeni,
	Benjamin Herrenschmidt, Krzysztof Kozlowski, Leo Li,
	Michael Ellerman, Paul Mackerras, Rob Herring,
	devicetree@vger.kernel.org

On 10/31/22 10:12, Camelia Alexandra Groza wrote:
>> -----Original Message-----
>> From: Sean Anderson <sean.anderson@seco.com>
>> Sent: Friday, October 28, 2022 19:55
>> To: Camelia Alexandra Groza <camelia.groza@nxp.com>; Sean Anderson
>> <sean.anderson@seco.com>; David S . Miller <davem@davemloft.net>;
>> Jakub Kicinski <kuba@kernel.org>; Madalin Bucur
>> <madalin.bucur@nxp.com>; netdev@vger.kernel.org
>> Cc: Eric Dumazet <edumazet@google.com>; linuxppc-dev @ lists . ozlabs .
>> org <linuxppc-dev@lists.ozlabs.org>; linux-arm-kernel@lists.infradead.org;
>> linux-kernel@vger.kernel.org; Russell King <linux@armlinux.org.uk>; Paolo
>> Abeni <pabeni@redhat.com>; Benjamin Herrenschmidt
>> <benh@kernel.crashing.org>; Krzysztof Kozlowski
>> <krzysztof.kozlowski+dt@linaro.org>; Leo Li <leoyang.li@nxp.com>; Michael
>> Ellerman <mpe@ellerman.id.au>; Paul Mackerras <paulus@samba.org>; Rob
>> Herring <robh+dt@kernel.org>; devicetree@vger.kernel.org
>> Subject: Re: [PATCH net-next v7 08/10] powerpc: dts: t208x: Mark MAC1 and
>> MAC2 as 10G
>> 
>> On 10/28/22 12:30, Camelia Alexandra Groza wrote:
>> >> -----Original Message-----
>> >> From: Sean Anderson <sean.anderson@seco.com>
>> >> Sent: Monday, October 17, 2022 23:23
>> >> To: David S . Miller <davem@davemloft.net>; Jakub Kicinski
>> >> <kuba@kernel.org>; Madalin Bucur <madalin.bucur@nxp.com>; Camelia
>> >> Alexandra Groza <camelia.groza@nxp.com>; netdev@vger.kernel.org
>> >> Cc: Eric Dumazet <edumazet@google.com>; linuxppc-dev @ lists . ozlabs .
>> >> org <linuxppc-dev@lists.ozlabs.org>; linux-arm-
>> kernel@lists.infradead.org;
>> >> linux-kernel@vger.kernel.org; Russell King <linux@armlinux.org.uk>;
>> Paolo
>> >> Abeni <pabeni@redhat.com>; Sean Anderson
>> <sean.anderson@seco.com>;
>> >> Benjamin Herrenschmidt <benh@kernel.crashing.org>; Krzysztof
>> Kozlowski
>> >> <krzysztof.kozlowski+dt@linaro.org>; Leo Li <leoyang.li@nxp.com>;
>> Michael
>> >> Ellerman <mpe@ellerman.id.au>; Paul Mackerras <paulus@samba.org>;
>> Rob
>> >> Herring <robh+dt@kernel.org>; devicetree@vger.kernel.org
>> >> Subject: [PATCH net-next v7 08/10] powerpc: dts: t208x: Mark MAC1 and
>> >> MAC2 as 10G
>> >>
>> >> On the T208X SoCs, MAC1 and MAC2 support XGMII. Add some new MAC
>> >> dtsi
>> >> fragments, and mark the QMAN ports as 10G.
>> >>
>> >> Fixes: da414bb923d9 ("powerpc/mpc85xx: Add FSL QorIQ DPAA FMan
>> >> support to the SoC device tree(s)")
>> >> Signed-off-by: Sean Anderson <sean.anderson@seco.com>
>> >> ---
>> >>
>> >> (no changes since v4)
>> >>
>> >> Changes in v4:
>> >> - New
>> >
>> > Hi Sean,
>> >
>> > These changes prevent MAC2 from probing on T2080RDB due to
>> insufficient FMan hardware resources.
>> >
>> > fsl-fman ffe400000.fman: set_num_of_tasks: Requested num_of_tasks
>> and extra tasks pool for fm0 exceed total num_of_tasks.
>> > fsl_dpa: dpaa_eth_init_tx_port: fm_port_init failed
>> > fsl_dpa: probe of dpaa-ethernet.5 failed with error -11
>> >
>> > The distribution of resources depends on the port type, and different
>> FMan hardware revisions have different amounts of resources.
>> >
>> > The current distribution of resources can be reconsidered, but this change
>> should be reverted for now.
>> 
>> OK, so this patch does two things:
>> 
>> @@ -37,12 +11,14 @@
>>   		cell-index = <0x8>;
>>   		compatible = "fsl,fman-v3-port-rx";
>>   		reg = <0x88000 0x1000>;
>> +		fsl,fman-10g-port;
>>   	};
>> 
>>   	fman0_tx_0x28: port@a8000 {
>>   		cell-index = <0x28>;
>>   		compatible = "fsl,fman-v3-port-tx";
>>   		reg = <0xa8000 0x1000>;
>> +		fsl,fman-10g-port;
>>   	};
>> 
>>   	ethernet@e0000 {
>> @@ -52,7 +28,7 @@
>>   		fsl,fman-ports = <&fman0_rx_0x08 &fman0_tx_0x28>;
>>   		ptp-timer = <&ptp_timer0>;
>>   		pcsphy-handle = <&pcsphy0>, <&pcsphy0>;
>> -		pcs-handle-names = "sgmii", "qsgmii";
>> +		pcs-handle-names = "sgmii", "xfi";
>>   	};
>> 
>>   	mdio@e1000 {
>> 
>> First, it marks the ports as 10g. I believe this is what's causing the
>> resource problems above.
> 
> That's right.
> 
>> Second, it removes support for QSGMII and adds
>> support for XFI. This is a matter of correctness; these MACs really
>> don't support QSGMII, and do support XFI.
> 
> Correct, these MACs don't support QSGMII on this SoC.
> 
>> As I understand it, you can
>> run a 10g port at 1g speeds, it just won't perform as well. So I think a
>> more minimal revert would be to delete the fsl,fman-10g-port properties
>> in t2081si-post.dtsi.
> 
> Since these two new dtsi files are included by only one SoC, I don't see an
> advantage in adding these properties and then deleting them. No other
> users benefit from adding them in the first place. 

OK, so would you prefer just overriding pcs-handle-names in the SoC dtsi?

--Sean

>> That said, is 10g even being used on these ports? I included this patch
>> in order to avoid breaking any existing users.
> 
> It is used, though less efficiently, with fewer FMan hardware resources.
> 
> Camelia
> 
>> --Sean
>> 
>> > Regards,
>> > Camelia
>> >
>> >
>> >>   .../boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi     | 44 +++++++++++++++++++
>> >>   .../boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi     | 44 +++++++++++++++++++
>> >>   arch/powerpc/boot/dts/fsl/t2081si-post.dtsi   |  4 +-
>> >>   3 files changed, 90 insertions(+), 2 deletions(-)
>> >>   create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-
>> 2.dtsi
>> >>   create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-
>> 3.dtsi
>> >>
>> >> diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi
>> >> b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi
>> >> new file mode 100644
>> >> index 000000000000..437dab3fc017
>> >> --- /dev/null
>> >> +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi
>> >> @@ -0,0 +1,44 @@
>> >> +// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later
>> >> +/*
>> >> + * QorIQ FMan v3 10g port #2 device tree stub [ controller @ offset
>> >> 0x400000 ]
>> >> + *
>> >> + * Copyright 2022 Sean Anderson <sean.anderson@seco.com>
>> >> + * Copyright 2012 - 2015 Freescale Semiconductor Inc.
>> >> + */
>> >> +
>> >> +fman@400000 {
>> >> +	fman0_rx_0x08: port@88000 {
>> >> +		cell-index = <0x8>;
>> >> +		compatible = "fsl,fman-v3-port-rx";
>> >> +		reg = <0x88000 0x1000>;
>> >> +		fsl,fman-10g-port;
>> >> +	};
>> >> +
>> >> +	fman0_tx_0x28: port@a8000 {
>> >> +		cell-index = <0x28>;
>> >> +		compatible = "fsl,fman-v3-port-tx";
>> >> +		reg = <0xa8000 0x1000>;
>> >> +		fsl,fman-10g-port;
>> >> +	};
>> >> +
>> >> +	ethernet@e0000 {
>> >> +		cell-index = <0>;
>> >> +		compatible = "fsl,fman-memac";
>> >> +		reg = <0xe0000 0x1000>;
>> >> +		fsl,fman-ports = <&fman0_rx_0x08 &fman0_tx_0x28>;
>> >> +		ptp-timer = <&ptp_timer0>;
>> >> +		pcsphy-handle = <&pcsphy0>;
>> >> +	};
>> >> +
>> >> +	mdio@e1000 {
>> >> +		#address-cells = <1>;
>> >> +		#size-cells = <0>;
>> >> +		compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
>> >> +		reg = <0xe1000 0x1000>;
>> >> +		fsl,erratum-a011043; /* must ignore read errors */
>> >> +
>> >> +		pcsphy0: ethernet-phy@0 {
>> >> +			reg = <0x0>;
>> >> +		};
>> >> +	};
>> >> +};
>> >> diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi
>> >> b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi
>> >> new file mode 100644
>> >> index 000000000000..ad116b17850a
>> >> --- /dev/null
>> >> +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi
>> >> @@ -0,0 +1,44 @@
>> >> +// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later
>> >> +/*
>> >> + * QorIQ FMan v3 10g port #3 device tree stub [ controller @ offset
>> >> 0x400000 ]
>> >> + *
>> >> + * Copyright 2022 Sean Anderson <sean.anderson@seco.com>
>> >> + * Copyright 2012 - 2015 Freescale Semiconductor Inc.
>> >> + */
>> >> +
>> >> +fman@400000 {
>> >> +	fman0_rx_0x09: port@89000 {
>> >> +		cell-index = <0x9>;
>> >> +		compatible = "fsl,fman-v3-port-rx";
>> >> +		reg = <0x89000 0x1000>;
>> >> +		fsl,fman-10g-port;
>> >> +	};
>> >> +
>> >> +	fman0_tx_0x29: port@a9000 {
>> >> +		cell-index = <0x29>;
>> >> +		compatible = "fsl,fman-v3-port-tx";
>> >> +		reg = <0xa9000 0x1000>;
>> >> +		fsl,fman-10g-port;
>> >> +	};
>> >> +
>> >> +	ethernet@e2000 {
>> >> +		cell-index = <1>;
>> >> +		compatible = "fsl,fman-memac";
>> >> +		reg = <0xe2000 0x1000>;
>> >> +		fsl,fman-ports = <&fman0_rx_0x09 &fman0_tx_0x29>;
>> >> +		ptp-timer = <&ptp_timer0>;
>> >> +		pcsphy-handle = <&pcsphy1>;
>> >> +	};
>> >> +
>> >> +	mdio@e3000 {
>> >> +		#address-cells = <1>;
>> >> +		#size-cells = <0>;
>> >> +		compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
>> >> +		reg = <0xe3000 0x1000>;
>> >> +		fsl,erratum-a011043; /* must ignore read errors */
>> >> +
>> >> +		pcsphy1: ethernet-phy@0 {
>> >> +			reg = <0x0>;
>> >> +		};
>> >> +	};
>> >> +};
>> >> diff --git a/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
>> >> b/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
>> >> index ecbb447920bc..74e17e134387 100644
>> >> --- a/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
>> >> +++ b/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
>> >> @@ -609,8 +609,8 @@ usb1: usb@211000 {
>> >>   /include/ "qoriq-bman1.dtsi"
>> >>
>> >>   /include/ "qoriq-fman3-0.dtsi"
>> >> -/include/ "qoriq-fman3-0-1g-0.dtsi"
>> >> -/include/ "qoriq-fman3-0-1g-1.dtsi"
>> >> +/include/ "qoriq-fman3-0-10g-2.dtsi"
>> >> +/include/ "qoriq-fman3-0-10g-3.dtsi"
>> >>   /include/ "qoriq-fman3-0-1g-2.dtsi"
>> >>   /include/ "qoriq-fman3-0-1g-3.dtsi"
>> >>   /include/ "qoriq-fman3-0-1g-4.dtsi"
>> >> --
>> >> 2.35.1.1320.gc452695387.dirty
>> >
> 


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

end of thread, other threads:[~2022-10-31 22:20 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-17 20:22 [PATCH net-next v7 00/10] net: dpaa: Convert to phylink Sean Anderson
2022-10-17 20:22 ` [PATCH net-next v7 01/10] dt-bindings: net: Expand pcs-handle to an array Sean Anderson
2022-10-17 20:22 ` [PATCH net-next v7 02/10] dt-bindings: net: Add Lynx PCS binding Sean Anderson
2022-10-17 20:22 ` [PATCH net-next v7 03/10] dt-bindings: net: fman: Add additional interface properties Sean Anderson
2022-10-17 20:22 ` [PATCH net-next v7 08/10] powerpc: dts: t208x: Mark MAC1 and MAC2 as 10G Sean Anderson
2022-10-28 16:30   ` Camelia Alexandra Groza
2022-10-28 16:54     ` Sean Anderson
2022-10-31 14:12       ` Camelia Alexandra Groza
2022-10-31 22:19         ` Sean Anderson
2022-10-17 20:22 ` [PATCH net-next v7 09/10] powerpc: dts: qoriq: Add nodes for QSGMII PCSs Sean Anderson
2022-10-17 20:22 ` [PATCH net-next v7 10/10] arm64: dts: layerscape: " Sean Anderson
2022-10-19 13:00 ` [PATCH net-next v7 00/10] net: dpaa: Convert to phylink patchwork-bot+netdevbpf

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).