[openwrt/openwrt] ath79: convert WiFis based on ar7241_ubnt_unifi.dtsi to nvmem-cells

LEDE Commits lede-commits at lists.infradead.org
Sat Dec 17 11:49:44 PST 2022


hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/af5306ba70733f7e736b0aef582fb93519fccde9

commit af5306ba70733f7e736b0aef582fb93519fccde9
Author: Nick Hainke <vincent at systemli.org>
AuthorDate: Thu Dec 15 17:04:14 2022 +0100

    ath79: convert WiFis based on ar7241_ubnt_unifi.dtsi to nvmem-cells
    
    Pull the calibration data from the nvmem subsystem. This allows us to
    move userspace caldata extraction into the device-tree definition.
    
    While working on it remove stale uboot partition label and merge art
    into partition node.
    
    Signed-off-by: Nick Hainke <vincent at systemli.org>
---
 .../dts/ar7241_ubnt_unifi-ap-outdoor-plus.dts      | 36 ++++++++++++----------
 target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dtsi   | 29 ++++++++++-------
 target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi      |  1 -
 .../etc/hotplug.d/firmware/10-ath9k-eeprom         |  6 +---
 4 files changed, 39 insertions(+), 33 deletions(-)

diff --git a/target/linux/ath79/dts/ar7241_ubnt_unifi-ap-outdoor-plus.dts b/target/linux/ath79/dts/ar7241_ubnt_unifi-ap-outdoor-plus.dts
index 9ccbdbd450..3f965ec9de 100644
--- a/target/linux/ath79/dts/ar7241_ubnt_unifi-ap-outdoor-plus.dts
+++ b/target/linux/ath79/dts/ar7241_ubnt_unifi-ap-outdoor-plus.dts
@@ -41,7 +41,7 @@
 			#address-cells = <1>;
 			#size-cells = <1>;
 
-			uboot: partition at 0 {
+			partition at 0 {
 				label = "u-boot";
 				reg = <0x0 0x40000>;
 				read-only;
@@ -82,10 +82,26 @@
 				read-only;
 			};
 
-			art: partition at ff0000 {
+			partition at ff0000 {
 				label = "art";
 				reg = <0xff0000 0x10000>;
 				read-only;
+
+				compatible = "nvmem-cells";
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				macaddr_art_0: macaddr at 0 {
+					reg = <0x0 0x6>;
+				};
+
+				macaddr_art_6: macaddr at 6 {
+					reg = <0x6 0x6>;
+				};
+
+				calibration_art_1000: calibration at 1000 {
+					reg = <0x1000 0xeb8>;
+				};
 			};
 		};
 	};
@@ -105,18 +121,6 @@
 
 &wifi {
 	ubnt,hsr;
-};
-
-&art {
-	compatible = "nvmem-cells";
-	#address-cells = <1>;
-	#size-cells = <1>;
-
-	macaddr_art_0: macaddr at 0 {
-		reg = <0x0 0x6>;
-	};
-
-	macaddr_art_6: macaddr at 6 {
-		reg = <0x6 0x6>;
-	};
+	nvmem-cells = <&calibration_art_1000>;
+	nvmem-cell-names = "calibration";
 };
diff --git a/target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dtsi b/target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dtsi
index c70a1c02db..02166a26eb 100644
--- a/target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dtsi
+++ b/target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dtsi
@@ -68,15 +68,32 @@
 				read-only;
 			};
 
-			art: partition at 7f0000 {
+			partition at 7f0000 {
 				label = "art";
 				reg = <0x7f0000 0x010000>;
 				read-only;
+
+				compatible = "nvmem-cells";
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				macaddr_art_0: macaddr at 0 {
+					reg = <0x0 0x6>;
+				};
+
+				calibration_art_1000: calibration at 1000 {
+					reg = <0x1000 0x440>;
+				};
 			};
 		};
 	};
 };
 
+&wifi {
+	nvmem-cells = <&calibration_art_1000>;
+	nvmem-cell-names = "calibration";
+};
+
 &eth0 {
 	nvmem-cells = <&macaddr_art_0>;
 	nvmem-cell-names = "mac-address";
@@ -85,13 +102,3 @@
 &eth1 {
 	compatible = "syscon", "simple-mfd";
 };
-
-&art {
-	compatible = "nvmem-cells";
-	#address-cells = <1>;
-	#size-cells = <1>;
-
-	macaddr_art_0: macaddr at 0 {
-		reg = <0x0 0x6>;
-	};
-};
diff --git a/target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi b/target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi
index ec8c6381e7..fa6c233733 100644
--- a/target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi
+++ b/target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi
@@ -26,7 +26,6 @@
 
 	wifi: wifi at 0,0 {
 		reg = <0x0000 0 0 0 0>;
-		qca,no-eeprom;
 	};
 };
 
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index 5fcfcaf64f..4f107bfe88 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -86,11 +86,7 @@ case "$FIRMWARE" in
 	avm,fritz300e)
 		caldata_extract_reverse "urloader" 0x1541 0x440
 		;;
-	ubnt,unifi-ap-outdoor-plus)
-		caldata_extract "art" 0x1000 0xeb8
-		;;
-	buffalo,wzr-hp-g450h|\
-	ubnt,unifi)
+	buffalo,wzr-hp-g450h)
 		caldata_extract "art" 0x1000 0x440
 		;;
 	dlink,dir-825-c1|\




More information about the lede-commits mailing list