Sfoglia il codice sorgente

ath79: replace various mtd_get_mac_text

Deprecated. Replaced with nvmem.

Signed-off-by: Rosen Penev <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20176
Signed-off-by: Robert Marko <[email protected]>
Rosen Penev 1 anno fa
parent
commit
6157a2aeb9

+ 7 - 0
target/linux/ath79/dts/ar9342_zyxel_nwa1123-ac.dts

@@ -36,4 +36,11 @@
 
 
 &pcie {
 &pcie {
 	status = "okay";
 	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";
+	};
 };
 };

+ 7 - 0
target/linux/ath79/dts/ar9342_zyxel_nwa1123-ni.dts

@@ -36,4 +36,11 @@
 
 
 &pcie {
 &pcie {
 	status = "okay";
 	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";
+	};
 };
 };

+ 24 - 2
target/linux/ath79/dts/qca9531_dlink_dch-g020-a1.dts

@@ -11,6 +11,7 @@
 	model = "D-Link DCH-G020 A1";
 	model = "D-Link DCH-G020 A1";
 
 
 	aliases {
 	aliases {
+		label-mac-device = &eth0;
 		led-boot = &led_power;
 		led-boot = &led_power;
 		led-failsafe = &led_power;
 		led-failsafe = &led_power;
 		led-running = &led_power;
 		led-running = &led_power;
@@ -129,6 +130,24 @@
 				label = "mp";
 				label = "mp";
 				reg = <0x20000 0x10000>;
 				reg = <0x20000 0x10000>;
 				read-only;
 				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 {
 			partition@30000 {
@@ -168,11 +187,14 @@
 
 
 &eth0 {
 &eth0 {
 	status = "okay";
 	status = "okay";
+
+	nvmem-cells = <&macaddr_mp_1 0>;
+	nvmem-cell-names = "mac-address";
 };
 };
 
 
 &wmac {
 &wmac {
 	status = "okay";
 	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";
 };
 };

+ 24 - 2
target/linux/ath79/dts/qca9533_dlink_dap-13xx.dtsi

@@ -8,6 +8,7 @@
 
 
 / {
 / {
 	aliases {
 	aliases {
+		label-mac-device = &eth0;
 		led-boot = &led_power;
 		led-boot = &led_power;
 		led-failsafe = &led_status;
 		led-failsafe = &led_status;
 		led-running = &led_power;
 		led-running = &led_power;
@@ -106,6 +107,24 @@
 				label = "mp";
 				label = "mp";
 				reg = <0x20000 0x10000>;
 				reg = <0x20000 0x10000>;
 				read-only;
 				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 {
 			partition@30000 {
@@ -125,11 +144,14 @@
 
 
 &eth0 {
 &eth0 {
 	status = "okay";
 	status = "okay";
+
+	nvmem-cells = <&macaddr_mp_1 0>;
+	nvmem-cell-names = "mac-address";
 };
 };
 
 
 &wmac {
 &wmac {
 	status = "okay";
 	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";
 };
 };

+ 0 - 6
target/linux/ath79/generic/base-files/etc/board.d/02_network

@@ -689,12 +689,6 @@ ath79_setup_macs()
 		plc_mac=$(mtd_get_mac_ascii art "protest_plc_mac")
 		plc_mac=$(mtd_get_mac_ascii art "protest_plc_mac")
 		[ -n "$plc_mac" ] && ucidef_set_interface_macaddr "plc" $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-2230-a1|\
 	dlink,dap-2660-a1|\
 	dlink,dap-2660-a1|\
 	dlink,dap-2680-a1|\
 	dlink,dap-2680-a1|\

+ 0 - 13
target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac

@@ -24,11 +24,6 @@ case "$board" in
 		[ "$PHYNBR" -eq 1 ] && \
 		[ "$PHYNBR" -eq 1 ] && \
 			mtd_get_mac_ascii art "protest_ath0_mac" > /sys${DEVPATH}/macaddress
 			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-2230-a1|\
 	dlink,dap-3320-a1)
 	dlink,dap-3320-a1)
 		mtd_get_mac_ascii bdcfg "wlanmac" > /sys${DEVPATH}/macaddress
 		mtd_get_mac_ascii bdcfg "wlanmac" > /sys${DEVPATH}/macaddress
@@ -127,12 +122,4 @@ case "$board" in
 		[ "$PHYNBR" -eq 1 ] && \
 		[ "$PHYNBR" -eq 1 ] && \
 			mtd_get_mac_ascii devdata wlan5mac > /sys${DEVPATH}/macaddress
 			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
 esac