[openwrt/openwrt] ath79: convert Ubiquiti UniFi AP Pro WiFis to nvmem-cells

LEDE Commits lede-commits at lists.infradead.org
Thu Dec 15 06:46:53 PST 2022


chunkeey pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/fd456106aa8730bb9d407b66d1eef5e26b5cb63e

commit fd456106aa8730bb9d407b66d1eef5e26b5cb63e
Author: Nick Hainke <vincent at systemli.org>
AuthorDate: Thu Dec 15 09:57:28 2022 +0100

    ath79: convert Ubiquiti UniFi AP Pro WiFis to nvmem-cells
    
    Pull the calibration data from the nvmem subsystem. This allows us to
    move userspace caldata extraction into the device-tree definition.
    
    Signed-off-by: Nick Hainke <vincent at systemli.org>
    (merged art node back into partition-node)
    Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
---
 .../linux/ath79/dts/ar9344_ubnt_unifi-ap-pro.dts   | 34 +++++++++++++---------
 .../etc/hotplug.d/firmware/10-ath9k-eeprom         |  1 -
 2 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/target/linux/ath79/dts/ar9344_ubnt_unifi-ap-pro.dts b/target/linux/ath79/dts/ar9344_ubnt_unifi-ap-pro.dts
index 8471be9b6b..55626c4299 100644
--- a/target/linux/ath79/dts/ar9344_ubnt_unifi-ap-pro.dts
+++ b/target/linux/ath79/dts/ar9344_ubnt_unifi-ap-pro.dts
@@ -100,10 +100,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>;
+				};
+
+				calibration_art_1000: calibration at 1000 {
+					reg = <0x1000 0x440>;
+				};
+
+				calibration_art_5000: calibration at 5000 {
+					reg = <0x5000 0x440>;
+				};
 			};
 		};
 	};
@@ -115,14 +131,16 @@
 	wifi at 0,0 {
 		compatible = "pci168c,0033";
 		reg = <0 0 0 0 0>;
-		qca,no-eeprom;
+		nvmem-cells = <&calibration_art_5000>;
+		nvmem-cell-names = "calibration";
 	};
 };
 
 &wmac {
 	status = "okay";
 
-	mtd-cal-data = <&art 0x1000>;
+	nvmem-cells = <&calibration_art_1000>;
+	nvmem-cell-names = "calibration";
 };
 
 &mdio0 {
@@ -150,13 +168,3 @@
 	phy-mode = "rgmii";
 	phy-handle = <&phy0>;
 };
-
-&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/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 825e4ff99c..a91885c3fe 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
@@ -83,7 +83,6 @@ case "$FIRMWARE" in
 	;;
 "ath9k-eeprom-pci-0000:00:00.0.bin")
 	case $board in
-	ubnt,unifi-ap-pro|\
 	winchannel,wb2000)
 		caldata_extract "art" 0x5000 0x440
 		;;




More information about the lede-commits mailing list