From: Ahmed Naseef Date: Sat, 7 Feb 2026 12:02:25 +0000 (+0400) Subject: econet: en7528: add GPIO and LED support for DASAN H660GM-A X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a14d81d46580704e7fab178944a2a9fe580662d7;p=thirdparty%2Fopenwrt.git econet: en7528: add GPIO and LED support for DASAN H660GM-A Enable the Airoha EN7523 GPIO driver for EN7528 and add GPIO controller nodes to the EN7528 DTSI. Add LED, button and GPIO definitions for the DASAN H660GM-A board. Signed-off-by: Ahmed Naseef Link: https://github.com/openwrt/openwrt/pull/21326 Signed-off-by: Hauke Mehrtens --- diff --git a/target/linux/econet/dts/en7528.dtsi b/target/linux/econet/dts/en7528.dtsi index f6232ed37c9..66d302a739c 100644 --- a/target/linux/econet/dts/en7528.dtsi +++ b/target/linux/econet/dts/en7528.dtsi @@ -57,6 +57,26 @@ interrupts = <2>; }; + gpio0: gpio@1fbf0200 { + compatible = "airoha,en7523-gpio"; + reg = <0x1fbf0204 0x4>, + <0x1fbf0200 0x4>, + <0x1fbf0220 0x4>, + <0x1fbf0214 0x4>; + gpio-controller; + #gpio-cells = <2>; + }; + + gpio1: gpio@1fbf0270 { + compatible = "airoha,en7523-gpio"; + reg = <0x1fbf0270 0x4>, + <0x1fbf0260 0x4>, + <0x1fbf0264 0x4>, + <0x1fbf0278 0x4>; + gpio-controller; + #gpio-cells = <2>; + }; + scu: system-controller@1fb00000 { compatible = "airoha,en7523-scu"; reg = <0x1fa20000 0x400>, diff --git a/target/linux/econet/dts/en7528_dasan_h660gm-a.dts b/target/linux/econet/dts/en7528_dasan_h660gm-a.dts index 1065e24fbb7..69fd912377f 100644 --- a/target/linux/econet/dts/en7528_dasan_h660gm-a.dts +++ b/target/linux/econet/dts/en7528_dasan_h660gm-a.dts @@ -3,10 +3,21 @@ #include "en7528.dtsi" +#include +#include +#include + / { model = "DASAN H660GM-A"; compatible = "dasan,h660gm-a", "econet,en7528"; + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + memory@0 { device_type = "memory"; reg = <0x00000000 0x10000000>; @@ -16,6 +27,120 @@ stdout-path = "/serial@1fbf0000:115200"; linux,usable-memory-range = <0x00020000 0x0ffe0000>; }; + + leds { + compatible = "gpio-leds"; + + led_power: pwr { + color = ; + function = LED_FUNCTION_POWER; + gpios = <&gpio0 29 GPIO_ACTIVE_LOW>; + }; + + led_pon_green: pon-green { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio0 3 GPIO_ACTIVE_LOW>; + }; + + led_pon_red: pon-red { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio1 0 GPIO_ACTIVE_LOW>; + }; + + led_auth: auth { + color = ; + function = LED_FUNCTION_INDICATOR; + gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + }; + + led_internet: internet { + color = ; + function = LED_FUNCTION_WAN; + gpios = <&gpio0 4 GPIO_ACTIVE_LOW>; + }; + + led_tel: tel { + label = "green:tel"; + gpios = <&gpio0 5 GPIO_ACTIVE_LOW>; + }; + + led_wps: wps { + color = ; + function = LED_FUNCTION_WPS; + gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; + }; + + led_lan1: lan1 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <1>; + gpios = <&gpio1 5 GPIO_ACTIVE_LOW>; + }; + + led_lan2: lan2 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <2>; + gpios = <&gpio1 3 GPIO_ACTIVE_LOW>; + }; + + led_lan3: lan3 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <3>; + gpios = <&gpio1 1 GPIO_ACTIVE_LOW>; + }; + + led_lan4: lan4 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <4>; + gpios = <&gpio0 31 GPIO_ACTIVE_LOW>; + }; + + led_wlan24: wlan2g { + color = ; + function = LED_FUNCTION_WLAN_2GHZ; + gpios = <&gpio1 2 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led_wlan5: wlan5g { + color = ; + function = LED_FUNCTION_WLAN_5GHZ; + gpios = <&gpio1 4 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; + + gpio_export { + compatible = "gpio-export"; + + usb-power { + gpio-export,name = "usb-power"; + gpio-export,output = <1>; + gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <100>; + + key-reset { + label = "reset"; + gpios = <&gpio0 0 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + key-wps { + label = "wps"; + gpios = <&gpio0 30 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; }; &gmac0 { diff --git a/target/linux/econet/en751221/config-6.12 b/target/linux/econet/en751221/config-6.12 index e9137a0e9fc..57f4208e282 100644 --- a/target/linux/econet/en751221/config-6.12 +++ b/target/linux/econet/en751221/config-6.12 @@ -75,6 +75,7 @@ CONFIG_GENERIC_SCHED_CLOCK=y CONFIG_GENERIC_SMP_IDLE_THREAD=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GPIO_CDEV=y +# CONFIG_GPIO_EN7523 is not set CONFIG_HARDWARE_WATCHPOINTS=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y @@ -146,7 +147,6 @@ CONFIG_RATIONAL=y CONFIG_RESET_CONTROLLER=y CONFIG_RFS_ACCEL=y CONFIG_RPS=y -CONFIG_RUSTC_HAS_UNNECESSARY_TRANSMUTES=y # CONFIG_SERIAL_8250_AIROHA is not set CONFIG_SERIAL_MCTRL_GPIO=y CONFIG_SERIAL_OF_PLATFORM=y @@ -168,6 +168,7 @@ CONFIG_SYS_HAS_EARLY_PRINTK=y CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y CONFIG_SYS_SUPPORTS_ARBIT_HZ=y CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y +CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y CONFIG_SYS_SUPPORTS_MIPS16=y CONFIG_SYS_SUPPORTS_SMP=y CONFIG_SYS_SUPPORTS_ZBOOT=y diff --git a/target/linux/econet/en7528/config-6.12 b/target/linux/econet/en7528/config-6.12 index 0680fdfb37c..4dc701fe770 100644 --- a/target/linux/econet/en7528/config-6.12 +++ b/target/linux/econet/en7528/config-6.12 @@ -77,7 +77,10 @@ CONFIG_GENERIC_PCI_IOMAP=y CONFIG_GENERIC_SCHED_CLOCK=y CONFIG_GENERIC_SMP_IDLE_THREAD=y CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_GPIOLIB_IRQCHIP=y CONFIG_GPIO_CDEV=y +CONFIG_GPIO_EN7523=y +CONFIG_GPIO_GENERIC=y CONFIG_HARDWARE_WATCHPOINTS=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y @@ -92,6 +95,7 @@ CONFIG_IRQ_FORCED_THREADING=y CONFIG_IRQ_MIPS_CPU=y CONFIG_IRQ_WORK=y # CONFIG_JFFS2_FS is not set +CONFIG_LEDS_GPIO=y CONFIG_LIBFDT=y CONFIG_LOCK_DEBUGGING_SUPPORT=y CONFIG_LZO_COMPRESS=y diff --git a/target/linux/econet/en7528/target.mk b/target/linux/econet/en7528/target.mk index 1f174f70ed8..e5e29d915d2 100644 --- a/target/linux/econet/en7528/target.mk +++ b/target/linux/econet/en7528/target.mk @@ -6,6 +6,8 @@ BOARDNAME:=EN7528 based boards CPU_TYPE:=24kc KERNELNAME:=vmlinuz.bin +DEFAULT_PACKAGES += kmod-leds-gpio kmod-gpio-button-hotplug + define Target/Description Build firmware images for EcoNet EN7528 based boards. endef diff --git a/target/linux/econet/patches-6.12/320-gpio-en7523-enable-for-econet-mips.patch b/target/linux/econet/patches-6.12/320-gpio-en7523-enable-for-econet-mips.patch new file mode 100644 index 00000000000..09e86ff5c9f --- /dev/null +++ b/target/linux/econet/patches-6.12/320-gpio-en7523-enable-for-econet-mips.patch @@ -0,0 +1,17 @@ +gpio: en7523: enable for EcoNet MIPS platform + +The Airoha EN7523 GPIO controller is also found on EcoNet EN7528 +MIPS SoC. Allow building the driver when ECONET is selected. + +Signed-off-by: Ahmed Naseef +--- a/drivers/gpio/Kconfig ++++ b/drivers/gpio/Kconfig +@@ -271,7 +271,7 @@ config GPIO_EM + + config GPIO_EN7523 + tristate "Airoha GPIO support" +- depends on ARCH_AIROHA ++ depends on ARCH_AIROHA || ECONET + default ARCH_AIROHA + select GPIO_GENERIC + select GPIOLIB_IRQCHIP