Skip to contentSkip to conversation

riscv: dts: spacemit: k3: Add ethernet device node

PATCH Superseded Inochi Amaoto 1 participant 1 message Mar 4

Subsystems (5)

v1 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 riscv: dts: spacemit: k3: Add ethernet device node

Add all ethernet device nodes for K3 SoC. And enable the available ethernet device for the PICO ITX board.

---
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]

---
 arch/riscv/boot/dts/spacemit/k3-pico-itx.dts |  20 ++++
 arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi |  38 +++++++
 arch/riscv/boot/dts/spacemit/k3.dtsi         | 106 +++++++++++++++++++
 3 files changed, 164 insertions(+)
arch/riscv/boot/dts/spacemit/k3-pico-itx.dts +20 -0
index b098dbd0e7a1..47e4fa824417 100644
@@ -6,6 +6,7 @@
 
 #include "k3.dtsi"
 #include "k3-pinctrl.dtsi"
+#include <dt-bindings/gpio/gpio.h>
 
 / {
 	model = "SpacemiT K3 Pico-ITX";
@@ -25,6 +26,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 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_0_cfg>;
arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi +38 -0
index efb0f1572188..256880192846 100644
@@ -21,4 +21,42 @@ uart0-0-pins {
 			drive-strength = <25>;
 		};
 	};
+
+	gmac0_cfg: gmac0-cfg {
+		gmac0_base_pins: gmac0-0-pins {
+			pinmux = <K3_PADCONF(0, 1)>,
+				 <K3_PADCONF(1, 1)>,
+				 <K3_PADCONF(2, 1)>,
+				 <K3_PADCONF(3, 1)>,
+				 <K3_PADCONF(6, 1)>,
+				 <K3_PADCONF(7, 1)>,
+				 <K3_PADCONF(11, 1)>,
+				 <K3_PADCONF(12, 1)>,
+				 <K3_PADCONF(13, 1)>;
+
+			bias-disable;
+			drive-strength = <25>;
+			power-source = <1800>;
+		};
+
+		gmac0_rgmii_add_pins: gmac0-1-pins {
+			pinmux = <K3_PADCONF(4, 1)>,
+				 <K3_PADCONF(5, 1)>,
+				 <K3_PADCONF(8, 1)>,
+				 <K3_PADCONF(9, 1)>,
+				 <K3_PADCONF(10, 1)>;
+
+			bias-disable;
+			drive-strength = <25>;
+			power-source = <1800>;
+		};
+
+		gmac0_int_pins: gmac0-3-pins {
+			pinmux = <K3_PADCONF(14, 1)>;
+
+			bias-disable;
+			drive-strength = <25>;
+			power-source = <1800>;
+		};
+	};
 };
arch/riscv/boot/dts/spacemit/k3.dtsi +106 -0

112 lines not on this page · raw message

base-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
prerequisite-patch-id: 68c4d869548687dc115dd91e2ffb8f4c11482d86
prerequisite-patch-id: fdadcf964c2cb3406160edb579d99a8d5695f8e6
prerequisite-patch-id: 73b9e745338b0499b849fa4f7f9508987ab39a59
prerequisite-patch-id: cd26770c2160c3c31a406bd8a6b01ab666180ae0
prerequisite-patch-id: 93a515969fca3b15f827b3507979422dda14db8b
prerequisite-patch-id: a637cffacb823aa7ae91e03ed42831ef8fbd0d1f
prerequisite-patch-id: 40c49afe4eb71457913c45ddb720a9c8917aa827 --
2.53.0