ath79: engenius,eXXX: use nvmem

Userspace handling is deprecated.

Move calibration for pcie node out of dtsi. calibration size for ath10k
and ath9k differs.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2024-06-14 11:30:31 -07:00
parent 9c413397d9
commit 67114af916
8 changed files with 72 additions and 51 deletions

View File

@ -73,12 +73,20 @@
status = "okay";
};
&wmac {
nvmem-cells = <&calibration_art_1000>;
nvmem-cell-names = "calibration";
&nvmem {
calibration_art_5000: calibration@5000 {
reg = <0x5000 0x844>;
};
};
&ath10k_0 {
nvmem-cells = <&calibration_art_5000>;
nvmem-cell-names = "calibration";
&wmac {
nvmem-cells = <&calibration_art_1000>, <&macaddr_uboot_eth 1>;
nvmem-cell-names = "calibration", "mac-address";
};
&wifi0 {
compatible = "qcom,ath10k";
nvmem-cells = <&calibration_art_5000>, <&macaddr_uboot_eth 0>;
nvmem-cell-names = "calibration", "mac-address";
};

View File

@ -73,12 +73,20 @@
status = "okay";
};
&wmac {
nvmem-cells = <&calibration_art_1000>;
nvmem-cell-names = "calibration";
&nvmem {
calibration_art_5000: calibration@5000 {
reg = <0x5000 0x844>;
};
};
&ath10k_0 {
nvmem-cells = <&calibration_art_5000>;
nvmem-cell-names = "calibration";
&wmac {
nvmem-cells = <&calibration_art_1000>, <&macaddr_uboot_eth 1>;
nvmem-cell-names = "calibration", "mac-address";
};
&wifi0 {
compatible = "qcom,ath10k";
nvmem-cells = <&calibration_art_5000>, <&macaddr_uboot_eth 0>;
nvmem-cell-names = "calibration", "mac-address";
};

View File

@ -73,12 +73,20 @@
status = "okay";
};
&wmac {
nvmem-cells = <&calibration_art_1000>;
nvmem-cell-names = "calibration";
&nvmem {
calibration_art_5000: calibration@5000 {
reg = <0x5000 0x844>;
};
};
&ath10k_0 {
nvmem-cells = <&calibration_art_5000>;
nvmem-cell-names = "calibration";
&wmac {
nvmem-cells = <&calibration_art_1000>, <&macaddr_uboot_eth 1>;
nvmem-cell-names = "calibration", "mac-address";
};
&wifi0 {
compatible = "qcom,ath10k";
nvmem-cells = <&calibration_art_5000>, <&macaddr_uboot_eth 0>;
nvmem-cell-names = "calibration", "mac-address";
};

View File

@ -73,18 +73,20 @@
status = "okay";
};
&wmac {
nvmem-cells = <&calibration_art_1000>;
nvmem-cell-names = "calibration";
};
&pcie0 {
status = "okay";
wifi@0,0 {
compatible = "pci168c,0033";
reg = <0x0000 0 0 0 0>;
nvmem-cells = <&calibration_art_5000>;
nvmem-cell-names = "calibration";
&nvmem {
calibration_art_5000: calibration@5000 {
reg = <0x5000 0x440>;
};
};
&wmac {
nvmem-cells = <&calibration_art_1000>, <&macaddr_uboot_eth 0>;
nvmem-cell-names = "calibration", "mac-address";
};
&wifi0 {
compatible = "pci168c,0033";
nvmem-cells = <&calibration_art_5000>, <&macaddr_uboot_eth 1>;
nvmem-cell-names = "calibration", "mac-address";
};

View File

@ -30,6 +30,9 @@
phy-handle = <&phy0>;
pll-data = <0xa6000000 0x00000101 0x00001616>;
nvmem-cells = <&macaddr_uboot_eth 0>;
nvmem-cell-names = "mac-address";
};
&mdio0 {
@ -43,8 +46,7 @@
&pcie0 {
status = "okay";
ath10k_0: wifi@0,0 {
compatible = "qcom,ath10k";
wifi0: wifi@0,0 {
reg = <0x0000 0 0 0 0>;
};
};
@ -72,6 +74,16 @@
label = "u-boot-env";
reg = <0x030000 0x010000>;
read-only;
nvmem-layout {
compatible = "u-boot,env";
#address-cells = <1>;
#size-cells = <1>;
macaddr_uboot_eth: ethaddr {
#nvmem-cell-cells = <1>;
};
};
};
partition@40000 {
@ -103,7 +115,7 @@
reg = <0xff0000 0x010000>;
read-only;
nvmem-layout {
nvmem: nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
@ -111,10 +123,6 @@
calibration_art_1000: calibration@1000 {
reg = <0x1000 0x440>;
};
calibration_art_5000: calibration@5000 {
reg = <0x5000 0x844>;
};
};
};
};

View File

@ -726,7 +726,6 @@ ath79_setup_macs()
engenius,esr1200|\
engenius,esr1750|\
engenius,esr900)
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
;;
engenius,ews511ap)

View File

@ -47,12 +47,6 @@ case "$board" in
[ "$PHYNBR" -eq 0 ] && \
mtd_get_mac_ascii u-boot-env athaddr > /sys${DEVPATH}/macaddress
;;
engenius,epg5000|\
engenius,esr1200|\
engenius,esr1750|\
engenius,esr900)
macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" "$PHYNBR" > /sys${DEVPATH}/macaddress
;;
engenius,ews511ap)
[ "$PHYNBR" -eq 0 ] && \
macaddr_add $(cat /sys/class/net/eth0/address) 1 > /sys${DEVPATH}/macaddress

View File

@ -12,12 +12,6 @@ preinit_set_mac_address() {
ip link set dev eth0 address $(mtd_get_mac_ascii bdcfg "lanmac")
ip link set dev eth1 address $(mtd_get_mac_ascii bdcfg "wanmac")
;;
engenius,epg5000|\
engenius,esr1200|\
engenius,esr1750|\
engenius,esr900)
ip link set dev eth0 address $(mtd_get_mac_ascii u-boot-env ethaddr)
;;
enterasys,ws-ap3705i)
ip link set dev eth0 address $(mtd_get_mac_ascii u-boot-env0 ethaddr)
;;