ath79: calibrate all ar9344 tl-WDRxxxx with nvmem

Driver for both soc (2.4GHz Wifi) and pci (5 GHz) now pull the calibration
data from the nvmem subsystem.

This allows us to move the userspace caldata extraction for the pci-e ath9k
supported wifi into the device-tree definition of the device.

wmac's nodes are also changed over to use nvmem-cells over OpenWrt's
custom mtd-cal-data property.

The wifi mac address remains correct after these changes, because When both
"mac-address" and "calibration" are defined, the effective mac address
comes from the cell corresponding to "mac-address" and
mac-address-increment.

Test passed on my tplink tl-wdr4310.

Signed-off-by: Edward Chow <equu@openmail.cc>
This commit is contained in:
Edward Chow 2022-11-09 17:18:17 +08:00 committed by Hauke Mehrtens
parent 224babfd6f
commit e354b01baf
4 changed files with 28 additions and 42 deletions

View File

@ -50,16 +50,9 @@
};
&ath9k {
nvmem-cells = <&macaddr_uboot_1fc00>;
nvmem-cell-names = "mac-address";
mac-address-increment = <1>;
};
&wmac {
nvmem-cells = <&macaddr_uboot_1fc00>;
nvmem-cell-names = "mac-address";
};
&eth1 {
status = "okay";
@ -83,13 +76,3 @@
nvmem-cell-names = "mac-address";
mac-address-increment = <2>;
};
&uboot {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;
macaddr_uboot_1fc00: macaddr@1fc00 {
reg = <0x1fc00 0x6>;
};
};

View File

@ -75,14 +75,7 @@
status = "okay";
};
&ath9k {
nvmem-cells = <&macaddr_uboot_1fc00>;
nvmem-cell-names = "mac-address";
};
&wmac {
nvmem-cells = <&macaddr_uboot_1fc00>;
nvmem-cell-names = "mac-address";
mac-address-increment = <(-1)>;
};
@ -117,13 +110,3 @@
phy-mode = "rgmii";
phy-handle = <&phy0>;
};
&uboot {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;
macaddr_uboot_1fc00: macaddr@1fc00 {
reg = <0x1fc00 0x6>;
};
};

View File

@ -106,14 +106,39 @@
ath9k: wifi@0,0 {
compatible = "pci168c,0033";
reg = <0x0000 0 0 0 0>;
qca,no-eeprom;
#gpio-cells = <2>;
gpio-controller;
nvmem-cells = <&macaddr_uboot_1fc00>, <&cal_art_5000>;
nvmem-cell-names = "mac-address", "calibration";
};
};
&wmac {
status = "okay";
mtd-cal-data = <&art 0x1000>;
nvmem-cells = <&macaddr_uboot_1fc00>, <&cal_art_1000>;
nvmem-cell-names = "mac-address", "calibration";
};
&uboot {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;
macaddr_uboot_1fc00: macaddr@1fc00 {
reg = <0x1fc00 0x6>;
};
};
&art {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;
cal_art_1000: cal@1000 {
reg = <0x1000 0x440>;
};
cal_art_5000: cal@5000 {
reg = <0x5000 0x440>;
};
};

View File

@ -89,11 +89,6 @@ case "$FIRMWARE" in
engenius,ecb600|\
mercury,mw4530r-v1|\
ocedo,raccoon|\
tplink,tl-wdr3500-v1|\
tplink,tl-wdr3600-v1|\
tplink,tl-wdr4300-v1|\
tplink,tl-wdr4300-v1-il|\
tplink,tl-wdr4310-v1|\
ubnt,unifi-ap-pro|\
watchguard,ap100|\
watchguard,ap200|\