]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
econet: en7528: add GPIO and LED support for DASAN H660GM-A
authorAhmed Naseef <naseefkm@gmail.com>
Sat, 7 Feb 2026 12:02:25 +0000 (16:02 +0400)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 15 Feb 2026 00:12:52 +0000 (01:12 +0100)
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 <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21326
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/econet/dts/en7528.dtsi
target/linux/econet/dts/en7528_dasan_h660gm-a.dts
target/linux/econet/en751221/config-6.12
target/linux/econet/en7528/config-6.12
target/linux/econet/en7528/target.mk
target/linux/econet/patches-6.12/320-gpio-en7523-enable-for-econet-mips.patch [new file with mode: 0644]

index f6232ed37c9ec018342e5bba66aace3f4ac75913..66d302a739c690efd85a23e625561a06fcef02db 100644 (file)
                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>,
index 1065e24fbb78fcb26463a071370366eb1adeefe7..69fd912377f2ec93f962e6c9bb0a8cf9e14407fa 100644 (file)
@@ -3,10 +3,21 @@
 
 #include "en7528.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
 / {
        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>;
                stdout-path = "/serial@1fbf0000:115200";
                linux,usable-memory-range = <0x00020000 0x0ffe0000>;
        };
+
+       leds {
+               compatible = "gpio-leds";
+
+               led_power: pwr {
+                       color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_POWER;
+                       gpios = <&gpio0 29 GPIO_ACTIVE_LOW>;
+               };
+
+               led_pon_green: pon-green {
+                       color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_STATUS;
+                       gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
+               };
+
+               led_pon_red: pon-red {
+                       color = <LED_COLOR_ID_RED>;
+                       function = LED_FUNCTION_STATUS;
+                       gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
+               };
+
+               led_auth: auth {
+                       color = <LED_COLOR_ID_RED>;
+                       function = LED_FUNCTION_INDICATOR;
+                       gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
+               };
+
+               led_internet: internet {
+                       color = <LED_COLOR_ID_GREEN>;
+                       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 = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_WPS;
+                       gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
+               };
+
+               led_lan1: lan1 {
+                       color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_LAN;
+                       function-enumerator = <1>;
+                       gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
+               };
+
+               led_lan2: lan2 {
+                       color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_LAN;
+                       function-enumerator = <2>;
+                       gpios = <&gpio1 3 GPIO_ACTIVE_LOW>;
+               };
+
+               led_lan3: lan3 {
+                       color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_LAN;
+                       function-enumerator = <3>;
+                       gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
+               };
+
+               led_lan4: lan4 {
+                       color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_LAN;
+                       function-enumerator = <4>;
+                       gpios = <&gpio0 31 GPIO_ACTIVE_LOW>;
+               };
+
+               led_wlan24: wlan2g {
+                       color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_WLAN_2GHZ;
+                       gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "phy0tpt";
+               };
+
+               led_wlan5: wlan5g {
+                       color = <LED_COLOR_ID_BLUE>;
+                       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_RESTART>;
+               };
+
+               key-wps {
+                       label = "wps";
+                       gpios = <&gpio0 30 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_WPS_BUTTON>;
+               };
+       };
 };
 
 &gmac0 {
index e9137a0e9fc4c587328bdcb3372dc1c258e65227..57f4208e2823adc03c1155ced1fd486bf7681878 100644 (file)
@@ -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
index 0680fdfb37cec0b48a33cb818c558d5624259457..4dc701fe7708d0a04bdac1f8445686215d04fecf 100644 (file)
@@ -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
index 1f174f70ed8e6c90b3331c7c9e710f5946f15aa3..e5e29d915d23e77b26813138faf5a242f8bb1177 100644 (file)
@@ -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 (file)
index 0000000..09e86ff
--- /dev/null
@@ -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 <naseefkm@gmail.com>
+--- 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