Skip to contentSkip to conversation

riscv: dts: spacemit: Add ethernet device for K3

PATCH Superseded Inochi Amaoto 1 participant 1 message Mar 18

Subsystems (5)

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 riscv: dts: spacemit: Add ethernet device for K3

Add all ethernet device nodes for K3 SoC.

---
Require the following patch series:
1. Basic DT device patch
https://lore.kernel.org/spacemit/[email protected]
2. Ethernet driver patch
https://lore.kernel.org/spacemit/[email protected]

Changed from v1:
1. remove interrupt-parents property
2. add aliases for ethernet node

---
 arch/riscv/boot/dts/spacemit/k3-pico-itx.dts |  25 +++++
 arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi |  48 +++++++++
 arch/riscv/boot/dts/spacemit/k3.dtsi         | 104 +++++++++++++++++++
 3 files changed, 177 insertions(+)
 create mode 100644 arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi
arch/riscv/boot/dts/spacemit/k3-pico-itx.dts +25 -0
index b691304d4b74..c19d6ee51702 100644
@@ -4,7 +4,10 @@
  * Copyright (c) 2026 Guodong Xu <[email protected]>
  */
 
+#include <dt-bindings/gpio/gpio.h>
+
 #include "k3.dtsi"
+#include "k3-pinctrl.dtsi"
 
 / {
 	model = "SpacemiT K3 Pico-ITX";
@@ -12,6 +15,9 @@ / {
 
 	aliases {
 		serial0 = &uart0;
+		ethernet0 = &eth0;
+		ethernet1 = &eth1;
+		ethernet2 = &eth2;
 	};
 
 	chosen {
@@ -24,6 +30,25 @@ memory@100000000 {
 	};
 };
 
+&eth0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&gmac0_cfg>;
+
+	phy-mode = "rgmii-id";
+	phy-handle = <&phy0>;
+	status = "okay";
+
+	mdio {
+		phy0: phy@1 {
+			compatible = "ethernet-phy-ieee802.3-c22";
+			reg = <1>;
+			reset-gpios = <&gpio 0 15 GPIO_ACTIVE_LOW>;
+			reset-assert-us = <10000>;
+			reset-deassert-us = <10000>;
+		};
+	};
+};
+
 &uart0 {
 	status = "okay";
 };
arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi new file +48 -0

48 lines not on this page · raw message

arch/riscv/boot/dts/spacemit/k3.dtsi +104 -0

116 lines not on this page · raw message

--
2.53.0