Skip to contentSkip to conversation

Enable DM_ETH for DPAA1 PowerPC T-series boards

PATCH New Camelia Groza 1 participant 12 messages Apr 9, 2021 PowerPC

lore
Share & tools
lore
#0 lore raw

cover Enable DM_ETH for DPAA1 PowerPC T-series boards

This patch series enables DM_ETH and DM_MDIO on the T2080RDB, T4240RDB and T1042D4RDB DPAA1 PowerPC boards. The necessary FMan v3 Ethernet and MDIO nodes are added to each platform's SoC and board device tree.

On T2080RDB, fdt fixups are performed before booting into the OS using a simplified new routine in order to avoid the legacy code path.

Camelia Groza (11):
powerpc: dts: t2080: add QorIQ DPAA 1 FMan v3 nodes
powerpc: dts: t2080rdb: add FMan v3 nodes
board: freescale: t208xrdb: fdt fixups under DM_ETH
configs: T2080RDB: enable DM_ETH
powerpc: dts: t4240: add QorIQ DPAA 1 FMan v3 nodes
powerpc: dts: t4240rdb: add FMan v3 nodes
powerpc: dts: qoriq: update the mdio offsets under the second FMan v3
configs: T4240RDB: enable DM_ETH
powerpc: dts: t1042: add QorIQ DPAA 1 FMan v3 nodes
powerpc: dts: t1042d4rdb: add FMan v3 nodes
configs: T1042D4RDB: enable DM_ETH

 arch/powerpc/dts/qoriq-fman3-1-10g-0.dtsi |   2 +-
 arch/powerpc/dts/qoriq-fman3-1-10g-1.dtsi |   2 +-
 arch/powerpc/dts/qoriq-fman3-1-1g-0.dtsi  |   2 +-
 arch/powerpc/dts/qoriq-fman3-1-1g-1.dtsi  |   2 +-
 arch/powerpc/dts/qoriq-fman3-1-1g-2.dtsi  |   2 +-
 arch/powerpc/dts/qoriq-fman3-1-1g-3.dtsi  |   2 +-
 arch/powerpc/dts/qoriq-fman3-1-1g-4.dtsi  |   2 +-
 arch/powerpc/dts/qoriq-fman3-1-1g-5.dtsi  |   2 +-
 arch/powerpc/dts/qoriq-fman3-1.dtsi       |   4 +-
 arch/powerpc/dts/t1042d4rdb.dts           |  55 ++++++++-
 arch/powerpc/dts/t1042si-post.dtsi        |  46 +++++++
 arch/powerpc/dts/t2080rdb.dts             |  69 ++++++++++-
 arch/powerpc/dts/t2080si-post.dtsi        |  51 ++++++++
 arch/powerpc/dts/t4240rdb.dts             | 142 +++++++++++++++++++++-
 arch/powerpc/dts/t4240si-post.dtsi        | 101 +++++++++++++++
 board/freescale/t208xrdb/eth_t208xrdb.c   |  35 ++++++
 board/freescale/t208xrdb/t208xrdb.c       |   3 +
 board/freescale/t208xrdb/t208xrdb.h       |   2 +
 configs/T1042D4RDB_NAND_defconfig         |   3 +
 configs/T1042D4RDB_SDCARD_defconfig       |   3 +
 configs/T1042D4RDB_SECURE_BOOT_defconfig  |   4 +-
 configs/T1042D4RDB_SPIFLASH_defconfig     |   3 +
 configs/T1042D4RDB_defconfig              |   3 +
 configs/T2080RDB_NAND_defconfig           |   3 +
 configs/T2080RDB_SDCARD_defconfig         |   3 +
 configs/T2080RDB_SPIFLASH_defconfig       |   3 +
 configs/T2080RDB_defconfig                |   3 +
 configs/T4240RDB_SDCARD_defconfig         |   3 +
 configs/T4240RDB_defconfig                |   3 +
 29 files changed, 544 insertions(+), 14 deletions(-)
 create mode 100644 arch/powerpc/dts/t1042si-post.dtsi
 create mode 100644 arch/powerpc/dts/t2080si-post.dtsi
 create mode 100644 arch/powerpc/dts/t4240si-post.dtsi

--
2.17.1

#1 lore raw

PATCH 1/11 powerpc: dts: t2080: add QorIQ DPAA 1 FMan v3 nodes

Add the QorIQ DPAA 1 FMan v3 device tree nodes for the T2080 SoC. The device tree nodes are copied over with little modification from the Linux kernel source code.

---
 arch/powerpc/dts/t2080si-post.dtsi | 51 ++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 arch/powerpc/dts/t2080si-post.dtsi
arch/powerpc/dts/t2080si-post.dtsi new file +51 -0
new file mode 100644
index 000000000000..d8ef579cb7c0
@@ -0,0 +1,51 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
+/*
+ * T2080 Silicon/SoC Device Tree Source (post include)
+ *
+ * Copyright 2013 Freescale Semiconductor Inc.
+ * Copyright 2021 NXP
+ *
+ */
+&soc {
+
+/include/ "qoriq-clockgen2.dtsi"
+/include/ "qoriq-gpio-0.dtsi"
+/include/ "qoriq-gpio-1.dtsi"
+/include/ "qoriq-gpio-2.dtsi"
+/include/ "qoriq-gpio-3.dtsi"
+
+/include/ "qoriq-fman3-0.dtsi"
+/include/ "qoriq-fman3-0-10g-0-best-effort.dtsi"
+/include/ "qoriq-fman3-0-10g-1-best-effort.dtsi"
+/include/ "qoriq-fman3-0-1g-2.dtsi"
+/include/ "qoriq-fman3-0-1g-3.dtsi"
+/include/ "qoriq-fman3-0-10g-0.dtsi"
+/include/ "qoriq-fman3-0-10g-1.dtsi"
+	fman at 400000 {
+		enet0: ethernet at e0000 {
+		};
+
+		enet1: ethernet at e2000 {
+		};
+
+		enet2: ethernet at e4000 {
+		};
+
+		enet3: ethernet at e6000 {
+		};
+
+		enet6: ethernet at f0000 {
+		};
+
+		enet7: ethernet at f2000 {
+		};
+
+		mdio at fc000 {
+			interrupts = <100 1 0 0>;
+		};
+
+		mdio at fd000 {
+			interrupts = <101 1 0 0>;
+		};
+	};
+};
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/11 powerpc: dts: t2080rdb: add FMan v3 nodes

In reply to Camelia Groza

Add the FMan v3 nodes for the T2080RDB. The nodes are copied over with little modification from the Linux kernel source code.

---
 arch/powerpc/dts/t2080rdb.dts | 69 ++++++++++++++++++++++++++++++++++-
 1 file changed, 68 insertions(+), 1 deletion(-)
arch/powerpc/dts/t2080rdb.dts +68 -1
index 74bbb20e2a1e..25f8c978c6d1 100644
@@ -3,7 +3,7 @@
  * T2080RDB Device Tree Source
  *
  * Copyright 2013 - 2015 Freescale Semiconductor Inc.
- * Copyright 2019 NXP
+ * Copyright 2019-2021 NXP
  */
 
 /include/ "t2080.dtsi"
@@ -20,6 +20,71 @@
 	};
 };
 
+&soc {
+	fman at 400000 {
+		ethernet at e0000 {
+			phy-handle = <&xg_aq1202_phy3>;
+			phy-connection-type = "xgmii";
+		};
+
+		ethernet at e2000 {
+			phy-handle = <&xg_aq1202_phy4>;
+			phy-connection-type = "xgmii";
+		};
+
+		ethernet at e4000 {
+			phy-handle = <&rgmii_phy1>;
+			phy-connection-type = "rgmii";
+		};
+
+		ethernet at e6000 {
+			phy-handle = <&rgmii_phy2>;
+			phy-connection-type = "rgmii";
+		};
+
+		ethernet at f0000 {
+			phy-handle = <&xg_cs4315_phy2>;
+			phy-connection-type = "xgmii";
+		};
+
+		ethernet at f2000 {
+			phy-handle = <&xg_cs4315_phy1>;
+			phy-connection-type = "xgmii";
+		};
+
+		mdio at fc000 {
+			rgmii_phy1: ethernet-phy at 1 {
+				reg = <0x1>;
+			};
+			rgmii_phy2: ethernet-phy at 2 {
+				reg = <0x2>;
+			};
+		};
+
+		mdio at fd000 {
+			xg_cs4315_phy1: ethernet-phy at c {
+				compatible = "ethernet-phy-id13e5.1002";
+				reg = <0xc>;
+			};
+
+			xg_cs4315_phy2: ethernet-phy at d {
+				compatible = "ethernet-phy-id13e5.1002";
+				reg = <0xd>;
+			};
+
+			xg_aq1202_phy3: ethernet-phy at 0 {
+				compatible = "ethernet-phy-ieee802.3-c45";
+				reg = <0x0>;
+			};
+
+			xg_aq1202_phy4: ethernet-phy at 1 {
+				compatible = "ethernet-phy-ieee802.3-c45";
+				reg = <0x1>;
+			};
+		};
+	};
+};
+
 &espi0 {
 	status = "okay";
 	flash at 0 {
@@ -38,3 +103,5 @@
 		reg = <0x68>;
 	};
 };
+
+/include/ "t2080si-post.dtsi"
Signature · 1 line
2.17.1
#3 lore raw

PATCH 3/11 board: freescale: t208xrdb: fdt fixups under DM_ETH

In reply to Camelia Groza

Disable the FMan mEMAC 5 and 6 nodes from the fdt since they are not available under the supported RCW. Also disable the associated "fsl,dpa-ethernet" nodes that reference them.

This is a simplified version of the fdt_fixup_fman_ethernet call for use under DM_ETH.

---
 board/freescale/t208xrdb/eth_t208xrdb.c | 35 +++++++++++++++++++++++++
 board/freescale/t208xrdb/t208xrdb.c     |  3 +++
 board/freescale/t208xrdb/t208xrdb.h     |  2 ++
 3 files changed, 40 insertions(+)
board/freescale/t208xrdb/eth_t208xrdb.c +35 -0
index e77f3f7146f7..b0ff4b1f375a 100644
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2014 Freescale Semiconductor, Inc.
+ * Copyright 2021 NXP
  *
  * Shengzhou Liu <[email protected]>
  */
@@ -104,6 +105,40 @@ int board_eth_init(struct bd_info *bis)
 	return pci_eth_init(bis);
 }
 
+/* Disable the MAC5 and MAC6 "fsl,fman-memac" nodes and the two
+ * "fsl,dpa-ethernet" nodes that reference them.
+ */
+void fdt_fixup_board_fman_ethernet(void *fdt)
+{
+	int mac_off, eth_off, i;
+	char mac_path[2][42] = {
+		"/soc at ffe000000/fman at 400000/ethernet at e8000",
+		"/soc at ffe000000/fman at 400000/ethernet at ea000",
+	};
+	u32 eth_ph;
+
+	for (i = 0; i < 2; i++) {
+		/* Disable the MAC node */
+		mac_off = fdt_path_offset(fdt, mac_path[i]);
+		if (mac_off < 0)
+			continue;
+		fdt_status_disabled(fdt, mac_off);
+
+		/* Disable the fsl,dpa-ethernet node that points to the MAC.
+		 * The fsl,fman-mac property refers to the MAC's phandle.
+		 */
+		eth_ph = fdt_get_phandle(fdt, mac_off);
+		if (eth_ph <= 0)
+			continue;
+
+		eth_off = fdt_node_offset_by_prop_value(fdt, -1, "fsl,fman-mac",
+							&eth_ph,
+							sizeof(eth_ph));
+		if (eth_off >= 0)
+			fdt_status_disabled(fdt, eth_off);
+	}
+}
+
 void fdt_fixup_board_enet(void *fdt)
 {
 	return;
board/freescale/t208xrdb/t208xrdb.c +3 -0
index a18459841c62..7ccb205c6473 100644
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2009-2013 Freescale Semiconductor, Inc.
+ * Copyright 2021 NXP
  */
 
 #include <common.h>
@@ -137,6 +138,8 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 #ifdef CONFIG_SYS_DPAA_FMAN
 #ifndef CONFIG_DM_ETH
 	fdt_fixup_fman_ethernet(blob);
+#else
+	fdt_fixup_board_fman_ethernet(blob);
 #endif
 	fdt_fixup_board_enet(blob);
 #endif
board/freescale/t208xrdb/t208xrdb.h +2 -0
index 22a496fb8cf2..cd0a9f44da79 100644
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright 2014 Freescale Semiconductor, Inc.
+ * Copyright 2021 NXP
  */
 
 #ifndef __CORENET_DS_H__
@@ -8,5 +9,6 @@
 
 void fdt_fixup_board_enet(void *blob);
 void pci_of_setup(void *blob, struct bd_info *bd);
+void fdt_fixup_board_fman_ethernet(void *blob);
 
 #endif
Signature · 1 line
2.17.1
#4 lore raw

PATCH 4/11 configs: T2080RDB: enable DM_ETH

In reply to Camelia Groza

Enable DM_ETH and DM_MDIO for the T2080RDB.

---
 configs/T2080RDB_NAND_defconfig     | 3 +++
 configs/T2080RDB_SDCARD_defconfig   | 3 +++
 configs/T2080RDB_SPIFLASH_defconfig | 3 +++
 configs/T2080RDB_defconfig          | 3 +++
 4 files changed, 12 insertions(+)
configs/T2080RDB_NAND_defconfig +3 -0
index 543d34e24988..3bb74335bb47 100644
@@ -33,6 +33,7 @@ CONFIG_HUSH_PARSER=y
 CONFIG_CMD_IMLS=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
@@ -70,6 +71,8 @@ CONFIG_PHY_AQUANTIA=y
 CONFIG_PHY_CORTINA=y
 CONFIG_SYS_CORTINA_FW_IN_NAND=y
 CONFIG_PHY_REALTEK=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
 CONFIG_FMAN_ENET=y
 CONFIG_MII=y
configs/T2080RDB_SDCARD_defconfig +3 -0
index d947846e6458..bcd67a05764e 100644
@@ -31,6 +31,7 @@ CONFIG_HUSH_PARSER=y
 CONFIG_CMD_IMLS=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
@@ -67,6 +68,8 @@ CONFIG_PHY_AQUANTIA=y
 CONFIG_PHY_CORTINA=y
 CONFIG_SYS_CORTINA_FW_IN_MMC=y
 CONFIG_PHY_REALTEK=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
 CONFIG_FMAN_ENET=y
 CONFIG_MII=y
configs/T2080RDB_SPIFLASH_defconfig +3 -0
index 6f7b083bc623..198e926c32f6 100644
@@ -33,6 +33,7 @@ CONFIG_HUSH_PARSER=y
 CONFIG_CMD_IMLS=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
@@ -69,6 +70,8 @@ CONFIG_PHY_AQUANTIA=y
 CONFIG_PHY_CORTINA=y
 CONFIG_SYS_CORTINA_FW_IN_SPIFLASH=y
 CONFIG_PHY_REALTEK=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
 CONFIG_FMAN_ENET=y
 CONFIG_MII=y
configs/T2080RDB_defconfig +3 -0
index 9dd01bbe50a5..12aaccd1d509 100644
@@ -18,6 +18,7 @@ CONFIG_HUSH_PARSER=y
 CONFIG_CMD_IMLS=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
@@ -54,6 +55,8 @@ CONFIG_PHYLIB=y
 CONFIG_PHY_AQUANTIA=y
 CONFIG_PHY_CORTINA=y
 CONFIG_PHY_REALTEK=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
 CONFIG_FMAN_ENET=y
 CONFIG_MII=y
Signature · 1 line
2.17.1
#5 lore raw

PATCH 5/11 powerpc: dts: t4240: add QorIQ DPAA 1 FMan v3 nodes

In reply to Camelia Groza

Add the QorIQ DPAA 1 FMan v3 device tree nodes for the T4240 SoC. The device tree nodes are copied over with little modification from the Linux kernel source code.

---
 arch/powerpc/dts/t4240si-post.dtsi | 101 +++++++++++++++++++++++++++++
 1 file changed, 101 insertions(+)
 create mode 100644 arch/powerpc/dts/t4240si-post.dtsi
arch/powerpc/dts/t4240si-post.dtsi new file +101 -0
new file mode 100644
index 000000000000..f614d19965d3
@@ -0,0 +1,101 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
+/*
+ * T4240 Silicon/SoC Device Tree Source (post include)
+ *
+ * Copyright 2012 - 2015 Freescale Semiconductor Inc.
+ * Copyright 2021 NXP
+ *
+ */
+&soc {
+/include/ "qoriq-clockgen2.dtsi"
+/include/ "qoriq-gpio-0.dtsi"
+/include/ "qoriq-gpio-1.dtsi"
+/include/ "qoriq-gpio-2.dtsi"
+/include/ "qoriq-gpio-3.dtsi"
+
+/include/ "qoriq-fman3-0.dtsi"
+/include/ "qoriq-fman3-0-1g-0.dtsi"
+/include/ "qoriq-fman3-0-1g-1.dtsi"
+/include/ "qoriq-fman3-0-1g-2.dtsi"
+/include/ "qoriq-fman3-0-1g-3.dtsi"
+/include/ "qoriq-fman3-0-1g-4.dtsi"
+/include/ "qoriq-fman3-0-1g-5.dtsi"
+/include/ "qoriq-fman3-0-10g-0.dtsi"
+/include/ "qoriq-fman3-0-10g-1.dtsi"
+	fman at 400000 {
+		enet0: ethernet at e0000 {
+		};
+
+		enet1: ethernet at e2000 {
+		};
+
+		enet2: ethernet at e4000 {
+		};
+
+		enet3: ethernet at e6000 {
+		};
+
+		enet4: ethernet at e8000 {
+		};
+
+		enet5: ethernet at ea000 {
+		};
+
+		enet6: ethernet at f0000 {
+		};
+
+		enet7: ethernet at f2000 {
+		};
+
+		mdio at fc000 {
+			status = "disabled";
+		};
+
+		mdio at fd000 {
+			status = "disabled";
+		};
+	};
+
+/include/ "qoriq-fman3-1.dtsi"
+/include/ "qoriq-fman3-1-1g-0.dtsi"
+/include/ "qoriq-fman3-1-1g-1.dtsi"
+/include/ "qoriq-fman3-1-1g-2.dtsi"
+/include/ "qoriq-fman3-1-1g-3.dtsi"
+/include/ "qoriq-fman3-1-1g-4.dtsi"
+/include/ "qoriq-fman3-1-1g-5.dtsi"
+/include/ "qoriq-fman3-1-10g-0.dtsi"
+/include/ "qoriq-fman3-1-10g-1.dtsi"
+	fman at 500000 {
+		enet8: ethernet at e0000 {
+		};
+
+		enet9: ethernet at e2000 {
+		};
+
+		enet10: ethernet at e4000 {
+		};
+
+		enet11: ethernet at e6000 {
+		};
+
+		enet12: ethernet at e8000 {
+		};
+
+		enet13: ethernet at ea000 {
+		};
+
+		enet14: ethernet at f0000 {
+		};
+
+		enet15: ethernet at f2000 {
+		};
+
+		mdio at fc000 {
+			interrupts = <100 1 0 0>;
+		};
+
+		mdio at fd000 {
+			interrupts = <101 1 0 0>;
+		};
+	};
+};
Signature · 1 line
2.17.1
#6 lore raw

PATCH 6/11 powerpc: dts: t4240rdb: add FMan v3 nodes

In reply to Camelia Groza

Add the FMan v3 nodes for the T4240RDB. The nodes are copied over with little modification from the Linux kernel source code.

---
 arch/powerpc/dts/t4240rdb.dts | 142 +++++++++++++++++++++++++++++++++-
 1 file changed, 141 insertions(+), 1 deletion(-)
arch/powerpc/dts/t4240rdb.dts +141 -1
index 635065a03685..6d31675c5ead 100644
@@ -3,7 +3,7 @@
  * T4240RDB Device Tree Source
  *
  * Copyright 2013 - 2015 Freescale Semiconductor Inc.
- * Copyright 2019 NXP
+ * Copyright 2019-2021 NXP
  */
 
 /include/ "t4240.dtsi"
@@ -20,6 +20,144 @@
 	};
 };
 
+&soc {
+	fman at 400000 {
+		ethernet at e0000 {
+			phy-handle = <&sgmiiphy21>;
+			phy-connection-type = "sgmii";
+		};
+
+		ethernet at e2000 {
+			phy-handle = <&sgmiiphy22>;
+			phy-connection-type = "sgmii";
+		};
+
+		ethernet at e4000 {
+			phy-handle = <&sgmiiphy23>;
+			phy-connection-type = "sgmii";
+		};
+
+		ethernet at e6000 {
+			phy-handle = <&sgmiiphy24>;
+			phy-connection-type = "sgmii";
+		};
+
+		ethernet at e8000 {
+			status = "disabled";
+		};
+
+		ethernet at ea000 {
+			status = "disabled";
+		};
+
+		ethernet at f0000 {
+			phy-handle = <&xfiphy1>;
+			phy-connection-type = "xgmii";
+		};
+
+		ethernet at f2000 {
+			phy-handle = <&xfiphy2>;
+			phy-connection-type = "xgmii";
+		};
+	};
+
+	fman at 500000 {
+		ethernet at e0000 {
+			phy-handle = <&sgmiiphy41>;
+			phy-connection-type = "sgmii";
+		};
+
+		ethernet at e2000 {
+			phy-handle = <&sgmiiphy42>;
+			phy-connection-type = "sgmii";
+		};
+
+		ethernet at e4000 {
+			phy-handle = <&sgmiiphy43>;
+			phy-connection-type = "sgmii";
+		};
+
+		ethernet at e6000 {
+			phy-handle = <&sgmiiphy44>;
+			phy-connection-type = "sgmii";
+		};
+
+		ethernet at e8000 {
+			status = "disabled";
+		};
+
+		ethernet at ea000 {
+			status = "disabled";
+		};
+
+		ethernet at f0000 {
+			phy-handle = <&xfiphy3>;
+			phy-connection-type = "xgmii";
+		};
+
+		ethernet at f2000 {
+			phy-handle = <&xfiphy4>;
+			phy-connection-type = "xgmii";
+		};
+
+		mdio at fc000 {
+			sgmiiphy21: ethernet-phy at 0 {
+				reg = <0x0>;
+			};
+
+			sgmiiphy22: ethernet-phy at 1 {
+				reg = <0x1>;
+			};
+
+			sgmiiphy23: ethernet-phy at 2 {
+				reg = <0x2>;
+			};
+
+			sgmiiphy24: ethernet-phy at 3 {
+				reg = <0x3>;
+			};
+
+			sgmiiphy41: ethernet-phy at 4 {
+				reg = <0x4>;
+			};
+
+			sgmiiphy42: ethernet-phy at 5 {
+				reg = <0x5>;
+			};
+
+			sgmiiphy43: ethernet-phy at 6 {
+				reg = <0x6>;
+			};
+
+			sgmiiphy44: ethernet-phy at 7 {
+				reg = <0x7>;
+			};
+		};
+
+		mdio at fd000 {
+			xfiphy1: ethernet-phy at 10 {
+				compatible = "ethernet-phy-id13e5.1002";
+				reg = <0x10>;
+			};
+
+			xfiphy2: ethernet-phy at 11 {
+				compatible = "ethernet-phy-id13e5.1002";
+				reg = <0x11>;
+			};
+
+			xfiphy3: ethernet-phy at 13 {
+				compatible = "ethernet-phy-id13e5.1002";
+				reg = <0x13>;
+			};
+
+			xfiphy4: ethernet-phy at 12 {
+				compatible = "ethernet-phy-id13e5.1002";
+				reg = <0x12>;
+			};
+		};
+	};
+};
+
 &espi0 {
 	status = "okay";
 	flash at 0 {
@@ -30,3 +168,5 @@
 		spi-max-frequency = <10000000>; /* input clock */
 	};
 };
+
+/include/ "t4240si-post.dtsi"
Signature · 1 line
2.17.1
#7 lore raw

PATCH 7/11 powerpc: dts: qoriq: update the mdio offsets under the second FMan v3

In reply to Camelia Groza

When two FMan's are present on a board, the MDIO nodes are found at the same offsets inside each FMan. This causes "non unique device name" errors when registering the MDIO nodes under the second FMan. Fix this by updating the offsets of the MDIO nodes to include the parent FMan's offset.

---
 arch/powerpc/dts/qoriq-fman3-1-10g-0.dtsi | 2 +-
 arch/powerpc/dts/qoriq-fman3-1-10g-1.dtsi | 2 +-
 arch/powerpc/dts/qoriq-fman3-1-1g-0.dtsi  | 2 +-
 arch/powerpc/dts/qoriq-fman3-1-1g-1.dtsi  | 2 +-
 arch/powerpc/dts/qoriq-fman3-1-1g-2.dtsi  | 2 +-
 arch/powerpc/dts/qoriq-fman3-1-1g-3.dtsi  | 2 +-
 arch/powerpc/dts/qoriq-fman3-1-1g-4.dtsi  | 2 +-
 arch/powerpc/dts/qoriq-fman3-1-1g-5.dtsi  | 2 +-
 arch/powerpc/dts/qoriq-fman3-1.dtsi       | 4 ++--
 arch/powerpc/dts/t4240rdb.dts             | 4 ++--
 arch/powerpc/dts/t4240si-post.dtsi        | 4 ++--
 11 files changed, 14 insertions(+), 14 deletions(-)
arch/powerpc/dts/qoriq-fman3-1-10g-0.dtsi +1 -1
index 889c8d450e09..65bb8a4b0b63 100644
@@ -30,7 +30,7 @@ fman at 500000 {
 		pcsphy-handle = <&pcsphy14>;
 	};
 
-	mdio at f1000 {
+	mdio at 5f1000 {
 		#address-cells = <1>;
 		#size-cells = <0>;
 		compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
arch/powerpc/dts/qoriq-fman3-1-10g-1.dtsi +1 -1
index 2e456983372c..eb39d29b39fa 100644
@@ -30,7 +30,7 @@ fman at 500000 {
 		pcsphy-handle = <&pcsphy15>;
 	};
 
-	mdio at f3000 {
+	mdio at 5f3000 {
 		#address-cells = <1>;
 		#size-cells = <0>;
 		compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
arch/powerpc/dts/qoriq-fman3-1-1g-0.dtsi +1 -1
index b4ff19bf495a..2f2209dbc9bb 100644
@@ -29,7 +29,7 @@ fman at 500000 {
 		pcsphy-handle = <&pcsphy8>;
 	};
 
-	mdio at e1000 {
+	mdio at 5e1000 {
 		#address-cells = <1>;
 		#size-cells = <0>;
 		compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
arch/powerpc/dts/qoriq-fman3-1-1g-1.dtsi +1 -1
index 239c56ad1f62..11653c58b5f0 100644
@@ -29,7 +29,7 @@ fman at 500000 {
 		pcsphy-handle = <&pcsphy9>;
 	};
 
-	mdio at e3000 {
+	mdio at 5e3000 {
 		#address-cells = <1>;
 		#size-cells = <0>;
 		compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
arch/powerpc/dts/qoriq-fman3-1-1g-2.dtsi +1 -1
index 6e2bb009d9aa..ae27c7bc6df2 100644
@@ -29,7 +29,7 @@ fman at 500000 {
 		pcsphy-handle = <&pcsphy10>;
 	};
 
-	mdio at e5000 {
+	mdio at 5e5000 {
 		#address-cells = <1>;
 		#size-cells = <0>;
 		compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
arch/powerpc/dts/qoriq-fman3-1-1g-3.dtsi +1 -1
index 29dd94ba7498..55ae5499176e 100644
@@ -29,7 +29,7 @@ fman at 500000 {
 		pcsphy-handle = <&pcsphy11>;
 	};
 
-	mdio at e7000 {
+	mdio at 5e7000 {
 		#address-cells = <1>;
 		#size-cells = <0>;
 		compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
arch/powerpc/dts/qoriq-fman3-1-1g-4.dtsi +1 -1
index a5b493582703..833cf3e23d8e 100644
@@ -29,7 +29,7 @@ fman at 500000 {
 		pcsphy-handle = <&pcsphy12>;
 	};
 
-	mdio at e9000 {
+	mdio at 5e9000 {
 		#address-cells = <1>;
 		#size-cells = <0>;
 		compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
arch/powerpc/dts/qoriq-fman3-1-1g-5.dtsi +1 -1
index 486c84bf9810..81da55dfbe26 100644
@@ -29,7 +29,7 @@ fman at 500000 {
 		pcsphy-handle = <&pcsphy13>;
 	};
 
-	mdio at eb000 {
+	mdio at 5eb000 {
 		#address-cells = <1>;
 		#size-cells = <0>;
 		compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
arch/powerpc/dts/qoriq-fman3-1.dtsi +2 -2
index d8609c3ecfdb..9efcf26c4abc 100644
@@ -61,14 +61,14 @@ fman1: fman at 500000 {
 		reg = <0x87000 0x1000>;
 	};
 
-	mdio1: mdio at fc000 {
+	mdio1: mdio at 5fc000 {
 		#address-cells = <1>;
 		#size-cells = <0>;
 		compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
 		reg = <0xfc000 0x1000>;
 	};
 
-	mdio at fd000 {
+	mdio at 5fd000 {
 		#address-cells = <1>;
 		#size-cells = <0>;
 		compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
arch/powerpc/dts/t4240rdb.dts +2 -2
index 6d31675c5ead..b3251e330de9 100644
@@ -100,7 +100,7 @@
 			phy-connection-type = "xgmii";
 		};
 
-		mdio at fc000 {
+		mdio at 5fc000 {
 			sgmiiphy21: ethernet-phy at 0 {
 				reg = <0x0>;
 			};
@@ -134,7 +134,7 @@
 			};
 		};
 
-		mdio at fd000 {
+		mdio at 5fd000 {
 			xfiphy1: ethernet-phy at 10 {
 				compatible = "ethernet-phy-id13e5.1002";
 				reg = <0x10>;
arch/powerpc/dts/t4240si-post.dtsi +2 -2
index f614d19965d3..a596f48b54fe 100644
@@ -90,11 +90,11 @@
 		enet15: ethernet at f2000 {
 		};
 
-		mdio at fc000 {
+		mdio at 5fc000 {
 			interrupts = <100 1 0 0>;
 		};
 
-		mdio at fd000 {
+		mdio at 5fd000 {
 			interrupts = <101 1 0 0>;
 		};
 	};
Signature · 1 line
2.17.1
#8 lore raw

PATCH 8/11 configs: T4240RDB: enable DM_ETH

In reply to Camelia Groza

Enable DM_ETH and DM_MDIO for the T4240RDB.

---
 configs/T4240RDB_SDCARD_defconfig | 3 +++
 configs/T4240RDB_defconfig        | 3 +++
 2 files changed, 6 insertions(+)
configs/T4240RDB_SDCARD_defconfig +3 -0
index 61670fa3d14d..2def90140f2e 100644
@@ -28,6 +28,7 @@ CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
@@ -59,6 +60,8 @@ CONFIG_PHYLIB_10G=y
 CONFIG_PHY_CORTINA=y
 CONFIG_PHY_TERANETICS=y
 CONFIG_PHY_VITESSE=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
 CONFIG_FMAN_ENET=y
configs/T4240RDB_defconfig +3 -0
index 2c8a2f0ef271..8a0c122833f5 100644
@@ -15,6 +15,7 @@ CONFIG_BOARD_EARLY_INIT_R=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
@@ -47,6 +48,8 @@ CONFIG_PHYLIB_10G=y
 CONFIG_PHY_CORTINA=y
 CONFIG_PHY_TERANETICS=y
 CONFIG_PHY_VITESSE=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
 CONFIG_FMAN_ENET=y
Signature · 1 line
2.17.1
#9 lore raw

PATCH 9/11 powerpc: dts: t1042: add QorIQ DPAA 1 FMan v3 nodes

In reply to Camelia Groza

Add the QorIQ DPAA 1 FMan v3 device tree nodes for the T1042 SoC. The device tree nodes are copied over with little modification from the Linux kernel source code.

---
 arch/powerpc/dts/t1042si-post.dtsi | 46 ++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 arch/powerpc/dts/t1042si-post.dtsi
arch/powerpc/dts/t1042si-post.dtsi new file +46 -0
new file mode 100644
index 000000000000..5c60944e607b
@@ -0,0 +1,46 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
+/*
+ * T1042 Silicon/SoC Device Tree Source (post include)
+ *
+ * Copyright 2013 - 2014 Freescale Semiconductor Inc.
+ * Copyright 2021 NXP
+ *
+ */
+&soc {
+/include/ "qoriq-clockgen2.dtsi"
+/include/ "qoriq-gpio-0.dtsi"
+/include/ "qoriq-gpio-1.dtsi"
+/include/ "qoriq-gpio-2.dtsi"
+/include/ "qoriq-gpio-3.dtsi"
+
+/include/ "qoriq-fman3l-0.dtsi"
+/include/ "qoriq-fman3-0-1g-0.dtsi"
+/include/ "qoriq-fman3-0-1g-1.dtsi"
+/include/ "qoriq-fman3-0-1g-2.dtsi"
+/include/ "qoriq-fman3-0-1g-3.dtsi"
+/include/ "qoriq-fman3-0-1g-4.dtsi"
+	fman at 400000 {
+		enet0: ethernet at e0000 {
+		};
+
+		enet1: ethernet at e2000 {
+		};
+
+		enet2: ethernet at e4000 {
+		};
+
+		enet3: ethernet at e6000 {
+		};
+
+		enet4: ethernet at e8000 {
+		};
+
+		mdio at fc000 {
+			interrupts = <100 1 0 0>;
+		};
+
+		mdio at fd000 {
+			status = "disabled";
+		};
+	};
+};
Signature · 1 line
2.17.1
#10 lore raw

PATCH 10/11 powerpc: dts: t1042d4rdb: add FMan v3 nodes

In reply to Camelia Groza

Add the FMan v3 nodes for the T1042D4RDB. The nodes are copied over with little modification from the Linux kernel source code.

---
 arch/powerpc/dts/t1042d4rdb.dts | 55 ++++++++++++++++++++++++++++++++-
 1 file changed, 54 insertions(+), 1 deletion(-)
arch/powerpc/dts/t1042d4rdb.dts +54 -1
index 3584c06aa8d6..5e9fab7a1057 100644
@@ -3,7 +3,7 @@
  * T1042D4RDB Device Tree Source
  *
  * Copyright 2013 - 2015 Freescale Semiconductor Inc.
- * Copyright 2019 NXP
+ * Copyright 2019-2021 NXP
  */
 
 /include/ "t104x.dtsi"
@@ -20,6 +20,57 @@
 	};
 };
 
+&soc {
+	fman0: fman at 400000 {
+		ethernet at e0000 {
+			phy-handle = <&phy_sgmii_0>;
+			phy-connection-type = "sgmii";
+		};
+
+		ethernet at e2000 {
+			phy-handle = <&phy_sgmii_1>;
+			phy-connection-type = "sgmii";
+		};
+
+		ethernet at e4000 {
+			phy-handle = <&phy_sgmii_2>;
+			phy-connection-type = "sgmii";
+		};
+
+		ethernet at e6000 {
+			phy-handle = <&phy_rgmii_0>;
+			phy-connection-type = "rgmii";
+		};
+
+		ethernet at e8000 {
+			phy-handle = <&phy_rgmii_1>;
+			phy-connection-type = "rgmii";
+		};
+
+		mdio0: mdio at fc000 {
+			phy_sgmii_0: ethernet-phy at 2 {
+				reg = <0x02>;
+			};
+
+			phy_sgmii_1: ethernet-phy at 3 {
+				reg = <0x03>;
+			};
+
+			phy_sgmii_2: ethernet-phy at 1 {
+				reg = <0x01>;
+			};
+
+			phy_rgmii_0: ethernet-phy at 4 {
+				reg = <0x04>;
+			};
+
+			phy_rgmii_1: ethernet-phy at 5 {
+				reg = <0x05>;
+			};
+		};
+	};
+};
+
 &espi0 {
 	status = "okay";
 	flash at 0 {
@@ -30,3 +81,5 @@
 		spi-max-frequency = <10000000>; /* input clock */
 	};
 };
+
+/include/ "t1042si-post.dtsi"
Signature · 1 line
2.17.1
#11 lore raw

PATCH 11/11 configs: T1042D4RDB: enable DM_ETH

In reply to Camelia Groza

Enable DM_ETH and DM_MDIO for the T1042D4RDB.

---
 configs/T1042D4RDB_NAND_defconfig        | 3 +++
 configs/T1042D4RDB_SDCARD_defconfig      | 3 +++
 configs/T1042D4RDB_SECURE_BOOT_defconfig | 4 +++-
 configs/T1042D4RDB_SPIFLASH_defconfig    | 3 +++
 configs/T1042D4RDB_defconfig             | 3 +++
 5 files changed, 15 insertions(+), 1 deletion(-)
configs/T1042D4RDB_NAND_defconfig +3 -0
index bdfd0ef71b71..54bcc2f0821c 100644
@@ -33,6 +33,7 @@ CONFIG_SPL_NAND_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
@@ -66,6 +67,8 @@ CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_REALTEK=y
 CONFIG_PHY_VITESSE=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
 CONFIG_FMAN_ENET=y
configs/T1042D4RDB_SDCARD_defconfig +3 -0
index 9094327edeaa..853a3d65ae1c 100644
@@ -31,6 +31,7 @@ CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
@@ -63,6 +64,8 @@ CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_REALTEK=y
 CONFIG_PHY_VITESSE=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
 CONFIG_FMAN_ENET=y
configs/T1042D4RDB_SECURE_BOOT_defconfig +3 -1
index ef097bab8979..a59082c49a16 100644
@@ -17,6 +17,7 @@ CONFIG_BOARD_EARLY_INIT_R=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
@@ -45,8 +46,9 @@ CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_REALTEK=y
 CONFIG_PHY_VITESSE=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_PHY_GIGE=y
-CONFIG_E1000=y
 CONFIG_FMAN_ENET=y
 CONFIG_MII=y
 CONFIG_SYS_QE_FMAN_FW_IN_NOR=y
configs/T1042D4RDB_SPIFLASH_defconfig +3 -0
index bc59866b551e..cef5295748a1 100644
@@ -33,6 +33,7 @@ CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
@@ -65,6 +66,8 @@ CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_REALTEK=y
 CONFIG_PHY_VITESSE=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
 CONFIG_FMAN_ENET=y
configs/T1042D4RDB_defconfig +3 -0
index f968a448e927..85e2beab0200 100644
@@ -18,6 +18,7 @@ CONFIG_BOARD_EARLY_INIT_R=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
@@ -51,6 +52,8 @@ CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_REALTEK=y
 CONFIG_PHY_VITESSE=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
 CONFIG_FMAN_ENET=y
Signature · 1 line
2.17.1