ath79: userspace cal to nvmem

Userspace handling is deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2024-02-16 21:27:05 -08:00
parent 1521bc5be2
commit e9e2394fc0
32 changed files with 237 additions and 141 deletions

View File

@ -165,6 +165,14 @@
reg = <0x520c 0x6>;
#nvmem-cell-cells = <1>;
};
cal_art_1000: calibration@1000 {
reg = <0x1000 0xeb8>;
};
cal_art_5000: calibration@5000 {
reg = <0x5000 0xeb8>;
};
};
};
@ -201,7 +209,8 @@
ath9k0: wifi@11,0 {
compatible = "pci168c,0029";
reg = <0x8800 0 0 0 0>;
qca,no-eeprom;
nvmem-cells = <&cal_art_1000>;
nvmem-cell-names = "calibration";
#gpio-cells = <2>;
gpio-controller;
};
@ -209,7 +218,8 @@
ath9k1: wifi@12,0 {
compatible = "pci168c,0029";
reg = <0x9000 0 0 0 0>;
qca,no-eeprom;
nvmem-cells = <&cal_art_5000>;
nvmem-cell-names = "calibration";
#gpio-cells = <2>;
gpio-controller;
};

View File

@ -77,9 +77,8 @@
ath9k0: wifi@11,0 { /* 2.4 GHz */
compatible = "pci168c,0029";
reg = <0x8800 0 0 0 0>;
qca,no-eeprom;
nvmem-cells = <&macaddr_config_66 1>;
nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_config_66 1>, <&cal_art_11000>;
nvmem-cell-names = "mac-address", "calibration";
#gpio-cells = <2>;
gpio-controller;
};
@ -87,9 +86,8 @@
ath9k1: wifi@12,0 { /* 5 GHz */
compatible = "pci168c,0029";
reg = <0x9000 0 0 0 0>;
qca,no-eeprom;
nvmem-cells = <&macaddr_config_66 2>;
nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_config_66 2>, <&cal_art_15000>;
nvmem-cell-names = "mac-address", "calibration";
#gpio-cells = <2>;
gpio-controller;
};
@ -139,7 +137,7 @@
read-only;
};
config: partition@80000 {
partition@80000 {
label = "config";
reg = <0x80000 0x20000>;
read-only;
@ -167,6 +165,20 @@
label = "art";
reg = <0xfe0000 0x20000>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
cal_art_11000: calibration@11000 {
reg = <0x11000 0xeb8>;
};
cal_art_15000: calibration@15000 {
reg = <0x15000 0xeb8>;
};
};
};
};
};

View File

@ -161,6 +161,10 @@
reg = <0x120c 0x6>;
#nvmem-cell-cells = <1>;
};
cal_art_1000: calibration@1000 {
reg = <0x1000 0xeb8>;
};
};
};
};
@ -185,9 +189,8 @@
ath9k: wifi@0,0 {
compatible = "pci168c,002a";
reg = <0x0000 0 0 0 0>;
qca,no-eeprom;
nvmem-cells = <&macaddr_art_120c 0>;
nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_art_120c 0>, <&cal_art_1000>;
nvmem-cell-names = "mac-address", "calibration";
#gpio-cells = <2>;
gpio-controller;
};

View File

@ -93,7 +93,8 @@
ath9k: wifi@0,0 {
compatible = "pci168c,002a";
reg = <0x0000 0 0 0 0>;
qca,no-eeprom;
nvmem-cells = <&cal_art_1000>;
nvmem-cell-names = "calibration";
#gpio-cells = <2>;
gpio-controller;
};
@ -108,5 +109,9 @@
macaddr_art_0: macaddr@0 {
reg = <0x0 0x6>;
};
cal_art_1000: calibration@1000 {
reg = <0x1000 0xeb8>;
};
};
};

View File

@ -190,6 +190,10 @@
macaddr_art_6: macaddr@6 {
reg = <0x6 0x6>;
};
cal_art_1000: calibration@1000 {
reg = <0x1000 0xeb8>;
};
};
};
};
@ -214,9 +218,8 @@
ath9k: wifi@0,0 {
compatible = "pci168c,002b";
reg = <0x0000 0 0 0 0>;
nvmem-cells = <&macaddr_art_0 1>;
nvmem-cell-names = "mac-address";
qca,no-eeprom;
nvmem-cells = <&macaddr_art_0 1>, <&cal_art_1000>;
nvmem-cell-names = "mac-address", "calibration";
#gpio-cells = <2>;
gpio-controller;
};

View File

@ -120,6 +120,10 @@
macaddr_art_6: macaddr@6 {
reg = <0x6 0x6>;
};
cal_art_1000: calibration@1000 {
reg = <0x1000 0xeb8>;
};
};
};
};
@ -144,9 +148,8 @@
ath9k: wifi@0,0 {
compatible = "pci168c,002b";
reg = <0x0000 0 0 0 0>;
nvmem-cells = <&macaddr_art_0 1>;
nvmem-cell-names = "mac-address";
qca,no-eeprom;
nvmem-cells = <&macaddr_art_0 1>, <&cal_art_1000>;
nvmem-cell-names = "mac-address", "calibration";
#gpio-cells = <2>;
gpio-controller;
};

View File

@ -75,7 +75,7 @@
#address-cells = <1>;
#size-cells = <1>;
uboot: partition@0 {
partition@0 {
reg = <0x0 0x20000>;
label = "u-boot";
read-only;
@ -103,6 +103,16 @@
reg = <0x3f0000 0x10000>;
label = "art";
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
cal_art_1000: calibration@1000 {
reg = <0x1000 0xeb8>;
};
};
};
};
};
@ -117,9 +127,8 @@
ath9k: wifi@0,0 {
reg = <0x0000 0 0 0 0>;
qca,no-eeprom;
nvmem-cells = <&macaddr_uboot_1fc00 0>;
nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_uboot_1fc00 0>, <&cal_art_1000>;
nvmem-cell-names = "mac-address", "calibration";
#gpio-cells = <2>;
gpio-controller;
};

View File

@ -19,3 +19,11 @@
&eth1 {
compatible = "syscon", "simple-mfd";
};
&cal_art_1000 {
reg = <0x1000 0xeb8>;
};
&wifi {
compatible = "pci168c,002a";
};

View File

@ -193,6 +193,10 @@
macaddr_art_6: macaddr@6 {
reg = <0x6 0x6>;
};
cal_art_1000: calibration@1000 {
reg = <0x1000 0x3d8>;
};
};
};
};
@ -219,9 +223,8 @@
ath9k: wifi@0,0 {
compatible = "pci168c,002e";
reg = <0x0000 0 0 0 0>;
nvmem-cells = <&macaddr_art_0 1>;
nvmem-cell-names = "mac-address";
qca,no-eeprom;
nvmem-cells = <&macaddr_art_0 1>, <&cal_art_1000>;
nvmem-cell-names = "mac-address", "calibration";
#gpio-cells = <2>;
gpio-controller;
};

View File

@ -60,7 +60,7 @@
#address-cells = <1>;
#size-cells = <1>;
uboot: partition@0 {
partition@0 {
reg = <0x0 0x20000>;
label = "u-boot";
read-only;
@ -88,6 +88,15 @@
reg = <0x3f0000 0x10000>;
label = "art";
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
cal_art_1000: calibration@1000 {
};
};
};
};
};
@ -100,9 +109,8 @@
reg = <0x0000 0 0 0 0>;
#gpio-cells = <2>;
gpio-controller;
qca,no-eeprom;
nvmem-cells = <&macaddr_uboot_1fc00 0>;
nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_uboot_1fc00 0>, <&cal_art_1000>;
nvmem-cell-names = "mac-address", "calibration";
};
};

View File

@ -19,3 +19,11 @@
};
};
};
&cal_art_1000 {
reg = <0x1000 0xeb8>;
};
&ath9k {
compatible = "pci168c,002b";
};

View File

@ -19,3 +19,11 @@
};
};
};
&cal_art_1000 {
reg = <0x1000 0x3d8>;
};
&ath9k {
compatible = "pci168c,002e";
};

View File

@ -19,3 +19,11 @@
};
};
};
&cal_art_1000 {
reg = <0x1000 0x3d8>;
};
&ath9k {
compatible = "pci168c,002e";
};

View File

@ -100,7 +100,7 @@
#address-cells = <1>;
#size-cells = <1>;
uboot: partition@0 {
partition@0 {
reg = <0x0 0x20000>;
label = "u-boot";
read-only;

View File

@ -40,3 +40,11 @@
&usb {
status = "okay";
};
&cal_art_1000 {
reg = <0x1000 0xeb8>;
};
&wifi {
compatible = "pci168c,002b";
};

View File

@ -12,3 +12,11 @@
&eth1 {
compatible = "syscon", "simple-mfd";
};
&cal_art_1000 {
reg = <0x1000 0xeb8>;
};
&wifi {
compatible = "pci168c,002a";
};

View File

@ -12,3 +12,11 @@
&eth1 {
compatible = "syscon", "simple-mfd";
};
&cal_art_1000 {
reg = <0x1000 0xeb8>;
};
&wifi {
compatible = "pci168c,002a";
};

View File

@ -12,3 +12,11 @@
&eth1 {
compatible = "syscon", "simple-mfd";
};
&cal_art_1000 {
reg = <0x1000 0x3d8>;
};
&wifi {
compatible = "pci168c,002e";
};

View File

@ -8,3 +8,11 @@
compatible = "ubnt,nanostation-m", "ubnt,xm", "qca,ar7241";
model = "Ubiquiti Nanostation M (XM)";
};
&cal_art_1000 {
reg = <0x1000 0xeb8>;
};
&wifi {
compatible = "pci168c,002a";
};

View File

@ -12,3 +12,11 @@
&eth1 {
compatible = "syscon", "simple-mfd";
};
&cal_art_1000 {
reg = <0x1000 0xeb8>;
};
&wifi {
compatible = "pci168c,002a";
};

View File

@ -12,3 +12,11 @@
&eth1 {
compatible = "syscon", "simple-mfd";
};
&cal_art_1000 {
reg = <0x1000 0xeb8>;
};
&wifi {
compatible = "pci168c,002a";
};

View File

@ -20,3 +20,11 @@
&usb {
status = "okay";
};
&cal_art_1000 {
reg = <0x1000 0xeb8>;
};
&wifi {
compatible = "pci168c,002a";
};

View File

@ -74,9 +74,8 @@
ath9k: wifi@0,0 {
compatible = "pci168c,0030";
reg = <0x0000 0 0 0 0>;
nvmem-cells = <&macaddr_art_1002>;
nvmem-cell-names = "mac-address";
qca,no-eeprom;
nvmem-cells = <&cal_art_1000>;
nvmem-cell-names = "calibration";
#gpio-cells = <2>;
gpio-controller;
qca,tx-gain-buffalo;
@ -89,6 +88,10 @@
#address-cells = <1>;
#size-cells = <1>;
cal_art_1000: calibration@1000 {
reg = <0x1000 0x440>;
};
macaddr_art_1002: macaddr@1002 {
reg = <0x1002 0x6>;
};

View File

@ -81,9 +81,8 @@
ath9k: wifi@0,0 {
compatible = "pci168c,002a";
reg = <0x0 0 0 0 0>;
nvmem-cells = <&macaddr_art_0 1>;
nvmem-cell-names = "mac-address";
qca,no-eeprom;
nvmem-cells = <&macaddr_art_0 1>, <&cal_art_1000>;
nvmem-cell-names = "mac-address", "calibration";
#gpio-cells = <2>;
gpio-controller;
};
@ -100,5 +99,9 @@
reg = <0x0 0x6>;
#nvmem-cell-cells = <1>;
};
cal_art_1000: calibration@1000 {
reg = <0x1000 0xeb8>;
};
};
};

View File

@ -81,9 +81,8 @@
ath9k: wifi@0,0 {
compatible = "pci168c,002a";
reg = <0x0 0 0 0 0>;
nvmem-cells = <&macaddr_art_0 (-1)>;
nvmem-cell-names = "mac-address";
qca,no-eeprom;
nvmem-cells = <&macaddr_art_0 (-1)>, <&cal_art_1000>;
nvmem-cell-names = "mac-address", "calibration";
#gpio-cells = <2>;
gpio-controller;
};
@ -100,5 +99,9 @@
reg = <0x0 0x6>;
#nvmem-cell-cells = <1>;
};
cal_art_1000: calibration@1000 {
reg = <0x1000 0xeb8>;
};
};
};

View File

@ -77,9 +77,8 @@
wifi@0,0 {
compatible = "pci168c,002a";
reg = <0x0000 0 0 0 0>;
qca,no-eeprom;
nvmem-cells = <&macaddr_config_66 1>;
nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_config_66 1>, <&cal_art_11000>;
nvmem-cell-names = "mac-address", "calibration";
};
};
@ -139,7 +138,7 @@
read-only;
};
config: partition@80000 {
partition@80000 {
label = "config";
reg = <0x80000 0x20000>;
read-only;
@ -167,6 +166,16 @@
label = "art";
reg = <0xfe0000 0x20000>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
cal_art_11000: calibration@11000 {
reg = <0x11000 0xeb8>;
};
};
};
};
};

View File

@ -75,6 +75,9 @@
macaddr_art_6: macaddr@6 {
reg = <0x6 0x6>;
};
cal_art_1000: calibration@1000 {
};
};
};
};
@ -86,7 +89,8 @@
wifi: wifi@0,0 {
reg = <0x0000 0 0 0 0>;
qca,no-eeprom;
nvmem-cells = <&cal_art_1000>;
nvmem-cell-names = "calibration";
};
};

View File

@ -117,6 +117,10 @@
reg = <0x0 0x6>;
};
cal_art_1000: calibration@1000 {
reg = <0x1000 0x440>;
};
macaddr_art_1002: macaddr@1002 {
reg = <0x1002 0x6>;
};
@ -153,5 +157,6 @@
&wmac {
status = "okay";
qca,no-eeprom;
nvmem-cells = <&cal_art_1000>;
nvmem-cell-names = "calibration";
};

View File

@ -106,6 +106,10 @@
#address-cells = <1>;
#size-cells = <1>;
cal_art_1000: calibration@1000 {
reg = <0x1000 0x440>;
};
macaddr_art_1002: macaddr@1002 {
reg = <0x1002 0x6>;
};
@ -168,5 +172,6 @@
&wmac {
status = "okay";
qca,no-eeprom;
nvmem-cells = <&cal_art_1000>;
nvmem-cell-names = "calibration";
};

View File

@ -127,6 +127,10 @@
#address-cells = <1>;
#size-cells = <1>;
cal_art_1000: calibration@1000 {
reg = <0x1000 0x440>;
};
macaddr_art_1002: macaddr@1002 {
reg = <0x1002 0x6>;
};
@ -168,5 +172,6 @@
&wmac {
status = "okay";
qca,no-eeprom;
nvmem-cells = <&cal_art_1000>;
nvmem-cell-names = "calibration";
};

View File

@ -9,11 +9,6 @@ board=$(board_name)
case "$FIRMWARE" in
"ath9k-eeprom-ahb-18100000.wmac.bin")
case $board in
asus,pl-ac56|\
asus,rp-ac51|\
asus,rp-ac66)
caldata_extract "art" 0x1000 0x440
;;
avm,fritz1750e|\
avm,fritz4020|\
avm,fritz450e|\
@ -37,44 +32,6 @@ case "$FIRMWARE" in
avm,fritz300e)
caldata_extract_reverse "urloader" 0x1541 0x440
;;
buffalo,wzr-hp-g450h)
caldata_extract "art" 0x1000 0x440
;;
meraki,mr12)
caldata_extract "art" 0x11000 0xeb8
;;
ubnt,powerbridge-m|\
ubnt,rocket-m)
caldata_extract "art" 0x1000 0x1000
;;
*)
caldata_die "board $board is not supported yet"
;;
esac
;;
"ath9k-eeprom-pci-0000:00:11.0.bin")
case $board in
buffalo,wzr-600dhp|\
buffalo,wzr-hp-ag300h)
caldata_extract "art" 0x1000 0xeb8
;;
meraki,mr16)
caldata_extract "art" 0x11000 0xeb8
;;
*)
caldata_die "board $board is not supported yet"
;;
esac
;;
"ath9k-eeprom-pci-0000:00:12.0.bin")
case $board in
buffalo,wzr-600dhp|\
buffalo,wzr-hp-ag300h)
caldata_extract "art" 0x5000 0xeb8
;;
meraki,mr16)
caldata_extract "art" 0x15000 0xeb8
;;
*)
caldata_die "board $board is not supported yet"
;;

View File

@ -1,50 +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
buffalo,whr-g301n|\
engenius,eap350-v1|\
engenius,ecb350-v1|\
engenius,enh202-v1|\
tplink,tl-wa701nd-v1|\
tplink,tl-wa730re-v1|\
tplink,tl-wa801nd-v1|\
tplink,tl-wa830re-v1|\
tplink,tl-wa901nd-v1|\
tplink,tl-wr841-v5|\
tplink,tl-wr941-v4)
caldata_extract "art" 0x1000 0xeb8
;;
netgear,wnr1000-v2|\
netgear,wnr2000-v3|\
netgear,wnr612-v2|\
on,n150r|\
tplink,tl-mr3220-v1|\
tplink,tl-mr3420-v1|\
tplink,tl-wr740n-v1|\
tplink,tl-wr740n-v3|\
tplink,tl-wr741-v1|\
tplink,tl-wr743nd-v1|\
tplink,tl-wr841-v7|\
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