Browse Source

ath79: ubnt: nvmem calibration

Userspace handling is deprecated.

Moved pcie wifi nodes out of dtsi as these devices differ in wifi
chipsets and thus calibration size. Added compatible lines too.

Removed pointless label_mac assignments as label-mac-device is already
implemented.

Signed-off-by: Rosen Penev <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20303
Signed-off-by: Hauke Mehrtens <[email protected]>
Rosen Penev 3 months ago
parent
commit
fb1e8a446d

+ 15 - 0
target/linux/ath79/dts/ar7240_ubnt_bullet-m-ar7240.dts

@@ -19,3 +19,18 @@
 &eth1 {
 	compatible = "syscon", "simple-mfd";
 };
+
+&art {
+	cal_art_1000: calibration@1000 {
+		reg = <0x1000 0xeb8>;
+	};
+};
+
+&pcie {
+	wifi: wifi@0,0 {
+		compatible = "pci168c,002a";
+		reg = <0x0000 0 0 0 0>;
+		nvmem-cells = <&cal_art_1000>;
+		nvmem-cell-names = "calibration";
+	};
+};

+ 15 - 0
target/linux/ath79/dts/ar7241_ubnt_airrouter.dts

@@ -33,6 +33,12 @@
 	};
 };
 
+&art {
+	cal_art_1000: calibration@1000 {
+		reg = <0x1000 0x200>;
+	};
+};
+
 &usb_phy {
 	status = "okay";
 };
@@ -40,3 +46,12 @@
 &usb {
 	status = "okay";
 };
+
+&pcie {
+	wifi: wifi@0,0 {
+		compatible = "pci168c,002b";
+		reg = <0x0000 0 0 0 0>;
+		nvmem-cells = <&cal_art_1000>;
+		nvmem-cell-names = "calibration";
+	};
+};

+ 15 - 0
target/linux/ath79/dts/ar7241_ubnt_bullet-m-ar7241.dts

@@ -12,3 +12,18 @@
 &eth1 {
 	compatible = "syscon", "simple-mfd";
 };
+
+&art {
+	cal_art_1000: calibration@1000 {
+		reg = <0x1000 0xeb8>;
+	};
+};
+
+&pcie {
+	wifi: wifi@0,0 {
+		compatible = "pci168c,002a";
+		reg = <0x0000 0 0 0 0>;
+		nvmem-cells = <&cal_art_1000>;
+		nvmem-cell-names = "calibration";
+	};
+};

+ 15 - 0
target/linux/ath79/dts/ar7241_ubnt_nanobridge-m.dts

@@ -12,3 +12,18 @@
 &eth1 {
 	compatible = "syscon", "simple-mfd";
 };
+
+&art {
+	cal_art_1000: calibration@1000 {
+		reg = <0x1000 0xeb8>;
+	};
+};
+
+&pcie {
+	wifi: wifi@0,0 {
+		compatible = "pci168c,002a";
+		reg = <0x0000 0 0 0 0>;
+		nvmem-cells = <&cal_art_1000>;
+		nvmem-cell-names = "calibration";
+	};
+};

+ 15 - 0
target/linux/ath79/dts/ar7241_ubnt_nanostation-loco-m.dts

@@ -12,3 +12,18 @@
 &eth1 {
 	compatible = "syscon", "simple-mfd";
 };
+
+&art {
+	cal_art_1000: calibration@1000 {
+		reg = <0x1000 0x3d8>;
+	};
+};
+
+&pcie {
+	wifi: wifi@0,0 {
+		compatible = "pci168c,002e";
+		reg = <0x0000 0 0 0 0>;
+		nvmem-cells = <&cal_art_1000>;
+		nvmem-cell-names = "calibration";
+	};
+};

+ 15 - 0
target/linux/ath79/dts/ar7241_ubnt_nanostation-m.dts

@@ -8,3 +8,18 @@
 	compatible = "ubnt,nanostation-m", "ubnt,xm", "qca,ar7241";
 	model = "Ubiquiti Nanostation M (XM)";
 };
+
+&art {
+	cal_art_1000: calibration@1000 {
+		reg = <0x1000 0xeb8>;
+	};
+};
+
+&pcie {
+	wifi: wifi@0,0 {
+		compatible = "pci168c,002a";
+		reg = <0x0000 0 0 0 0>;
+		nvmem-cells = <&cal_art_1000>;
+		nvmem-cell-names = "calibration";
+	};
+};

+ 15 - 0
target/linux/ath79/dts/ar7241_ubnt_picostation-m.dts

@@ -12,3 +12,18 @@
 &eth1 {
 	compatible = "syscon", "simple-mfd";
 };
+
+&art {
+	cal_art_1000: calibration@1000 {
+		reg = <0x1000 0xeb8>;
+	};
+};
+
+&pcie {
+	wifi: wifi@0,0 {
+		compatible = "pci168c,002a";
+		reg = <0x0000 0 0 0 0>;
+		nvmem-cells = <&cal_art_1000>;
+		nvmem-cell-names = "calibration";
+	};
+};

+ 15 - 0
target/linux/ath79/dts/ar7241_ubnt_powerbridge-m.dts

@@ -12,3 +12,18 @@
 &eth1 {
 	compatible = "syscon", "simple-mfd";
 };
+
+&art {
+	cal_art_1000: calibration@1000 {
+		reg = <0x1000 0xeb8>;
+	};
+};
+
+&pcie {
+	wifi: wifi@0,0 {
+		compatible = "pci168c,002a";
+		reg = <0x0000 0 0 0 0>;
+		nvmem-cells = <&cal_art_1000>;
+		nvmem-cell-names = "calibration";
+	};
+};

+ 15 - 0
target/linux/ath79/dts/ar7241_ubnt_rocket-m.dts

@@ -20,3 +20,18 @@
 &usb {
 	status = "okay";
 };
+
+&art {
+	cal_art_1000: calibration@1000 {
+		reg = <0x1000 0xeb8>;
+	};
+};
+
+&pcie {
+	wifi: wifi@0,0 {
+		compatible = "pci168c,002a";
+		reg = <0x0000 0 0 0 0>;
+		nvmem-cells = <&cal_art_1000>;
+		nvmem-cell-names = "calibration";
+	};
+};

+ 1 - 6
target/linux/ath79/dts/ar724x_ubnt_xm.dtsi

@@ -63,7 +63,7 @@
 				reg = <0x7f0000 0x010000>;
 				read-only;
 
-				nvmem-layout {
+				art: nvmem-layout {
 					compatible = "fixed-layout";
 					#address-cells = <1>;
 					#size-cells = <1>;
@@ -83,11 +83,6 @@
 
 &pcie {
 	status = "okay";
-
-	wifi: wifi@0,0 {
-		reg = <0x0000 0 0 0 0>;
-		qca,no-eeprom;
-	};
 };
 
 &eth0 {

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

@@ -829,8 +829,6 @@ ath79_setup_macs()
 		base_mac=$(mtd_get_mac_binary info 0x8)
 		wan_mac=$(macaddr_add "$base_mac" 1)
 		;;
-	ubnt,powerbridge-m|\
-	ubnt,rocket-m|\
 	ubnt,unifi)
 		label_mac=$(cat /sys/class/ieee80211/phy0/macaddress)
 		;;

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

@@ -42,10 +42,6 @@ case "$FIRMWARE" in
 	meraki,mr12)
 		caldata_extract "art" 0x11000 0xeb8
 		;;
-	ubnt,powerbridge-m|\
-	ubnt,rocket-m)
-		caldata_extract "art" 0x1000 0x1000
-		;;
 	wd,mynet-wifi-rangeextender)
 		caldata_extract "art" 0x1000 0x440
 		ath9k_patch_mac $(nvram get wl0_hwaddr)

+ 1 - 8
target/linux/ath79/tiny/base-files/etc/board.d/02_network

@@ -148,14 +148,7 @@ ath79_setup_macs()
 		lan_mac=$(get_mac_label)
 		wan_mac=$(macaddr_add "$lan_mac" 3)
 		;;
-	engenius,enh202-v1|\
-	ubnt,airrouter|\
-	ubnt,bullet-m-ar7240|\
-	ubnt,bullet-m-ar7241|\
-	ubnt,nanobridge-m|\
-	ubnt,nanostation-loco-m|\
-	ubnt,nanostation-m|\
-	ubnt,picostation-m)
+	engenius,enh202-v1)
 		label_mac=$(cat /sys/class/ieee80211/phy0/macaddress)
 		;;
 	nec,wg600hp|\

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

@@ -1,26 +0,0 @@
-#!/bin/sh
-
-[ -e /lib/firmware/$FIRMWARE ] && exit 0
-
-. /lib/functions/caldata.sh
-
-board=$(board_name)
-
-case "$FIRMWARE" in
-"ath9k-eeprom-pci-0000:00:00.0.bin")
-	case $board in
-	ubnt,airrouter|\
-	ubnt,bullet-m-ar7240|\
-	ubnt,bullet-m-ar7241|\
-	ubnt,nanobridge-m|\
-	ubnt,nanostation-loco-m|\
-	ubnt,nanostation-m|\
-	ubnt,picostation-m)
-		caldata_extract "art" 0x1000 0x1000
-		;;
-	*)
-		caldata_die "board $board is not supported yet"
-		;;
-	esac
-	;;
-esac