]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
ath79: trendnet,tew-823dru: use nvmem 16287/head
authorRosen Penev <rosenp@gmail.com>
Tue, 11 Jun 2024 22:37:37 +0000 (15:37 -0700)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 24 Aug 2025 14:41:37 +0000 (16:41 +0200)
Removes deprecated userspace handling.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16287
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts
target/linux/ath79/generic/base-files/etc/board.d/02_network
target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac

index d2e381eb4b1c5d9264ec6552401a4842867ae321..817ce3bf1e96e14310c89df58765425a2934c445 100644 (file)
@@ -11,6 +11,7 @@
        model = "TRENDNET TEW-823DRU";
 
        aliases {
+               label-mac-device = &eth1;
                led-boot = &led_power_green;
                led-failsafe = &led_power_green;
                led-running = &led_power_green;
 
 &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 {
                                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 {
 &eth0 {
        status = "okay";
 
+       nvmem-cells = <&maccaddr_mac_lan 0>;
+       nvmem-cell-names = "mac-address";
+
        phy-handle = <&phy0>;
        pll-data = <0x56000000 0x00000101 0x00001616>;
 
 &eth1 {
        status = "okay";
 
+       nvmem-cells = <&maccaddr_mac_wan 0>;
+       nvmem-cell-names = "mac-address";
+
        pll-data = <0x03000101 0x00000101 0x00001616>;
 
        fixed-link {
 &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";
 };
index 545bc14e36613fe88f6ea6001a8519662e3c7ef2..f38eaa786668146612e1b67423510edcf6b3a034 100644 (file)
@@ -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)
index 4dfc67e280cd25957a90f954e9f8ee2c03e3abfc..9b5593b9728993271670e114b038a83ff4f8089a 100644 (file)
@@ -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