Skip to content

Commit

Permalink
clearfog-cx: add support for serdes 1 protocol 18 with runtime 10G/25G
Browse files Browse the repository at this point in the history
With Serdes 1 Protocol 18 and some changes to mc-utils and linux,
Clearfog-CX can switch any ethernet port between 10 and 25Gbps speed.

SFP connectors switch automatically according to SFP module properties,
QSFP ports are configured in device-tree.
  • Loading branch information
Josua-SR committed Oct 31, 2024
1 parent 3675507 commit fe2a8e4
Show file tree
Hide file tree
Showing 5 changed files with 2,255 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
From 8e334669fa98d99e21f7c17a3d6bbbd48878a2b2 Mon Sep 17 00:00:00 2001
From: Josua Mayer <[email protected]>
Date: Thu, 31 Oct 2024 17:14:25 +0100
Subject: [PATCH 24/25] arm64: dts: lx2160a-clearfog-itx: set fixed link for
qsfp ports

As QSFP is not currenly supported in the Linux kernel no attempt is made
to model this detail of Honeycomb and Clearfog-CX boards.

Vendor bootloader used to set up the ethernet ports which are routed to
qsfp connector as fixed links in MC firmware depending on selected
serdes protocol.
These firmware side fixed links worked on linux side without any
explicit configuration.

The LX2160A also supports runtime configuration of network protocols on
ethernet ports and serdes lanes using generic phys. This requires
changing the interface type on firmware side to type "PHY".

The standard SFP ports on Honeycomb / Clearfog-CX already rely on
interface type "PHY" to report link and switch ethernet protocol at
runtime based on SFP module properties.

When interface type is on firmware side is "PHY", dpaa2 driver
configures ethernet ports based on runtime information such as SFP
modules properties and reported link status, or a dedicated phy on mdio
bus.

In lack of actual QSFP support set up the affected ethernet ports for
fixed 10Gbps link, and enable their respective pcs nodes.
This ensures that when firmware set interface type "PHY", the port and
serdes lanes are configured properly to allow TX and RX of packets.

It also simplifies configuration for users by allowing selection of
interface speed (e.g. 10 or 25Gbps with serdes 1 protocol 18) in
device-tree rather than firmware.

Signed-off-by: Josua Mayer <[email protected]>
---
.../freescale/fsl-lx2160a-clearfog-itx.dtsi | 56 +++++++++++++++++++
1 file changed, 56 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/fsl-lx2160a-clearfog-itx.dtsi b/arch/arm64/boot/dts/freescale/fsl-lx2160a-clearfog-itx.dtsi
index f43d6a90e162..11a99d4efe93 100644
--- a/arch/arm64/boot/dts/freescale/fsl-lx2160a-clearfog-itx.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-lx2160a-clearfog-itx.dtsi
@@ -60,6 +60,46 @@ sfp3: sfp-3 {
};
};

+&dpmac3 {
+ phys = <&serdes_1 7>;
+ phy-connection-type = "10gbase-r";
+
+ fixed-link {
+ speed = <10000>;
+ full-duplex;
+ };
+};
+
+&dpmac4 {
+ phys = <&serdes_1 6>;
+ phy-connection-type = "10gbase-r";
+
+ fixed-link {
+ speed = <10000>;
+ full-duplex;
+ };
+};
+
+&dpmac5 {
+ phys = <&serdes_1 5>;
+ phy-connection-type = "10gbase-r";
+
+ fixed-link {
+ speed = <10000>;
+ full-duplex;
+ };
+};
+
+&dpmac6 {
+ phys = <&serdes_1 4>;
+ phy-connection-type = "10gbase-r";
+
+ fixed-link {
+ speed = <10000>;
+ full-duplex;
+ };
+};
+
&dpmac7 {
sfp = <&sfp0>;
managed = "in-band-status";
@@ -104,6 +144,22 @@ &pcie5 {
status = "okay";
};

+&pcs_mdio3 {
+ status = "okay";
+};
+
+&pcs_mdio4 {
+ status = "okay";
+};
+
+&pcs_mdio5 {
+ status = "okay";
+};
+
+&pcs_mdio6 {
+ status = "okay";
+};
+
&pcs_mdio7 {
status = "okay";
};
--
2.43.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
From 678cee596a136c8dd9d91ce62ae9702cb3da82b1 Mon Sep 17 00:00:00 2001
From: Josua Mayer <[email protected]>
Date: Thu, 31 Oct 2024 15:46:16 +0100
Subject: [PATCH 25/25] arm64: dts: lx2160a-clearfog-cx: add description for
retimers

SolidRun Clearfog-CX (unlike Honeycomb) has QSFP connector driven by
retimers to support long copper wires.

Add descriptions for both retimers and link them to the relevant
ethernet interfaces.

Retimers were added with board revision 1.3, earlier baords can use the
honeycomb dts.

Signed-off-by: Josua Mayer <[email protected]>
---
.../boot/dts/freescale/fsl-lx2160a-cex7.dtsi | 2 +-
.../dts/freescale/fsl-lx2160a-clearfog-cx.dts | 38 +++++++++++++++++++
2 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/freescale/fsl-lx2160a-cex7.dtsi b/arch/arm64/boot/dts/freescale/fsl-lx2160a-cex7.dtsi
index 024a119bcb7a..503e346f4d86 100644
--- a/arch/arm64/boot/dts/freescale/fsl-lx2160a-cex7.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-lx2160a-cex7.dtsi
@@ -155,7 +155,7 @@ regulator@5c {
};
};

- i2c@3 {
+ i2c_smb: i2c@3 {
#address-cells = <1>;
#size-cells = <0>;
reg = <3>;
diff --git a/arch/arm64/boot/dts/freescale/fsl-lx2160a-clearfog-cx.dts b/arch/arm64/boot/dts/freescale/fsl-lx2160a-clearfog-cx.dts
index 86a9b771428d..60151fccd198 100644
--- a/arch/arm64/boot/dts/freescale/fsl-lx2160a-clearfog-cx.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-lx2160a-clearfog-cx.dts
@@ -13,3 +13,41 @@ / {
compatible = "solidrun,clearfog-cx",
"solidrun,lx2160a-cex7", "fsl,lx2160a";
};
+
+&dpmac3 {
+ phys = <&serdes_1 7>, <&retimer0 3>, <&retimer1 3>;
+ phy-names = "serdes", "retimer", "retimer";
+};
+
+&dpmac4 {
+ phys = <&serdes_1 6>, <&retimer0 2>, <&retimer1 2>;
+ phy-names = "serdes", "retimer", "retimer";
+};
+
+&dpmac5 {
+ phys = <&serdes_1 5>, <&retimer0 1>, <&retimer1 1>;
+ phy-names = "serdes", "retimer", "retimer";
+};
+
+&dpmac6 {
+ phys = <&serdes_1 4>, <&retimer0 0>, <&retimer1 0>;
+ phy-names = "serdes", "retimer", "retimer";
+};
+
+&i2c_smb {
+ status = "okay";
+
+ /* tx direction */
+ retimer0: retimer@22 {
+ compatible = "ti,ds250df410";
+ reg = <0x22>;
+ #phy-cells = <1>;
+ };
+
+ /* rx direction */
+ retimer1: retimer@23 {
+ compatible = "ti,ds250df410";
+ reg = <0x23>;
+ #phy-cells = <1>;
+ };
+};
--
2.43.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
From 35dffd4f4a82a18897bf0b78df8f1402ef5e2d03 Mon Sep 17 00:00:00 2001
From: Josua Mayer <[email protected]>
Date: Thu, 31 Oct 2024 17:35:21 +0100
Subject: [PATCH] lx2160acex7: clearfog-cx: configure qsfp ports type phy

Interface type PHY allows Linux to configure ethernet speed at runtime
for each port, rather than sticking to assignment from serdes protocols.

This is particularly useful with SD1 protocol 18 which by default drives
just two ports at 25Gbps while QSFP connector has 4.
At protocol 18 Linux can switch any of the 8 ports between 10Gbps and
25Gbps as needed.

Due to lack of software support, the QSFP ports need to define speed in
device-tree.

Signed-off-by: Josua Mayer <[email protected]>
---
config/lx2160a/LX2160A-CEX7/clearfog-cx-s1_8-s2_0-dpc.dts | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/config/lx2160a/LX2160A-CEX7/clearfog-cx-s1_8-s2_0-dpc.dts b/config/lx2160a/LX2160A-CEX7/clearfog-cx-s1_8-s2_0-dpc.dts
index dcc376e..9a508d2 100644
--- a/config/lx2160a/LX2160A-CEX7/clearfog-cx-s1_8-s2_0-dpc.dts
+++ b/config/lx2160a/LX2160A-CEX7/clearfog-cx-s1_8-s2_0-dpc.dts
@@ -69,19 +69,19 @@
board_info {
ports {
mac@3 {
- link_type = "MAC_LINK_TYPE_FIXED";
+ link_type = "MAC_LINK_TYPE_PHY";
};

mac@4 {
- link_type = "MAC_LINK_TYPE_FIXED";
+ link_type = "MAC_LINK_TYPE_PHY";
};

mac@5 {
- link_type = "MAC_LINK_TYPE_FIXED";
+ link_type = "MAC_LINK_TYPE_PHY";
};

mac@6 {
- link_type = "MAC_LINK_TYPE_FIXED";
+ link_type = "MAC_LINK_TYPE_PHY";
};

mac@7 {
--
2.43.0

Loading

0 comments on commit fe2a8e4

Please sign in to comment.