Просмотр исходного кода

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 <[email protected]>
Nick Hainke 3 лет назад
Родитель
Сommit
af5306ba70

+ 20 - 16
target/linux/ath79/dts/ar7241_ubnt_unifi-ap-outdoor-plus.dts

@@ -41,7 +41,7 @@
 			#address-cells = <1>;
 			#size-cells = <1>;
 
-			uboot: partition@0 {
+			partition@0 {
 				label = "u-boot";
 				reg = <0x0 0x40000>;
 				read-only;
@@ -82,10 +82,26 @@
 				read-only;
 			};
 
-			art: partition@ff0000 {
+			partition@ff0000 {
 				label = "art";
 				reg = <0xff0000 0x10000>;
 				read-only;
+
+				compatible = "nvmem-cells";
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				macaddr_art_0: macaddr@0 {
+					reg = <0x0 0x6>;
+				};
+
+				macaddr_art_6: macaddr@6 {
+					reg = <0x6 0x6>;
+				};
+
+				calibration_art_1000: calibration@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@0 {
-		reg = <0x0 0x6>;
-	};
-
-	macaddr_art_6: macaddr@6 {
-		reg = <0x6 0x6>;
-	};
+	nvmem-cells = <&calibration_art_1000>;
+	nvmem-cell-names = "calibration";
 };

+ 18 - 11
target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dtsi

@@ -68,15 +68,32 @@
 				read-only;
 			};
 
-			art: partition@7f0000 {
+			partition@7f0000 {
 				label = "art";
 				reg = <0x7f0000 0x010000>;
 				read-only;
+
+				compatible = "nvmem-cells";
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				macaddr_art_0: macaddr@0 {
+					reg = <0x0 0x6>;
+				};
+
+				calibration_art_1000: calibration@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@0 {
-		reg = <0x0 0x6>;
-	};
-};

+ 0 - 1
target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi

@@ -26,7 +26,6 @@
 
 	wifi: wifi@0,0 {
 		reg = <0x0000 0 0 0 0>;
-		qca,no-eeprom;
 	};
 };
 

+ 1 - 5
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|\