Kaynağa Gözat

ath79: iodata: extract calibration with nvmem

Userspace handling is deprecated.

Signed-off-by: Rosen Penev <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/18873
Signed-off-by: Robert Marko <[email protected]>
Rosen Penev 7 ay önce
ebeveyn
işleme
5eef79a249

+ 12 - 1
target/linux/ath79/dts/ar1022_iodata_wn-ag300dgr.dts

@@ -159,6 +159,16 @@
 				label = "art";
 				reg = <0xff0000 0x010000>;
 				read-only;
+
+				nvmem-layout {
+					compatible = "fixed-layout";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					cal_art_1000: calibration@1000 {
+						reg = <0x1000 0x440>;
+					};
+				};
 			};
 		};
 	};
@@ -207,5 +217,6 @@
 &wmac {
 	status = "okay";
 
-	qca,no-eeprom;
+	nvmem-cells = <&cal_art_1000>;
+	nvmem-cell-names = "calibration";
 };

+ 6 - 1
target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi

@@ -148,6 +148,10 @@
 					#address-cells = <1>;
 					#size-cells = <1>;
 
+					cal_art_1000: calibration@1000 {
+						reg = <0x1000 0x440>;
+					};
+
 					cal_art_5000: calibration@5000 {
 						reg = <0x5000 0x844>;
 					};
@@ -199,5 +203,6 @@
 &wmac {
 	status = "okay";
 
-	qca,no-eeprom;
+	nvmem-cells = <&cal_art_1000>;
+	nvmem-cell-names = "calibration";
 };

+ 0 - 4
target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom

@@ -45,10 +45,6 @@ case "$FIRMWARE" in
 		caldata_extract "art" 0x1000 0x440
 		ath9k_patch_mac $(mtd_get_mac_ascii cfg1 RADIOADDR1)
 		;;
-	iodata,wn-ac1167dgr|\
-	iodata,wn-ac1600dgr|\
-	iodata,wn-ac1600dgr2|\
-	iodata,wn-ag300dgr|\
 	sitecom,wlr-7100|\
 	sitecom,wlr-8100)
 		caldata_extract "art" 0x1000 0x440

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

@@ -73,18 +73,23 @@ case "$board" in
 		;;
 	iodata,wn-ac1167dgr|\
 	iodata,wn-ac1600dgr|\
-	iodata,wn-ac1600dgr2|\
-	sitecom,wlr-7100|\
-	sitecom,wlr-8100)
+	iodata,wn-ac1600dgr2)
 		# There is no eeprom data for 5 GHz wlan in "art" partition
 		# which would allow to patch the macaddress
 		[ "$PHYNBR" -eq 0 ] && \
 			macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 1 > /sys${DEVPATH}/macaddress
 		;;
+		[ "$PHYNBR" -eq 1 ] && \
+			macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 0 > /sys${DEVPATH}/macaddress
+		;;
 	iodata,wn-ag300dgr)
 		# There is no eeprom data for 5 GHz wlan in "art" partition
 		# which would allow to patch the macaddress
-		[ "$PHYNBR" -eq 1 ] && \
+		macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" $PHYNBR > /sys${DEVPATH}/macaddress
+		;;
+	sitecom,wlr-7100|\
+	sitecom,wlr-8100)
+		[ "$PHYNBR" -eq 0 ] && \
 			macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 1 > /sys${DEVPATH}/macaddress
 		;;
 	nec,wf1200cr|\