Skip to content

Commit

Permalink
ipq40xx: utilize nvmem-cells for macs & (pre-)calibration data
Browse files Browse the repository at this point in the history
moves extraction entries out of 11-ath10k-caldata and into
the individual board's device-tree.

Some notes:
 - mmc could work as well (not tested)
 - devices that pass the partitions via mtdparts
   bootargs are kept as is
 - gl-b2200 has a weird pcie wifi device
   (vendor claims 9886 wave 2. But firmware-extraction
   was for a wave 1 device?!)

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
  • Loading branch information
chunkeey committed Jan 15, 2022
1 parent 10bc55c commit cfc13c4
Show file tree
Hide file tree
Showing 31 changed files with 487 additions and 131 deletions.
Expand Up @@ -9,9 +9,6 @@ board=$(board_name)
case "$FIRMWARE" in
"ath10k/cal-pci-0000:01:00.0.bin")
case "$board" in
glinet,gl-b2200)
caldata_extract "ART" 0x9000 0x2f20
;;
meraki,mr33)
caldata_extract_ubi "ART" 0x9000 0x844
caldata_valid "4408" || caldata_extract "ART" 0x9000 0x844
Expand All @@ -37,11 +34,6 @@ case "$FIRMWARE" in
/usr/bin/fritz_cal_extract -i 1 -s 0x3C800 -e 0x212 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1") || \
/usr/bin/fritz_cal_extract -i 1 -s 0x3C000 -e 0x212 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1")
;;
buffalo,wtr-m2133hp)
caldata_extract "ART" 0x9000 0x2f20
ath10k_patch_mac $(mtd_get_mac_binary ORGDATA 0x32)
;;
engenius,eap2200 |\
openmesh,a62 |\
plasmacloud,pa2200)
caldata_extract "0:ART" 0x9000 0x2f20
Expand All @@ -63,29 +55,11 @@ case "$FIRMWARE" in
;;
"ath10k/pre-cal-ahb-a000000.wifi.bin")
case "$board" in
8dev,habanero-dvk |\
8dev,jalapeno |\
alfa-network,ap120c-ac |\
cilab,meshpoint-one |\
glinet,gl-ap1300 |\
glinet,gl-b1300 |\
glinet,gl-b2200 |\
glinet,gl-s1300 |\
linksys,ea6350v3 |\
mobipromo,cm520-79f |\
p2w,r619ac-64m |\
p2w,r619ac-128m |\
qcom,ap-dk01.1-c1)
caldata_extract "ART" 0x1000 0x2f20
;;
aruba,ap-303 |\
aruba,ap-303h |\
aruba,ap-365)
caldata_extract "ART" 0x1000 0x2f20
ath10k_patch_mac $(mtd_get_mac_binary mfginfo 0x1D)
;;
asus,map-ac2200 |\
asus,rt-ac42u |\
asus,map-ac2200|\
asus,rt-ac42u|\
asus,rt-ac58u)
caldata_extract_ubi "Factory" 0x1000 0x2f20
;;
Expand All @@ -102,25 +76,10 @@ case "$FIRMWARE" in
/usr/bin/fritz_cal_extract -i 1 -s 0x3C800 -e 0x207 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1") || \
/usr/bin/fritz_cal_extract -i 1 -s 0x3D000 -e 0x207 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1")
;;
buffalo,wtr-m2133hp)
caldata_extract "ART" 0x1000 0x2f20
ath10k_patch_mac $(mtd_get_mac_binary ORGDATA 0x26)
;;
cellc,rtl30vw |\
compex,wpj419 |\
compex,wpj428 |\
edgecore,ecw5211 |\
edgecore,oap100 |\
engenius,eap1300 |\
engenius,eap2200 |\
luma,wrtq-329acn|\
openmesh,a42 |\
openmesh,a62 |\
plasmacloud,pa1200 |\
plasmacloud,pa2200 |\
qxwlan,e2600ac-c1 |\
qxwlan,e2600ac-c2 |\
unielec,u4019-32m)
plasmacloud,pa2200)
caldata_extract "0:ART" 0x1000 0x2f20
;;
devolo,magic-2-wifi-next)
Expand Down Expand Up @@ -166,14 +125,6 @@ case "$FIRMWARE" in
caldata_extract_mmc "0:ART" 0x1000 0x2f20
ath10k_patch_mac $(mmc_get_mac_binary ARTMTD 0x0)
;;
netgear,wac510)
caldata_extract "0:ART" 0x1000 0x2f20
ath10k_patch_mac $(mtd_get_mac_binary "0:MANUDATA" 0x6)
;;
teltonika,rutx10)
caldata_extract "0:ART" 0x1000 0x2f20
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary "0:CONFIG" 0x0) 2)
;;
zyxel,nbg6617 |\
zyxel,wre6606)
caldata_extract "ART" 0x1000 0x2f20
Expand All @@ -183,28 +134,10 @@ case "$FIRMWARE" in
;;
"ath10k/pre-cal-ahb-a800000.wifi.bin")
case "$board" in
8dev,habanero-dvk |\
8dev,jalapeno |\
alfa-network,ap120c-ac |\
cilab,meshpoint-one |\
glinet,gl-ap1300 |\
glinet,gl-b1300 |\
glinet,gl-b2200 |\
glinet,gl-s1300 |\
linksys,ea6350v3 |\
mobipromo,cm520-79f |\
p2w,r619ac-64m |\
p2w,r619ac-128m |\
qcom,ap-dk01.1-c1)
caldata_extract "ART" 0x5000 0x2f20
;;
aruba,ap-303 |\
aruba,ap-303h |\
aruba,ap-365)
caldata_extract "ART" 0x5000 0x2f20
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary mfginfo 0x1D) 1)
;;
asus,map-ac2200 |\
asus,map-ac2200|\
asus,rt-ac58u)
caldata_extract_ubi "Factory" 0x5000 0x2f20
;;
Expand All @@ -221,25 +154,10 @@ case "$FIRMWARE" in
/usr/bin/fritz_cal_extract -i 1 -s 0x3D000 -e 0x208 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1") || \
/usr/bin/fritz_cal_extract -i 1 -s 0x3C000 -e 0x208 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1")
;;
buffalo,wtr-m2133hp)
caldata_extract "ART" 0x5000 0x2f20
ath10k_patch_mac $(mtd_get_mac_binary ORGDATA 0x2c)
;;
cellc,rtl30vw |\
compex,wpj419 |\
compex,wpj428 |\
edgecore,ecw5211 |\
edgecore,oap100 |\
engenius,eap1300 |\
engenius,eap2200 |\
luma,wrtq-329acn|\
openmesh,a42 |\
openmesh,a62 |\
plasmacloud,pa1200 |\
plasmacloud,pa2200 |\
qxwlan,e2600ac-c1 |\
qxwlan,e2600ac-c2 |\
unielec,u4019-32m)
plasmacloud,pa2200)
caldata_extract "0:ART" 0x5000 0x2f20
;;
devolo,magic-2-wifi-next)
Expand Down Expand Up @@ -286,14 +204,6 @@ case "$FIRMWARE" in
caldata_extract_mmc "0:ART" 0x5000 0x2f20
ath10k_patch_mac $(mmc_get_mac_binary ARTMTD 0xc)
;;
netgear,wac510)
caldata_extract "0:ART" 0x5000 0x2f20
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary "0:MANUDATA" 0x6) 16)
;;
teltonika,rutx10)
caldata_extract "0:ART" 0x5000 0x2f20
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary "0:CONFIG" 0x0) 3)
;;
zyxel,nbg6617 |\
zyxel,wre6606)
caldata_extract "ART" 0x5000 0x2f20
Expand Down
Expand Up @@ -211,6 +211,17 @@
label = "ART";
reg = <0x00170000 0x00010000>;
read-only;
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;

precal_art_1000: precal@1000 {
reg = <0x1000 0x2f20>;
};

precal_art_5000: precal@5000 {
reg = <0x5000 0x2f20>;
};
};

partition@180000 {
Expand Down Expand Up @@ -342,9 +353,13 @@

&wifi0 {
status = "okay";
nvmem-cell-names = "pre-calibration";
nvmem-cells = <&precal_art_1000>;
};

&wifi1 {
status = "okay";
qcom,ath10k-calibration-variant = "ALFA-Network-AP120C-AC";
nvmem-cell-names = "pre-calibration";
nvmem-cells = <&precal_art_5000>;
};
Expand Up @@ -116,15 +116,18 @@

&wifi0 {
status = "okay";
nvmem-cell-names = "pre-calibration";
nvmem-cells = <&precal_art_1000>;
qcom,ath10k-calibration-variant = "linksys-ea6350v3";
};

&wifi1 {
status = "okay";
nvmem-cell-names = "pre-calibration";
nvmem-cells = <&precal_art_5000>;
qcom,ath10k-calibration-variant = "linksys-ea6350v3";
};


&blsp_dma {
status = "okay";
};
Expand Down Expand Up @@ -207,6 +210,17 @@
label = "ART";
reg = <0x00160000 0x00010000>;
read-only;
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;

precal_art_1000: precal@1000 {
reg = <0x1000 0x2f20>;
};

precal_art_5000: precal@5000 {
reg = <0x5000 0x2f20>;
};
};
u_env@170000 {
label = "u_env";
Expand Down
Expand Up @@ -188,6 +188,17 @@
label = "0:ART";
reg = <0x00180000 0x00010000>;
read-only;
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;

precal_art_1000: precal@1000 {
reg = <0x1000 0x2f20>;
};

precal_art_5000: precal@5000 {
reg = <0x5000 0x2f20>;
};
};
partition8@190000 {
compatible = "denx,fit";
Expand Down Expand Up @@ -226,10 +237,14 @@

&wifi0 {
status = "okay";
nvmem-cell-names = "pre-calibration";
nvmem-cells = <&precal_art_1000>;
qcom,ath10k-calibration-variant = "EnGenius-EAP1300";
};

&wifi1 {
status = "okay";
nvmem-cell-names = "pre-calibration";
nvmem-cells = <&precal_art_5000>;
qcom,ath10k-calibration-variant = "EnGenius-EAP1300";
};
Expand Up @@ -240,6 +240,17 @@
label = "0:ART";
reg = <0x00170000 0x00010000>;
read-only;
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;

precal_art_1000: precal@1000 {
reg = <0x1000 0x2f20>;
};

precal_art_5000: precal@5000 {
reg = <0x5000 0x2f20>;
};
};
};
};
Expand Down Expand Up @@ -306,11 +317,14 @@

&wifi0 {
status = "okay";
nvmem-cell-names = "pre-calibration";
nvmem-cells = <&precal_art_1000>;
};

&wifi1 {
status = "okay";

nvmem-cell-names = "pre-calibration";
nvmem-cells = <&precal_art_5000>;
qcom,ath10k-calibration-variant = "ALFA-Network-AP120C-AC";
};

Expand Down
Expand Up @@ -189,6 +189,17 @@
label = "ART";
reg = <0x00170000 0x00010000>;
read-only;
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;

precal_art_1000: precal@1000 {
reg = <0x1000 0x2f20>;
};

precal_art_5000: precal@5000 {
reg = <0x5000 0x2f20>;
};
};
};
};
Expand Down Expand Up @@ -260,10 +271,14 @@

&wifi0 {
status = "okay";
nvmem-cell-names = "pre-calibration";
nvmem-cells = <&precal_art_1000>;
qcom,ath10k-calibration-variant = "GL-AP1300";
};

&wifi1 {
status = "okay";
nvmem-cell-names = "pre-calibration";
nvmem-cells = <&precal_art_5000>;
qcom,ath10k-calibration-variant = "GL-AP1300";
};
Expand Up @@ -195,6 +195,17 @@
label = "ART";
reg = <0x00170000 0x00010000>;
read-only;
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;

precal_art_1000: precal@1000 {
reg = <0x1000 0x2f20>;
};

precal_art_5000: precal@5000 {
reg = <0x5000 0x2f20>;
};
};
};
};
Expand Down Expand Up @@ -246,13 +257,15 @@

&wifi0 {
status = "okay";

nvmem-cell-names = "pre-calibration";
nvmem-cells = <&precal_art_1000>;
qcom,ath10k-calibration-variant = "8devices-Jalapeno";
};

&wifi1 {
status = "okay";

nvmem-cell-names = "pre-calibration";
nvmem-cells = <&precal_art_5000>;
qcom,ath10k-calibration-variant = "8devices-Jalapeno";
};

Expand Down

0 comments on commit cfc13c4

Please sign in to comment.