[U-Boot] [PATCH 3/3] net: mscc: ocelot: Update DTS for Ocelot pcb120.

Horatiu Vultur horatiu.vultur at microchip.com
Wed Apr 24 09:27:59 UTC 2019


Update device tree for ocelot to add support for ocelot pcb120.

Signed-off-by: Horatiu Vultur <horatiu.vultur at microchip.com>
---
 MAINTAINERS                            |   1 +
 arch/mips/dts/mscc,ocelot.dtsi         | 109 +++++++++++++--------------------
 arch/mips/dts/ocelot_pcb120.dts        |  75 +++++++++++++++++++++++
 arch/mips/dts/ocelot_pcb123.dts        |  44 +++++++++----
 include/dt-bindings/mscc/ocelot_data.h |  19 ++++++
 5 files changed, 167 insertions(+), 81 deletions(-)
 create mode 100644 include/dt-bindings/mscc/ocelot_data.h

diff --git a/MAINTAINERS b/MAINTAINERS
index c77abba..a6e40be 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -568,6 +568,7 @@ F:	configs/mscc*
 F:	drivers/gpio/mscc_sgpio.c
 F:	drivers/spi/mscc_bb_spi.c
 F:	include/configs/vcoreiii.h
+F:	include/dt-bindings/mscc/
 F:	drivers/pinctrl/mscc/
 F:	drivers/net/mscc_eswitch/
 
diff --git a/arch/mips/dts/mscc,ocelot.dtsi b/arch/mips/dts/mscc,ocelot.dtsi
index 4f3fe35..9a187b6 100644
--- a/arch/mips/dts/mscc,ocelot.dtsi
+++ b/arch/mips/dts/mscc,ocelot.dtsi
@@ -112,32 +112,33 @@
 			status = "disabled";
 		};
 
-		switch at 1010000 {
+		switch: switch at 1010000 {
 			pinctrl-0 = <&miim1_pins>;
 			pinctrl-names = "default";
 
 			compatible = "mscc,vsc7514-switch";
-			reg = <0x1010000 0x10000>, /* VTSS_TO_SYS */
-			      <0x1030000 0x10000>, /* VTSS_TO_REW */
-			      <0x1080000 0x100>, /* VTSS_TO_DEVCPU_QS */
-			      <0x10d0000 0x10000>, /* VTSS_TO_HSIO */
-			      <0x11e0000 0x100>, /* VTSS_TO_DEV_0 */
-			      <0x11f0000 0x100>, /* VTSS_TO_DEV_1 */
-			      <0x1200000 0x100>, /* VTSS_TO_DEV_2 */
-			      <0x1210000 0x100>, /* VTSS_TO_DEV_3 */
-			      <0x1220000 0x100>, /* VTSS_TO_DEV_4 */
-			      <0x1230000 0x100>, /* VTSS_TO_DEV_5 */
-			      <0x1240000 0x100>, /* VTSS_TO_DEV_6 */
-			      <0x1250000 0x100>, /* VTSS_TO_DEV_7 */
-			      <0x1260000 0x100>, /* VTSS_TO_DEV_8 */
-			      <0x1270000 0x100>, /* NA */
-			      <0x1280000 0x100>, /* NA */
-			      <0x1800000 0x80000>, /* VTSS_TO_QSYS */
-			      <0x1880000 0x10000>; /* VTSS_TO_ANA */
-			reg-names = "sys", "rew", "qs", "hsio", "port0",
-				    "port1", "port2", "port3", "port4", "port5",
-				    "port6", "port7", "port8", "port9",
-				    "port10", "qsys", "ana";
+
+			reg = <0x11e0000 0x100>, // VTSS_TO_DEV_0
+			      <0x11f0000 0x100>, // VTSS_TO_DEV_1
+			      <0x1200000 0x100>, // VTSS_TO_DEV_2
+			      <0x1210000 0x100>, // VTSS_TO_DEV_3
+			      <0x1220000 0x100>, // VTSS_TO_DEV_4
+			      <0x1230000 0x100>, // VTSS_TO_DEV_5
+			      <0x1240000 0x100>, // VTSS_TO_DEV_6
+			      <0x1250000 0x100>, // VTSS_TO_DEV_7
+			      <0x1260000 0x100>, // VTSS_TO_DEV_8
+			      <0x1270000 0x100>, // VTSS_TO_DEV_9
+			      <0x1280000 0x100>, // VTSS_TO_DEV_10
+			      <0x1010000 0x10000>, // VTSS_TO_SYS
+			      <0x1030000 0x10000>, // VTSS_TO_REW
+			      <0x1080000 0x100>, // VTSS_TO_DEVCPU_QS
+			      <0x10d0000 0x10000>, // VTSS_TO_HSIO
+			      <0x1800000 0x80000>,// VTSS_TO_QSYS
+			      <0x1880000 0x10000>;// VTSS_TO_ANA
+			reg-names = "port0", "port1", "port2", "port3", "port4",
+				    "port5", "port6", "port7", "port8", "port9",
+				    "port10",
+				    "sys", "rew", "qs", "hsio", "qsys", "ana";
 			interrupts = <21 22>;
 			interrupt-names = "xtr", "inj";
 			status = "okay";
@@ -145,40 +146,6 @@
 			ethernet-ports {
 				#address-cells = <1>;
 				#size-cells = <0>;
-
-				port0: port at 0 {
-					reg = <0>;
-				};
-				port1: port at 1 {
-					reg = <1>;
-				};
-				port2: port at 2 {
-					reg = <2>;
-				};
-				port3: port at 3 {
-					reg = <3>;
-				};
-				port4: port at 4 {
-					reg = <4>;
-				};
-				port5: port at 5 {
-					reg = <5>;
-				};
-				port6: port at 6 {
-					reg = <6>;
-				};
-				port7: port at 7 {
-					reg = <7>;
-				};
-				port8: port at 8 {
-					reg = <8>;
-				};
-				port9: port at 9 {
-					reg = <9>;
-				};
-				port10: port at 10 {
-					reg = <10>;
-				};
 			};
 		};
 
@@ -186,21 +153,27 @@
 			#address-cells = <1>;
 			#size-cells = <0>;
 			compatible = "mscc,ocelot-miim";
-			reg = <0x107009c 0x24>, <0x10700f0 0x8>;
+			reg = <0x107009c 0x24>;
 			interrupts = <14>;
 			status = "disabled";
+		};
 
-			phy0: ethernet-phy at 0 {
-				reg = <0>;
-			};
-			phy1: ethernet-phy at 1 {
-				reg = <1>;
-			};
-			phy2: ethernet-phy at 2 {
-				reg = <2>;
-			};
-			phy3: ethernet-phy at 3 {
-				reg = <3>;
+		mdio1: mdio at 10700f0 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "mscc,ocelot-miim";
+			reg = <0x10700c0 0x24>;
+			interrupts = <14>;
+			status = "disabled";
+		};
+
+		hsio: syscon at 10d0000 {
+			compatible = "mscc,ocelot-hsio", "syscon", "simple-mfd";
+			reg = <0x10d0000 0x10000>;
+
+			serdes_hsio: serdes_hsio {
+				compatible = "mscc,vsc7514-serdes";
+				#phy-cells = <3>;
 			};
 		};
 
diff --git a/arch/mips/dts/ocelot_pcb120.dts b/arch/mips/dts/ocelot_pcb120.dts
index 658719e..e608029 100644
--- a/arch/mips/dts/ocelot_pcb120.dts
+++ b/arch/mips/dts/ocelot_pcb120.dts
@@ -5,6 +5,7 @@
 
 /dts-v1/;
 #include "mscc,ocelot_pcb.dtsi"
+#include <dt-bindings/mscc/ocelot_data.h>
 
 / {
 	model = "Ocelot PCB120 Reference Board";
@@ -86,3 +87,77 @@
 	mscc,sgpio-ports = <0x000FFFFF>;
 };
 
+&mdio0 {
+	status = "okay";
+
+	phy4: ethernet-phy at 4 {
+		reg = <3>;
+	};
+	phy5: ethernet-phy at 5 {
+		reg = <2>;
+	};
+	phy6: ethernet-phy at 6 {
+		reg = <1>;
+	};
+	phy7: ethernet-phy at 7 {
+		reg = <0>;
+	};
+};
+
+&mdio1 {
+	status = "okay";
+
+	phy0: ethernet-phy at 0 {
+		reg = <3>;
+	};
+	phy1: ethernet-phy at 1 {
+		reg = <2>;
+	};
+	phy2: ethernet-phy at 2 {
+		reg = <1>;
+	};
+	phy3: ethernet-phy at 3 {
+		reg = <0>;
+	};
+};
+
+&switch {
+	ethernet-ports {
+		port0: port at 0 {
+			reg = <5>;
+			phy-handle = <&phy0>;
+			phys = <&serdes_hsio 5 SERDES1G(2) PHY_MODE_SGMII>;
+		};
+		port1: port at 1 {
+			reg = <9>;
+			phy-handle = <&phy1>;
+			phys = <&serdes_hsio 9 SERDES1G(3) PHY_MODE_SGMII>;
+		};
+		port2: port at 2 {
+			reg = <6>;
+			phy-handle = <&phy2>;
+			phys = <&serdes_hsio 6 SERDES1G(4) PHY_MODE_SGMII>;
+		};
+		port3: port at 3 {
+			reg = <4>;
+			phy-handle = <&phy3>;
+			phys = <&serdes_hsio 4 SERDES1G(5) PHY_MODE_SGMII>;
+		};
+		port4: port at 4 {
+			reg = <3>;
+			phy-handle = <&phy4>;
+		};
+		port5: port at 5 {
+			reg = <2>;
+			phy-handle = <&phy5>;
+		};
+		port6: port at 6 {
+			reg = <1>;
+			phy-handle = <&phy6>;
+		};
+		port7: port at 7 {
+			reg = <0>;
+			phy-handle = <&phy7>;
+		};
+	};
+};
diff --git a/arch/mips/dts/ocelot_pcb123.dts b/arch/mips/dts/ocelot_pcb123.dts
index a4fa370..1b0156e 100644
--- a/arch/mips/dts/ocelot_pcb123.dts
+++ b/arch/mips/dts/ocelot_pcb123.dts
@@ -38,20 +38,38 @@
 
 &mdio0 {
 	status = "okay";
-};
-
-&port0 {
-	phy-handle = <&phy0>;
-};
 
-&port1 {
-	phy-handle = <&phy1>;
-};
-
-&port2 {
-	phy-handle = <&phy2>;
+	phy0: ethernet-phy at 0 {
+		reg = <0>;
+	};
+	phy1: ethernet-phy at 1 {
+		reg = <1>;
+	};
+	phy2: ethernet-phy at 2 {
+		reg = <2>;
+	};
+	phy3: ethernet-phy at 3 {
+		reg = <3>;
+	};
 };
 
-&port3 {
-	phy-handle = <&phy3>;
+&switch {
+	ethernet-ports {
+		port0: port at 0 {
+			reg = <2>;
+			phy-handle = <&phy2>;
+		};
+		port1: port at 1 {
+			reg = <3>;
+			phy-handle = <&phy3>;
+		};
+		port2: port at 2 {
+			reg = <0>;
+			phy-handle = <&phy0>;
+		};
+		port3: port at 3 {
+			reg = <1>;
+			phy-handle = <&phy1>;
+		};
+	};
 };
diff --git a/include/dt-bindings/mscc/ocelot_data.h b/include/dt-bindings/mscc/ocelot_data.h
new file mode 100644
index 0000000..7a5a1bf
--- /dev/null
+++ b/include/dt-bindings/mscc/ocelot_data.h
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
+/*
+ * Copyright (c) 2019 Microsemi Corporation
+ */
+
+#ifndef _OCELOT_DATA_H_
+#define _OCELOT_DATA_H_
+
+#define SERDES1G(x)     (x)
+#define SERDES1G_MAX    SERDES1G(7)
+#define SERDES6G(x)     (SERDES1G_MAX + 1 + (x))
+#define SERDES6G_MAX    SERDES6G(11)
+#define SERDES_MAX      (SERDES6G_MAX + 1)
+
+/* similar with phy_interface_t */
+#define PHY_MODE_SGMII  2
+#define PHY_MODE_QSGMII 4
+
+#endif
-- 
2.7.4



More information about the U-Boot mailing list