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

ath79: enterasys,ws-ap3805i: use nvmem

Userspace handling is deprecated.

Use ath9k LED instead of specifying a generic one.

Signed-off-by: Rosen Penev <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/16286
Signed-off-by: Hauke Mehrtens <[email protected]>
Rosen Penev 2 месяцев назад
Родитель
Сommit
3faa3a04bb

+ 18 - 7
target/linux/ath79/dts/qca9557_extreme-networks_ws-ap3805i.dts

@@ -38,12 +38,6 @@
 			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
 			linux,default-trigger = "phy0tpt";
 		};
-
-		wlan2 {
-			label = "green:wlan2";
-			gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
-			linux,default-trigger = "phy1tpt";
-		};
 	};
 
 	keys {
@@ -72,7 +66,13 @@
 &wmac {
 	status = "okay";
 
-	qca,no-eeprom;
+	nvmem-cells = <&cal_art_1000>;
+	nvmem-cell-names = "calibration";
+
+	led {
+		led-sources = <22>;
+		led-active-low;
+	};
 };
 
 &pcie0 {
@@ -102,6 +102,9 @@
 
 	pll-data = <0x82000000 0x80000101 0x80001313>;
 
+	nvmem-cells = <&macaddr_uboot_ethaddr>;
+	nvmem-cell-names = "mac-address";
+
 	gmac-config {
 		device = <&gmac>;
 		rgmii-enabled = <1>;
@@ -135,9 +138,13 @@
 			};
 
 			partition@100000 {
+				compatible = "u-boot,env";
 				label = "cfg1";
 				reg = <0x100000 0x40000>;
 				read-only;
+
+				macaddr_uboot_ethaddr: ethaddr {
+				};
 			};
 
 			partition@140000 {
@@ -204,6 +211,10 @@
 					#address-cells = <1>;
 					#size-cells = <1>;
 
+					cal_art_1000: calibration@1000 {
+						reg = <0x1000 0x440>;
+					};
+
 					cal_art_5000: calibration@5000 {
 						reg = <0x5000 0x844>;
 					};

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

@@ -20,10 +20,6 @@ case "$FIRMWARE" in
 		caldata_extract "art" 0x1000 0x440
 		ath9k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env athaddr) 1)
 		;;
-	extreme-networks,ws-ap3805i)
-		caldata_extract "art" 0x1000 0x440
-		ath9k_patch_mac $(mtd_get_mac_ascii cfg1 RADIOADDR1)
-		;;
 	sitecom,wlr-7100|\
 	sitecom,wlr-8100)
 		caldata_extract "art" 0x1000 0x440

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

@@ -70,7 +70,10 @@ case "$board" in
 		;;
 	extreme-networks,ws-ap3805i)
 		[ "$PHYNBR" -eq 0 ] && \
-		mtd_get_mac_ascii cfg1 RADIOADDR0 > /sys${DEVPATH}/macaddress
+			mtd_get_mac_ascii cfg1 RADIOADDR0 > /sys${DEVPATH}/macaddress
+		;;
+		[ "$PHYNBR" -eq 1 ] && \
+			mtd_get_mac_ascii cfg1 RADIOADDR1 > /sys${DEVPATH}/macaddress
 		;;
 	iodata,wn-ac1167dgr|\
 	iodata,wn-ac1600dgr|\

+ 0 - 1
target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh

@@ -18,7 +18,6 @@ preinit_set_mac_address() {
 	engenius,esr900)
 		ip link set dev eth0 address $(mtd_get_mac_ascii u-boot-env ethaddr)
 		;;
-	extreme-networks,ws-ap3805i|\
 	siemens,ws-ap3610)
 		ip link set dev eth0 address $(mtd_get_mac_ascii cfg1 ethaddr)
 		;;