]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
ath79: replace various mtd_get_mac_text 20176/head
authorRosen Penev <rosenp@gmail.com>
Fri, 14 Jun 2024 00:19:07 +0000 (17:19 -0700)
committerRobert Marko <robimarko@gmail.com>
Tue, 30 Sep 2025 09:21:18 +0000 (11:21 +0200)
Deprecated. Replaced with nvmem.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20176
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/ath79/dts/ar9342_zyxel_nwa1123-ac.dts
target/linux/ath79/dts/ar9342_zyxel_nwa1123-ni.dts
target/linux/ath79/dts/qca9531_dlink_dch-g020-a1.dts
target/linux/ath79/dts/qca9533_dlink_dap-13xx.dtsi
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 e3164259dfe9d8b3b7ae7ccb7a02c5136ec9b759..dc0b25e8e846d519879e27eec931f9575ceae384 100644 (file)
 
 &pcie {
        status = "okay";
+
+       wifi@0,0 {
+               compatible = "qcom,ath10k";
+               reg = <0x0000 0 0 0 0>;
+               nvmem-cells = <&macaddr_mib0_66 0>;
+               nvmem-cell-names = "mac-address";
+       };
 };
index cb5588c12231ee0d2d2345660db23a0cf91017f0..c27b0e5aa47ecabe9832dd7a43583f36bd7489ec 100644 (file)
 
 &pcie {
        status = "okay";
+
+       wifi@0,0 {
+               compatible = "pci168c,0030";
+               reg = <0x0000 0 0 0 0>;
+               nvmem-cells = <&macaddr_mib0_66 0>;
+               nvmem-cell-names = "mac-address";
+       };
 };
index 198b08c56ea3a2441e18fcd862bfb1620a75fe35..a77c4b7a898d501e70c15e144cb45309d27dfd15 100644 (file)
@@ -11,6 +11,7 @@
        model = "D-Link DCH-G020 A1";
 
        aliases {
+               label-mac-device = &eth0;
                led-boot = &led_power;
                led-failsafe = &led_power;
                led-running = &led_power;
                                label = "mp";
                                reg = <0x20000 0x10000>;
                                read-only;
+
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       macaddr_mp_1: macaddr@1 {
+                                               compatible = "mac-base";
+                                               reg = <0x1 0x11>;
+                                               #nvmem-cell-cells = <1>;
+                                       };
+
+                                       macaddr_mp_13: macaddr@13 {
+                                               compatible = "mac-base";
+                                               reg = <0x13 0x11>;
+                                               #nvmem-cell-cells = <1>;
+                                       };
+                               };
                        };
 
                        partition@30000 {
 
 &eth0 {
        status = "okay";
+
+       nvmem-cells = <&macaddr_mp_1 0>;
+       nvmem-cell-names = "mac-address";
 };
 
 &wmac {
        status = "okay";
 
-       nvmem-cells = <&cal_art_1000>;
-       nvmem-cell-names = "calibration";
+       nvmem-cells = <&cal_art_1000>, <&macaddr_mp_13 0>;
+       nvmem-cell-names = "calibration", "mac-address";
 };
index 0364cf2cd70a3434b7323db6879b25fa2faf3b51..be21bedbf8cc5197ac86186defed328693e6c916 100644 (file)
@@ -8,6 +8,7 @@
 
 / {
        aliases {
+               label-mac-device = &eth0;
                led-boot = &led_power;
                led-failsafe = &led_status;
                led-running = &led_power;
                                label = "mp";
                                reg = <0x20000 0x10000>;
                                read-only;
+
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       macaddr_mp_1: macaddr@1 {
+                                               compatible = "mac-base";
+                                               reg = <0x1 0x11>;
+                                               #nvmem-cell-cells = <1>;
+                                       };
+
+                                       macaddr_mp_13: macaddr@13 {
+                                               compatible = "mac-base";
+                                               reg = <0x13 0x11>;
+                                               #nvmem-cell-cells = <1>;
+                                       };
+                               };
                        };
 
                        partition@30000 {
 
 &eth0 {
        status = "okay";
+
+       nvmem-cells = <&macaddr_mp_1 0>;
+       nvmem-cell-names = "mac-address";
 };
 
 &wmac {
        status = "okay";
 
-       nvmem-cells = <&cal_art_1000>;
-       nvmem-cell-names = "calibration";
+       nvmem-cells = <&cal_art_1000>, <&macaddr_mp_13 0>;
+       nvmem-cell-names = "calibration", "mac-address";
 };
index 30ee6405b155ba9512813363fc0c0015b8ade40c..d1ba702340f558ce7ae3423a01532ec7962ce751 100644 (file)
@@ -689,12 +689,6 @@ ath79_setup_macs()
                plc_mac=$(mtd_get_mac_ascii art "protest_plc_mac")
                [ -n "$plc_mac" ] && ucidef_set_interface_macaddr "plc" $plc_mac
                ;;
-       dlink,dap-1330-a1|\
-       dlink,dap-1365-a1|\
-       dlink,dch-g020-a1)
-               lan_mac=$(mtd_get_mac_text "mp" 0x1)
-               label_mac=$lan_mac
-               ;;
        dlink,dap-2230-a1|\
        dlink,dap-2660-a1|\
        dlink,dap-2680-a1|\
index c4ae1c46b9534c48d54023d6235931b8f9ed67e6..f30cc438167ce0a5d7f5603232aabd07701f099e 100644 (file)
@@ -24,11 +24,6 @@ case "$board" in
                [ "$PHYNBR" -eq 1 ] && \
                        mtd_get_mac_ascii art "protest_ath0_mac" > /sys${DEVPATH}/macaddress
                ;;
-       dlink,dap-1330-a1|\
-       dlink,dap-1365-a1|\
-       dlink,dch-g020-a1)
-               mtd_get_mac_text "mp" 0x13 > /sys${DEVPATH}/macaddress
-               ;;
        dlink,dap-2230-a1|\
        dlink,dap-3320-a1)
                mtd_get_mac_ascii bdcfg "wlanmac" > /sys${DEVPATH}/macaddress
@@ -127,12 +122,4 @@ case "$board" in
                [ "$PHYNBR" -eq 1 ] && \
                        mtd_get_mac_ascii devdata wlan5mac > /sys${DEVPATH}/macaddress
                ;;
-       zyxel,nwa1123-ac)
-               [ "$PHYNBR" -eq 0 ] && \
-                       mtd_get_mac_text mib0 0x66 > /sys${DEVPATH}/macaddress
-               ;;
-       zyxel,nwa1123-ni)
-               [ "$PHYNBR" -eq 1 ] && \
-                       mtd_get_mac_text mib0 0x66 > /sys${DEVPATH}/macaddress
-               ;;
 esac