[PATCH 2/3] ARM: dts: BCM53573: Describe BCM53125 switch ports in the main DTS

Rafał Miłecki zajec5 at gmail.com
Sun Jul 23 12:54:15 PDT 2023


From: Rafał Miłecki <rafal at milecki.pl>

BCM53125 always has 5 ports with GPHYs (for LAN/WAN ports) and 2 IMP
ports. It seems the best place to describe that in the main .dtsi.
Device specific bits can go to device .dts files. This will help
avoiding some code duplication.

Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
---
 .../boot/dts/broadcom/bcm47189-tenda-ac9.dts  |  7 -----
 arch/arm/boot/dts/broadcom/bcm53573.dtsi      | 26 ++++++++++++++++++-
 2 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/arch/arm/boot/dts/broadcom/bcm47189-tenda-ac9.dts b/arch/arm/boot/dts/broadcom/bcm47189-tenda-ac9.dts
index 06b1a582809c..3ac6cac541ca 100644
--- a/arch/arm/boot/dts/broadcom/bcm47189-tenda-ac9.dts
+++ b/arch/arm/boot/dts/broadcom/bcm47189-tenda-ac9.dts
@@ -111,34 +111,27 @@ &switch {
 
 	ports {
 		port at 0 {
-			reg = <0>;
 			label = "wan";
 		};
 
 		port at 1 {
-			reg = <1>;
 			label = "lan1";
 		};
 
 		port at 2 {
-			reg = <2>;
 			label = "lan2";
 		};
 
 		port at 3 {
-			reg = <3>;
 			label = "lan3";
 		};
 
 		port at 4 {
-			reg = <4>;
 			label = "lan4";
 		};
 
 		port at 8 {
-			reg = <8>;
 			label = "cpu";
-			ethernet = <&gmac0>;
 		};
 	};
 };
diff --git a/arch/arm/boot/dts/broadcom/bcm53573.dtsi b/arch/arm/boot/dts/broadcom/bcm53573.dtsi
index eed1a6147f0b..083304736fb3 100644
--- a/arch/arm/boot/dts/broadcom/bcm53573.dtsi
+++ b/arch/arm/boot/dts/broadcom/bcm53573.dtsi
@@ -192,10 +192,34 @@ switch: switch at 1e {
 
 					status = "disabled";
 
-					/* ports are defined in board DTS */
 					ports {
 						#address-cells = <1>;
 						#size-cells = <0>;
+
+						port at 0 {
+							reg = <0>;
+						};
+
+						port at 1 {
+							reg = <1>;
+						};
+
+						port at 2 {
+							reg = <2>;
+						};
+
+						port at 3 {
+							reg = <3>;
+						};
+
+						port at 4 {
+							reg = <4>;
+						};
+
+						port at 8 {
+							reg = <8>;
+							ethernet = <&gmac0>;
+						};
 					};
 				};
 			};
-- 
2.35.3




More information about the linux-arm-kernel mailing list