From eeaefcc560f82c94999323dbc017384a1a61297a Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 16 Jun 2024 12:32:45 -0700 Subject: [PATCH] ath79: moxa,awk-1137c: use nvmem for calibration Userspace handling is deprecated. MAC address handling will have to wait as there's no support for variables other than ethaddr currently. Signed-off-by: Rosen Penev --- target/linux/ath79/dts/ar9344_moxa_awk-1137c.dts | 14 +++++++++++++- .../etc/hotplug.d/firmware/10-ath9k-eeprom | 4 ---- .../etc/hotplug.d/ieee80211/10_fix_wifi_mac | 4 ++++ 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/target/linux/ath79/dts/ar9344_moxa_awk-1137c.dts b/target/linux/ath79/dts/ar9344_moxa_awk-1137c.dts index d67e9f2a52c..50d00dd0883 100644 --- a/target/linux/ath79/dts/ar9344_moxa_awk-1137c.dts +++ b/target/linux/ath79/dts/ar9344_moxa_awk-1137c.dts @@ -157,6 +157,16 @@ label = "art"; reg = <0xfe0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + }; }; partition@ff0000 { @@ -174,5 +184,7 @@ &wmac { status = "okay"; - qca,no-eeprom; + + nvmem-cells = <&cal_art_1000>; + nvmem-cell-names = "calibration"; }; diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index fec73b37682..46a10d36007 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -27,10 +27,6 @@ case "$FIRMWARE" in caldata_extract "art" 0x1000 0x440 ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env ethaddr) ;; - moxa,awk-1137c) - caldata_extract "art" 0x1000 0x440 - ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env mac_addr) - ;; *) caldata_die "board $board is not supported yet" ;; diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index e0f8be4660c..fc64b5235d9 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -98,6 +98,10 @@ case "$board" in [ "$PHYNBR" -eq 1 ] && \ mtd_get_mac_ascii devdata wlan5mac > /sys${DEVPATH}/macaddress ;; + moxa,awk-1137c) + [ "$PHYNBR" -eq 0 ] && \ + mtd_get_mac_ascii u-boot-env mac_addr > /sys${DEVPATH}/macaddress + ;; phicomm,k2t) [ "$PHYNBR" -eq 0 ] && \ k2t_get_mac "5g_mac" > /sys${DEVPATH}/macaddress