ipq806x: use nvmem for wifi mac

Userspace handling is deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2024-08-22 10:47:03 -07:00
parent 7a7ea98400
commit f164784612
4 changed files with 45 additions and 6 deletions

View File

@ -45,7 +45,6 @@ case "$FIRMWARE" in
;; ;;
linksys,ea7500-v1 |\ linksys,ea7500-v1 |\
linksys,ea8500) linksys,ea8500)
caldata_extract "art" 0x1000 0x2f20
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) 1) ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) 1)
;; ;;
meraki,mr42) meraki,mr42)
@ -80,7 +79,6 @@ case "$FIRMWARE" in
;; ;;
linksys,ea7500-v1 |\ linksys,ea7500-v1 |\
linksys,ea8500) linksys,ea8500)
caldata_extract "art" 0x5000 0x2f20
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) 2) ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) 2)
;; ;;
meraki,mr42 |\ meraki,mr42 |\

View File

@ -12,9 +12,6 @@ PHYNBR=${DEVPATH##*/phy}
board=$(board_name) board=$(board_name)
case "$board" in case "$board" in
ubnt,unifi-ac-hd)
macaddr_add $(mtd_get_mac_binary EEPROM 0x6) $(($PHYNBR + 1)) > /sys${DEVPATH}/macaddress
;;
extreme,ap3935) extreme,ap3935)
echo "##### PHYNBR=$PHYNBR DEVPATH=$DEVPATH" echo "##### PHYNBR=$PHYNBR DEVPATH=$DEVPATH"
[ "$PHYNBR" = "0" ] && echo $(mtd_get_mac_ascii CFG1 RADIOADDR0) > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "0" ] && echo $(mtd_get_mac_ascii CFG1 RADIOADDR0) > /sys${DEVPATH}/macaddress

View File

@ -52,10 +52,24 @@
status = "okay"; status = "okay";
max-link-speed = <1>; max-link-speed = <1>;
wifi@0,0 {
compatible = "qcom,ath10k";
reg = <0x0000 0 0 0 0>;
nvmem-cells = <&precal_art_1000>;
nvmem-cell-names = "pre-calibration";
};
}; };
&pcie1 { &pcie1 {
status = "okay"; status = "okay";
wifi@0,0 {
compatible = "qcom,ath10k";
reg = <0x0000 0 0 0 0>;
nvmem-cells = <&precal_art_5000>;
nvmem-cell-names = "pre-calibration";
};
}; };
&nand { &nand {
@ -129,6 +143,20 @@
label = "art"; label = "art";
reg = <0x0c80000 0x0140000>; reg = <0x0c80000 0x0140000>;
read-only; read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
precal_art_1000: pre-calibration@1000 {
reg = <0x1000 0x2f20>;
};
precal_art_5000: pre-calibration@5000 {
reg = <0x1000 0x2f20>;
};
};
}; };
partition@dc0000 { partition@dc0000 {

View File

@ -190,7 +190,9 @@
}; };
macaddr_eeprom_6: macaddr@6 { macaddr_eeprom_6: macaddr@6 {
compatible = "mac-base";
reg = <0x6 0x6>; reg = <0x6 0x6>;
#nvmem-cell-cells = <1>;
}; };
}; };
}; };
@ -262,7 +264,7 @@
phy-mode = "sgmii"; phy-mode = "sgmii";
qcom,id = <1>; qcom,id = <1>;
nvmem-cells = <&macaddr_eeprom_6>; nvmem-cells = <&macaddr_eeprom_6 0>;
nvmem-cell-names = "mac-address"; nvmem-cell-names = "mac-address";
}; };
@ -280,10 +282,24 @@
&pcie0 { &pcie0 {
status = "okay"; status = "okay";
wifi@0,0 {
compatible = "qcom,ath10k";
reg = <0x0000 0 0 0 0>;
nvmem-cells = <&macaddr_eeprom_6 1>;
nvmem-cell-names = "mac-address";
};
}; };
&pcie1 { &pcie1 {
status = "okay"; status = "okay";
wifi@0,0 {
compatible = "qcom,ath10k";
reg = <0x0000 0 0 0 0>;
nvmem-cells = <&macaddr_eeprom_6 2>;
nvmem-cell-names = "mac-address";
};
}; };
&tcsr { &tcsr {