From 374f065ecb373679419392b60e7b0ec86659d69a Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 11 Sep 2025 20:27:51 -0700 Subject: [PATCH] ath79: tiny: use nvmem for engenius devices Userspace handling is deprecated. Also convert custom LED to one handled by ath9k. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/20112 Signed-off-by: Hauke Mehrtens --- .../ath79/dts/ar7240_engenius_enh202-v1.dts | 27 ++++++++--------- .../ath79/dts/ar7242_engenius_eap350-v1.dts | 29 ++++++++----------- .../ath79/dts/ar7242_engenius_ecb350-v1.dts | 27 +++++++---------- .../etc/hotplug.d/firmware/10-ath9k-eeprom | 5 ---- 4 files changed, 35 insertions(+), 53 deletions(-) diff --git a/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts b/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts index 11e9c6853f..18f29838ac 100644 --- a/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts +++ b/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts @@ -62,17 +62,6 @@ gpios = <&gpio 17 GPIO_ACTIVE_LOW>; }; }; - - ath9k-leds { - compatible = "gpio-leds"; - - wlan { - function = LED_FUNCTION_WLAN; - color = ; - gpios = <&ath9k 1 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy0tpt"; - }; - }; }; ð0 { @@ -90,12 +79,16 @@ &pcie { status = "okay"; - ath9k: wifi@0,0 { + wifi@0,0 { compatible = "pci168c,002a"; reg = <0x0000 0 0 0 0>; - qca,no-eeprom; - #gpio-cells = <2>; - gpio-controller; + nvmem-cells = <&cal_art_1000>; + nvmem-cell-names = "calibration"; + + led { + led-sources = <1>; + led-active-low; + }; }; }; @@ -108,5 +101,9 @@ macaddr_art_0: macaddr@0 { reg = <0x0 0x6>; }; + + cal_art_1000: calibration@1000 { + reg = <0x1000 0xeb8>; + }; }; }; diff --git a/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts b/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts index 4c618956ac..08ffd69042 100644 --- a/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts +++ b/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts @@ -40,17 +40,6 @@ default-state = "on"; }; }; - - ath9k-leds { - compatible = "gpio-leds"; - - wlan { - function = LED_FUNCTION_WLAN; - color = ; - gpios = <&ath9k 1 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy0tpt"; - }; - }; }; &mdio0 { @@ -78,14 +67,16 @@ &pcie { status = "okay"; - ath9k: wifi@0,0 { + wifi@0,0 { compatible = "pci168c,002a"; reg = <0x0 0 0 0 0>; - nvmem-cells = <&macaddr_art_0 1>; - nvmem-cell-names = "mac-address"; - qca,no-eeprom; - #gpio-cells = <2>; - gpio-controller; + nvmem-cells = <&cal_art_1000>, <&macaddr_art_0 1>; + nvmem-cell-names = "calibration", "mac-address"; + + led { + led-sources = <1>; + led-active-low; + }; }; }; @@ -100,5 +91,9 @@ reg = <0x0 0x6>; #nvmem-cell-cells = <1>; }; + + cal_art_1000: calibration@1000 { + reg = <0x1000 0xeb8>; + }; }; }; diff --git a/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts b/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts index 024cce6f0f..13d8d33511 100644 --- a/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts +++ b/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts @@ -40,17 +40,6 @@ default-state = "on"; }; }; - - ath9k-leds { - compatible = "gpio-leds"; - - wlan { - function = LED_FUNCTION_WLAN; - color = ; - gpios = <&ath9k 1 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy0tpt"; - }; - }; }; &mdio0 { @@ -81,11 +70,13 @@ ath9k: wifi@0,0 { compatible = "pci168c,002a"; reg = <0x0 0 0 0 0>; - nvmem-cells = <&macaddr_art_0 (-1)>; - nvmem-cell-names = "mac-address"; - qca,no-eeprom; - #gpio-cells = <2>; - gpio-controller; + nvmem-cells = <&cal_art_1000>, <&macaddr_art_0 (-1)>; + nvmem-cell-names = "calibration", "mac-address"; + + led { + led-sources = <1>; + led-active-low; + }; }; }; @@ -100,5 +91,9 @@ reg = <0x0 0x6>; #nvmem-cell-cells = <1>; }; + + cal_art_1000: calibration@1000 { + reg = <0x1000 0xeb8>; + }; }; }; diff --git a/target/linux/ath79/tiny/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/tiny/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index ccbaafda72..5e9ff10eba 100644 --- a/target/linux/ath79/tiny/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/tiny/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -9,11 +9,6 @@ board=$(board_name) case "$FIRMWARE" in "ath9k-eeprom-pci-0000:00:00.0.bin") case $board in - engenius,eap350-v1|\ - engenius,ecb350-v1|\ - engenius,enh202-v1) - caldata_extract "art" 0x1000 0xeb8 - ;; netgear,wnr2000-v3|\ ubnt,airrouter|\ ubnt,bullet-m-ar7240|\ -- 2.30.2