From: Rosen Penev Date: Sat, 15 Jun 2024 20:42:25 +0000 (-0700) Subject: ath79: elecom,wab: use nvmem X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=70e41d0205d95386881fa1cdf6ee00f6cca1b3f6;p=openwrt%2Fstaging%2Fthess.git ath79: elecom,wab: use nvmem Userspace handling is deprecated. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16247 Signed-off-by: Hauke Mehrtens --- diff --git a/target/linux/ath79/dts/qca955x_elecom_wab.dtsi b/target/linux/ath79/dts/qca955x_elecom_wab.dtsi index 43e34c6029..53bb5b0141 100644 --- a/target/linux/ath79/dts/qca955x_elecom_wab.dtsi +++ b/target/linux/ath79/dts/qca955x_elecom_wab.dtsi @@ -8,6 +8,7 @@ / { aliases { + label-mac-device = ð0; led-boot = &led_status; led-failsafe = &led_status; led-upgrade = &led_status; @@ -107,6 +108,9 @@ phy-mode = "rgmii-rxid"; pll-data = <0xae000000 0x80000101 0x80001313>; + nvmem-cells = <&macaddr_uboot_ethaddr 0>; + nvmem-cell-names = "mac-address"; + gmac-config { device = <&gmac>; @@ -144,8 +148,8 @@ wifi@0,0 { compatible = "qcom,ath10k"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&cal_art_5000>; - nvmem-cell-names = "calibration"; + nvmem-cells = <&cal_art_5000>, <&macaddr_uboot_ethaddr 1>; + nvmem-cell-names = "calibration", "mac-address"; }; }; @@ -169,9 +173,14 @@ }; partition@40000 { + compatible = "u-boot,env"; label = "u-boot-env"; reg = <0x40000 0x10000>; read-only; + + macaddr_uboot_ethaddr: ethaddr { + #nvmem-cell-cells = <1>; + }; }; partition@50000 { @@ -252,6 +261,6 @@ &wmac { status = "okay"; - nvmem-cells = <&cal_art_1000>; - nvmem-cell-names = "calibration"; + nvmem-cells = <&cal_art_1000>, <&macaddr_uboot_ethaddr 0>; + nvmem-cell-names = "calibration", "mac-address"; }; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index ccb296a62a..bc251d0484 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -712,9 +712,6 @@ ath79_setup_macs() lan_mac=$(mtd_get_mac_ascii devdata "lanmac") wan_mac=$(mtd_get_mac_ascii devdata "wanmac") ;; - elecom,wab-i1750-ps|\ - elecom,wab-s1167-ps|\ - elecom,wab-s600-ps|\ engenius,ecb1200|\ engenius,ecb1750) lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index 15cd2adda3..0a49c0b5aa 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -42,16 +42,6 @@ case "$board" in [ "$PHYNBR" -eq 1 ] && \ mtd_get_mac_ascii bdcfg "wlanmac" > /sys${DEVPATH}/macaddress ;; - elecom,wab-i1750-ps|\ - elecom,wab-s1167-ps|\ - elecom,wab-s600-ps) - # set the 5G MAC address (= ethaddr + 1) - [ "$PHYNBR" -eq 0 ] && \ - macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 1 > /sys${DEVPATH}/macaddress - # set the 2.4G MAC address (= ethaddr) - [ "$PHYNBR" -eq 1 ] && \ - mtd_get_mac_ascii u-boot-env "ethaddr" > /sys${DEVPATH}/macaddress - ;; engenius,ecb1200|\ engenius,ecb1750) [ "$PHYNBR" -eq 0 ] && \