diff options
| author | Ahmed Naseef | 2026-02-07 12:02:25 +0000 |
|---|---|---|
| committer | Hauke Mehrtens | 2026-02-15 00:12:52 +0000 |
| commit | a14d81d46580704e7fab178944a2a9fe580662d7 (patch) | |
| tree | 0747086bbe254d2c58437a8e19e1998d128df23c | |
| parent | 32df0bdf5909feac99cbf8e9f4df8fabd7c37dc4 (diff) | |
| download | nbd-a14d81d46580704e7fab178944a2a9fe580662d7.tar.gz | |
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 <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21326
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
| -rw-r--r-- | target/linux/econet/dts/en7528.dtsi | 20 | ||||
| -rw-r--r-- | target/linux/econet/dts/en7528_dasan_h660gm-a.dts | 125 | ||||
| -rw-r--r-- | target/linux/econet/en751221/config-6.12 | 3 | ||||
| -rw-r--r-- | target/linux/econet/en7528/config-6.12 | 4 | ||||
| -rw-r--r-- | target/linux/econet/en7528/target.mk | 2 | ||||
| -rw-r--r-- | target/linux/econet/patches-6.12/320-gpio-en7523-enable-for-econet-mips.patch | 17 |
6 files changed, 170 insertions, 1 deletions
diff --git a/target/linux/econet/dts/en7528.dtsi b/target/linux/econet/dts/en7528.dtsi index f6232ed37c..66d302a739 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 1065e24fbb..69fd912377 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 <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>; @@ -16,6 +27,120 @@ 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 { diff --git a/target/linux/econet/en751221/config-6.12 b/target/linux/econet/en751221/config-6.12 index e9137a0e9f..57f4208e28 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 0680fdfb37..4dc701fe77 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 1f174f70ed..e5e29d915d 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 0000000000..09e86ff5c9 --- /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 <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 |