]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
econet: en7528: add basic ethernet support
authorAhmed Naseef <naseefkm@gmail.com>
Sat, 7 Feb 2026 10:51:53 +0000 (14:51 +0400)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 15 Feb 2026 00:12:52 +0000 (01:12 +0100)
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 <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21326
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
package/kernel/econet-eth/Makefile
target/linux/econet/Makefile
target/linux/econet/dts/en7528.dtsi
target/linux/econet/dts/en7528_dasan_h660gm-a.dts
target/linux/econet/dts/en7528_generic.dts
target/linux/econet/en7528/config-6.12

index d6440f84779174686ed8678995f0ca212c6d03b4..356d006d293c3494186df3e8b394cdfe57a9b626 100644 (file)
@@ -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
index f3e8af3945c23d483857c6d055a51135458f37b8..aa8ba09c0f85d514226ef6002fdfe26e45a43598 100644 (file)
@@ -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))
index 78eab98ed817757862ccd2f21aa19cc446f22f66..f6232ed37c9ec018342e5bba66aace3f4ac75913 100644 (file)
@@ -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";
                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>,
 
                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";
+               };
+       };
 };
index 7614b71ada78661aeabda6ffbfe9ca2c6e9f87da..1065e24fbb78fcb26463a071370366eb1adeefe7 100644 (file)
        };
 };
 
+&gmac0 {
+       status = "okay";
+       nvmem-cells = <&macaddr_dzs 7>;
+       nvmem-cell-names = "mac-address";
+};
+
 &nand {
        status = "okay";
        econet,bmt;
                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 {
index 2a3835eb2b17767c1607d9958d23354951fb71eb..d4d25266e3481c625732924287b045a43c2e5071 100644 (file)
        };
 };
 
+&gmac0 {
+       status = "okay";
+};
+
 &nand {
        status = "okay";
 
index c956eb06494493cf2a89d26f27133323cec59cc4..0680fdfb37cec0b48a33cb818c558d5624259457 100644 (file)
@@ -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