public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: airoha: en7581: Add switch node to to EN7581 SoC
@ 2026-03-09 15:03 Lorenzo Bianconi
  2026-03-09 18:36 ` Andrew Lunn
  0 siblings, 1 reply; 3+ messages in thread
From: Lorenzo Bianconi @ 2026-03-09 15:03 UTC (permalink / raw)
  To: Matthias Brugger, AngeloGioacchino Del Regno, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-arm-kernel, linux-mediatek, devicetree, Lorenzo Bianconi

Introduce dsa switch controller node to EN7581 SoC and EN7581
evaluation board.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 arch/arm64/boot/dts/airoha/en7581-evb.dts | 18 +++++++
 arch/arm64/boot/dts/airoha/en7581.dtsi    | 88 +++++++++++++++++++++++++++++++
 2 files changed, 106 insertions(+)

diff --git a/arch/arm64/boot/dts/airoha/en7581-evb.dts b/arch/arm64/boot/dts/airoha/en7581-evb.dts
index 886e2e4b5f64ce1a2a5496d35b8379fb4ac27dc2..4c6fca99ae62ec8202e211e18311f2ab7e18d2e5 100644
--- a/arch/arm64/boot/dts/airoha/en7581-evb.dts
+++ b/arch/arm64/boot/dts/airoha/en7581-evb.dts
@@ -81,6 +81,18 @@ conf {
 			drive-open-drain = <1>;
 		};
 	};
+
+	mdio_pins: mdio-pins {
+		mux {
+			function = "mdio";
+			groups = "mdio";
+		};
+
+		conf {
+			pins = "gpio2";
+			output-high;
+		};
+	};
 };
 
 &pcie0 {
@@ -106,3 +118,9 @@ &eth {
 &gdm1 {
 	status = "okay";
 };
+
+&switch {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mdio_pins>;
+	status = "okay";
+};
diff --git a/arch/arm64/boot/dts/airoha/en7581.dtsi b/arch/arm64/boot/dts/airoha/en7581.dtsi
index ff6908a76e8eb6cf91343495d1fe531a868e41fb..caabb07a7f689e3ad67742f32d3575dfc45e9061 100644
--- a/arch/arm64/boot/dts/airoha/en7581.dtsi
+++ b/arch/arm64/boot/dts/airoha/en7581.dtsi
@@ -395,5 +395,93 @@ fixed-link {
 				};
 			};
 		};
+
+		switch: switch@1fb58000 {
+			compatible = "airoha,en7581-switch";
+			reg = <0 0x1fb58000 0 0x8000>;
+			resets = <&scuclk EN7581_GSW_RST>;
+
+			interrupt-controller;
+			#interrupt-cells = <1>;
+			interrupt-parent = <&gic>;
+			interrupts = <GIC_SPI 209 IRQ_TYPE_LEVEL_HIGH>;
+
+			status = "disabled";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				gsw_port1: port@1 {
+					reg = <1>;
+					label = "lan1";
+					phy-mode = "internal";
+					phy-handle = <&gsw_phy1>;
+				};
+
+				gsw_port2: port@2 {
+					reg = <2>;
+					label = "lan2";
+					phy-mode = "internal";
+					phy-handle = <&gsw_phy2>;
+				};
+
+				gsw_port3: port@3 {
+					reg = <3>;
+					label = "lan3";
+					phy-mode = "internal";
+					phy-handle = <&gsw_phy3>;
+				};
+
+				gsw_port4: port@4 {
+					reg = <4>;
+					label = "lan4";
+					phy-mode = "internal";
+					phy-handle = <&gsw_phy4>;
+				};
+
+				port@6 {
+					reg = <6>;
+					label = "cpu";
+					ethernet = <&gdm1>;
+					phy-mode = "internal";
+
+					fixed-link {
+						speed = <10000>;
+						full-duplex;
+						pause;
+					};
+				};
+			};
+
+			mdio: mdio {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				gsw_phy1: ethernet-phy@1 {
+					compatible = "ethernet-phy-ieee802.3-c22";
+					reg = <9>;
+					phy-mode = "internal";
+				};
+
+				gsw_phy2: ethernet-phy@2 {
+					compatible = "ethernet-phy-ieee802.3-c22";
+					reg = <10>;
+					phy-mode = "internal";
+				};
+
+				gsw_phy3: ethernet-phy@3 {
+					compatible = "ethernet-phy-ieee802.3-c22";
+					reg = <11>;
+					phy-mode = "internal";
+				};
+
+				gsw_phy4: ethernet-phy@4 {
+					compatible = "ethernet-phy-ieee802.3-c22";
+					reg = <12>;
+					phy-mode = "internal";
+				};
+			};
+		};
 	};
 };

---
base-commit: 405c09548a695ca7be58b5b9d3ac8388630e907f
change-id: 20260309-airoha-7581-dsa-switch-ffb0f2dfe4c0

Best regards,
-- 
Lorenzo Bianconi <lorenzo@kernel.org>



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

* Re: [PATCH] arm64: dts: airoha: en7581: Add switch node to to EN7581 SoC
  2026-03-09 15:03 [PATCH] arm64: dts: airoha: en7581: Add switch node to to EN7581 SoC Lorenzo Bianconi
@ 2026-03-09 18:36 ` Andrew Lunn
  2026-03-09 19:48   ` Lorenzo Bianconi
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Lunn @ 2026-03-09 18:36 UTC (permalink / raw)
  To: Lorenzo Bianconi
  Cc: Matthias Brugger, AngeloGioacchino Del Regno, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, linux-arm-kernel,
	linux-mediatek, devicetree

> +				gsw_phy1: ethernet-phy@1 {
> +					compatible = "ethernet-phy-ieee802.3-c22";
> +					reg = <9>;

The @1 should match the reg value. So this is wrong.

> +					phy-mode = "internal";

phy-mode is actually a MAC property, not a PHY property. It is not
listed in
Documentation/devicetree/bindings/net/ethernet-phy.yaml. Which also
suggest this has not been tested using the DT validation tools.

	Andrew



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

* Re: [PATCH] arm64: dts: airoha: en7581: Add switch node to to EN7581 SoC
  2026-03-09 18:36 ` Andrew Lunn
@ 2026-03-09 19:48   ` Lorenzo Bianconi
  0 siblings, 0 replies; 3+ messages in thread
From: Lorenzo Bianconi @ 2026-03-09 19:48 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Matthias Brugger, AngeloGioacchino Del Regno, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, linux-arm-kernel,
	linux-mediatek, devicetree

[-- Attachment #1: Type: text/plain, Size: 706 bytes --]

> > +				gsw_phy1: ethernet-phy@1 {
> > +					compatible = "ethernet-phy-ieee802.3-c22";
> > +					reg = <9>;
> 
> The @1 should match the reg value. So this is wrong.

ack, I will fix it in v2.

> 
> > +					phy-mode = "internal";
> 
> phy-mode is actually a MAC property, not a PHY property. It is not
> listed in
> Documentation/devicetree/bindings/net/ethernet-phy.yaml. Which also
> suggest this has not been tested using the DT validation tools.

ack, right. I guess this just a leftover of a previous implementation, I will
remove it in v2. Anyway I compiled the dts with the command below:

$make CHECK_DTBS=y W=1 airoha/en7581-evb.dtb

Regards,
Lorenzo

> 
> 	Andrew
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

end of thread, other threads:[~2026-03-09 19:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-09 15:03 [PATCH] arm64: dts: airoha: en7581: Add switch node to to EN7581 SoC Lorenzo Bianconi
2026-03-09 18:36 ` Andrew Lunn
2026-03-09 19:48   ` Lorenzo Bianconi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox