ath79: sitecom,wlrx100: use nvmem

Userspace handling is deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2024-06-15 15:13:07 -07:00
parent 63a9b86336
commit 5dfc48e04e
5 changed files with 37 additions and 14 deletions

View File

@ -11,6 +11,7 @@
compatible = "sitecom,wlr-7100", "qca,ar9344"; compatible = "sitecom,wlr-7100", "qca,ar9344";
aliases { aliases {
label-mac-device = &eth0;
led-boot = &led_power; led-boot = &led_power;
led-failsafe = &led_power; led-failsafe = &led_power;
led-running = &led_power; led-running = &led_power;
@ -64,6 +65,9 @@
phy-mode = "rgmii"; phy-mode = "rgmii";
phy-handle = <&phy0>; phy-handle = <&phy0>;
nvmem-cells = <&macaddr_uboot_ethaddr 0>;
nvmem-cell-names = "mac-address";
gmac-config { gmac-config {
device = <&gmac>; device = <&gmac>;
rgmii-gmac0 = <1>; rgmii-gmac0 = <1>;
@ -95,8 +99,8 @@
wifi@0,0 { wifi@0,0 {
compatible = "qcom,ath10k"; compatible = "qcom,ath10k";
reg = <0x0000 0 0 0 0>; reg = <0x0000 0 0 0 0>;
nvmem-cells = <&cal_art_5000>; nvmem-cells = <&cal_art_5000>, <&macaddr_uboot_ethaddr 1>;
nvmem-cell-names = "calibration"; nvmem-cell-names = "calibration", "mac-address";
}; };
}; };
@ -124,9 +128,14 @@
}; };
uenv: partition@30000 { uenv: partition@30000 {
compatible = "u-boot,env";
label = "u-boot-env"; label = "u-boot-env";
reg = <0x030000 0x010000>; reg = <0x030000 0x010000>;
read-only; read-only;
macaddr_uboot_ethaddr: ethaddr {
#nvmem-cell-cells = <1>;
};
}; };
partition@40000 { partition@40000 {
@ -157,6 +166,10 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
cal_art_1000: calibration@1000 {
reg = <0x1000 0x440>;
};
cal_art_5000: calibration@5000 { cal_art_5000: calibration@5000 {
reg = <0x5000 0x844>; reg = <0x5000 0x844>;
}; };
@ -177,5 +190,6 @@
&wmac { &wmac {
status = "okay"; status = "okay";
qca,no-eeprom; nvmem-cells = <&cal_art_1000>, <&macaddr_uboot_ethaddr 0>;
nvmem-cell-names = "calibration", "mac-address";
}; };

View File

@ -11,6 +11,7 @@
compatible = "sitecom,wlr-8100", "qca,qca9558"; compatible = "sitecom,wlr-8100", "qca,qca9558";
aliases { aliases {
label-mac-device = &eth0;
led-boot = &led_status_amber; led-boot = &led_status_amber;
led-failsafe = &led_status_amber; led-failsafe = &led_status_amber;
led-running = &led_status_amber; led-running = &led_status_amber;
@ -82,9 +83,14 @@
}; };
partition@30000 { partition@30000 {
compatible = "u-boot,env";
label = "u-boot-env"; label = "u-boot-env";
reg = <0x030000 0x010000>; reg = <0x030000 0x010000>;
read-only; read-only;
macaddr_uboot_ethaddr: ethaddr {
#nvmem-cell-cells = <1>;
};
}; };
partition@40000 { partition@40000 {
@ -121,6 +127,10 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
cal_art_1000: calibration@1000 {
reg = <0x1000 0x440>;
};
cal_art_5000: calibration@5000 { cal_art_5000: calibration@5000 {
reg = <0x5000 0x844>; reg = <0x5000 0x844>;
}; };
@ -140,8 +150,8 @@
wifi@0,0 { wifi@0,0 {
compatible = "qcom,ath10k"; compatible = "qcom,ath10k";
reg = <0 0 0 0 0>; reg = <0 0 0 0 0>;
nvmem-cells = <&cal_art_5000>; nvmem-cells = <&cal_art_5000>, <&macaddr_uboot_ethaddr 1>;
nvmem-cell-names = "calibration"; nvmem-cell-names = "calibration", "mac-address";
}; };
}; };
@ -175,6 +185,9 @@
phy-handle = <&phy0>; phy-handle = <&phy0>;
pll-data = <0xa6000000 0x00000101 0x00001616>; pll-data = <0xa6000000 0x00000101 0x00001616>;
nvmem-cells = <&macaddr_uboot_ethaddr 0>;
nvmem-cell-names = "mac-address";
gmac-config { gmac-config {
device = <&gmac>; device = <&gmac>;
rgmii-enabled = <1>; rgmii-enabled = <1>;
@ -183,5 +196,7 @@
&wmac { &wmac {
status = "okay"; status = "okay";
qca,no-eeprom;
nvmem-cells = <&cal_art_1000>, <&macaddr_uboot_ethaddr 0>;
nvmem-cell-names = "calibration", "mac-address";
}; };

View File

@ -811,9 +811,7 @@ ath79_setup_macs()
;; ;;
sitecom,wlr-7100|\ sitecom,wlr-7100|\
sitecom,wlr-8100) sitecom,wlr-8100)
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
label_mac=$lan_mac
;; ;;
tplink,archer-a7-v5|\ tplink,archer-a7-v5|\
tplink,archer-a9-v6|\ tplink,archer-a9-v6|\

View File

@ -23,9 +23,7 @@ case "$FIRMWARE" in
iodata,wn-ac1167dgr|\ iodata,wn-ac1167dgr|\
iodata,wn-ac1600dgr|\ iodata,wn-ac1600dgr|\
iodata,wn-ac1600dgr2|\ iodata,wn-ac1600dgr2|\
iodata,wn-ag300dgr|\ iodata,wn-ag300dgr)
sitecom,wlr-7100|\
sitecom,wlr-8100)
caldata_extract "art" 0x1000 0x440 caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env ethaddr) ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env ethaddr)
;; ;;

View File

@ -72,9 +72,7 @@ case "$board" in
;; ;;
iodata,wn-ac1167dgr|\ iodata,wn-ac1167dgr|\
iodata,wn-ac1600dgr|\ iodata,wn-ac1600dgr|\
iodata,wn-ac1600dgr2|\ iodata,wn-ac1600dgr2)
sitecom,wlr-7100|\
sitecom,wlr-8100)
# There is no eeprom data for 5 GHz wlan in "art" partition # There is no eeprom data for 5 GHz wlan in "art" partition
# which would allow to patch the macaddress # which would allow to patch the macaddress
[ "$PHYNBR" -eq 0 ] && \ [ "$PHYNBR" -eq 0 ] && \