Răsfoiți Sursa

econet: en7528: add basic ethernet support

EN7528 shares the same clock/reset controller as EN7523. Enable
COMMON_CLK_EN7523 and RESET_CONTROLLER for ethernet hardware resets.
Update econet-eth driver and add it as default package.

Signed-off-by: Ahmed Naseef <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/21326
Signed-off-by: Hauke Mehrtens <[email protected]>
Ahmed Naseef 2 luni în urmă
părinte
comite
32df0bdf59

+ 3 - 3
package/kernel/econet-eth/Makefile

@@ -5,9 +5,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/cjdelisle/econet_eth.git
-PKG_MIRROR_HASH:=1d2e55a486d2573fe206fff8ec524af157455f6d7f8e00121da440bce551c28f
-PKG_SOURCE_DATE:=2026-01-15
-PKG_SOURCE_VERSION:=ea5f527f48aeb7aef914f9e4fce6cb173cb06640
+PKG_MIRROR_HASH:=b0136345b176f714e28397b8feba372234e9c87fb33879db2e413fb22c1c09c4
+PKG_SOURCE_DATE:=2026-01-27
+PKG_SOURCE_VERSION:=1db74f832563865680ae0b1c25c0a213bbcdf92c
 
 include $(INCLUDE_DIR)/kernel.mk
 include $(INCLUDE_DIR)/package.mk

+ 1 - 1
target/linux/econet/Makefile

@@ -19,6 +19,6 @@ endef
 include $(INCLUDE_DIR)/target.mk
 
 # nand-utils is used by base-files/sbin/en75_chboot
-DEFAULT_PACKAGES += nand-utils
+DEFAULT_PACKAGES += nand-utils kmod-econet-eth
 
 $(eval $(call BuildTarget))

+ 51 - 0
target/linux/econet/dts/en7528.dtsi

@@ -2,6 +2,8 @@
 /dts-v1/;
 
 #include <dt-bindings/interrupt-controller/mips-gic.h>
+#include <dt-bindings/clock/en7523-clk.h>
+#include <dt-bindings/reset/airoha,en7523-reset.h>
 
 / {
 	compatible = "econet,en7528";
@@ -55,6 +57,14 @@
 		interrupts = <2>;
 	};
 
+	scu: system-controller@1fb00000 {
+		compatible = "airoha,en7523-scu";
+		reg = <0x1fa20000 0x400>,
+		      <0x1fb00000 0x1000>;
+		#clock-cells = <1>;
+		#reset-cells = <1>;
+	};
+
 	timer_hpt: timer@1fbf0400 {
 		compatible = "econet,en7528-timer";
 		reg = <0x1fbf0400 0x14>,
@@ -100,4 +110,45 @@
 
 		clock-frequency = <7372800>;
 	};
+
+	ethernet: ethernet@1fb50000 {
+		compatible = "econet,en7528-eth";
+		reg = <0x1fb50000 0x10000>;
+
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		interrupt-parent = <&gic>;
+		interrupts = <GIC_SHARED 21 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SHARED 22 IRQ_TYPE_LEVEL_HIGH>;
+
+		resets = <&scu EN7523_FE_RST>,
+			 <&scu EN7523_FE_PDMA_RST>,
+			 <&scu EN7523_FE_QDMA_RST>,
+			 <&scu EN7523_GSW_RST>,
+			 <&scu EN7523_XPON_MAC_RST>,
+			 <&scu EN7523_XPON_PHY_RST>;
+		reset-names = "fe", "qdma0", "qdma1", "gsw",
+			      "xpon-mac", "xpon-phy";
+
+		gmac0: mac@0 {
+			compatible = "econet,eth-mac";
+			reg = <0>;
+			phy-mode = "trgmii";
+			status = "disabled";
+
+			fixed-link {
+				speed = <1000>;
+				full-duplex;
+				pause;
+			};
+		};
+
+		gmac1: mac@1 {
+			compatible = "econet,eth-mac";
+			reg = <1>;
+			phy-mode = "rgmii-rxid";
+			status = "disabled";
+		};
+	};
 };

+ 17 - 0
target/linux/econet/dts/en7528_dasan_h660gm-a.dts

@@ -18,6 +18,12 @@
 	};
 };
 
+&gmac0 {
+	status = "okay";
+	nvmem-cells = <&macaddr_dzs 7>;
+	nvmem-cell-names = "mac-address";
+};
+
 &nand {
 	status = "okay";
 	econet,bmt;
@@ -37,6 +43,17 @@
 		partition@40000 {
 			label = "dzs";
 			reg = <0x40000 0x40000>;
+			nvmem-layout {
+				compatible = "fixed-layout";
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				macaddr_dzs: macaddr@a {
+					compatible = "mac-base";
+					reg = <0xa 0x6>;
+					#nvmem-cell-cells = <1>;
+				};
+			};
 		};
 
 		partition@80000 {

+ 4 - 0
target/linux/econet/dts/en7528_generic.dts

@@ -24,6 +24,10 @@
 	};
 };
 
+&gmac0 {
+	status = "okay";
+};
+
 &nand {
 	status = "okay";
 

+ 2 - 1
target/linux/econet/en7528/config-6.12

@@ -8,7 +8,7 @@ CONFIG_BOARD_SCACHE=y
 CONFIG_CLKSRC_MMIO=y
 CONFIG_CLONE_BACKWARDS=y
 CONFIG_COMMON_CLK=y
-# CONFIG_COMMON_CLK_EN7523 is not set
+CONFIG_COMMON_CLK_EN7523=y
 CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1
 CONFIG_COMPAT_32BIT_TIME=y
 CONFIG_CONTEXT_TRACKING=y
@@ -159,6 +159,7 @@ CONFIG_RANDSTRUCT_NONE=y
 CONFIG_RATIONAL=y
 CONFIG_REGMAP=y
 CONFIG_REGMAP_MMIO=y
+CONFIG_RESET_CONTROLLER=y
 CONFIG_RFS_ACCEL=y
 CONFIG_RPS=y
 # CONFIG_SCHED_CORE is not set