From: Rosen Penev Date: Tue, 11 Jun 2024 22:37:37 +0000 (-0700) Subject: ath79: trendnet,tew-823dru: use nvmem X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=refs%2Fpull%2F16287%2Fhead;p=thirdparty%2Fopenwrt.git ath79: trendnet,tew-823dru: use nvmem Removes deprecated userspace handling. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16287 Signed-off-by: Hauke Mehrtens --- diff --git a/target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts b/target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts index d2e381eb4b1..817ce3bf1e9 100644 --- a/target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts +++ b/target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts @@ -11,6 +11,7 @@ model = "TRENDNET TEW-823DRU"; aliases { + label-mac-device = ð1; led-boot = &led_power_green; led-failsafe = &led_power_green; led-running = &led_power_green; @@ -64,6 +65,13 @@ &pcie0 { status = "okay"; + + wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0 0 0 0 0>; + nvmem-cells = <&maccaddr_mac_wan 1>; + nvmem-cell-names = "mac-address"; + }; }; &pcie1 { @@ -133,6 +141,24 @@ label = "mac"; reg = <0xfe0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + maccaddr_mac_lan: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x11>; + #nvmem-cell-cells = <1>; + }; + + maccaddr_mac_wan: macaddr@18 { + compatible = "mac-base"; + reg = <0x18 0x11>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@ff0000 { @@ -172,6 +198,9 @@ ð0 { status = "okay"; + nvmem-cells = <&maccaddr_mac_lan 0>; + nvmem-cell-names = "mac-address"; + phy-handle = <&phy0>; pll-data = <0x56000000 0x00000101 0x00001616>; @@ -184,6 +213,9 @@ ð1 { status = "okay"; + nvmem-cells = <&maccaddr_mac_wan 0>; + nvmem-cell-names = "mac-address"; + pll-data = <0x03000101 0x00000101 0x00001616>; fixed-link { @@ -195,6 +227,6 @@ &wmac { status = "okay"; - nvmem-cells = <&cal_art_1000>; - nvmem-cell-names = "calibration"; + nvmem-cells = <&cal_art_1000>, <&maccaddr_mac_lan 0>; + nvmem-cell-names = "calibration", "mac-address"; }; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 545bc14e366..f38eaa78666 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -846,11 +846,6 @@ ath79_setup_macs() base_mac=$(mtd_get_mac_binary info 0x8) wan_mac=$(macaddr_add "$base_mac" 1) ;; - trendnet,tew-823dru) - lan_mac=$(mtd_get_mac_text mac 0x4) - wan_mac=$(mtd_get_mac_text mac 0x18) - label_mac=$wan_mac - ;; ubnt,powerbridge-m|\ ubnt,rocket-m|\ ubnt,unifi) 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 4dfc67e280c..9b5593b9728 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 @@ -112,14 +112,6 @@ case "$board" in [ "$PHYNBR" -eq 1 ] && \ macaddr_add $base_mac 1 > /sys${DEVPATH}/macaddress ;; - trendnet,tew-823dru) - # set the 2.4G interface mac address to LAN MAC - [ "$PHYNBR" -eq 1 ] && \ - mtd_get_mac_text mac 4 > /sys${DEVPATH}/macaddress - # set the 5G interface mac address to WAN MAC + 1 - [ "$PHYNBR" -eq 0 ] && \ - macaddr_add "$(mtd_get_mac_text mac 0x18)" 1 > /sys${DEVPATH}/macaddress - ;; zyxel,nwa1123-ac) [ "$PHYNBR" -eq 0 ] && \ mtd_get_mac_text mib0 0x66 > /sys${DEVPATH}/macaddress