ath79: ecb1xxx: use nvmem

Userspace handling is deprecated.

Also switch LED to led-sources for simplicity.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20529
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit is contained in:
Rosen Penev 2024-06-14 11:50:06 -07:00 committed by Hauke Mehrtens
parent 616b0cebe7
commit e5b86c2320
4 changed files with 25 additions and 17 deletions

View File

@ -8,6 +8,7 @@
/ { / {
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;
@ -35,12 +36,6 @@
default-state = "on"; default-state = "on";
}; };
wifi2g {
label = "blue:wifi2g";
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1tpt";
};
wifi5g { wifi5g {
label = "blue:wifi5g"; label = "blue:wifi5g";
gpios = <&gpio 23 GPIO_ACTIVE_LOW>; gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
@ -71,6 +66,14 @@
partition@40000 { partition@40000 {
label = "u-boot-env"; label = "u-boot-env";
reg = <0x040000 0x010000>; reg = <0x040000 0x010000>;
nvmem-layout {
compatible = "u-boot,env";
macaddr_uboot_ethaddr: ethaddr {
#nvmem-cell-cells = <1>;
};
};
}; };
partition@50000 { partition@50000 {
@ -95,6 +98,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>;
}; };
@ -120,6 +127,9 @@
phy-handle = <&phy5>; phy-handle = <&phy5>;
phy-mode = "rgmii-id"; phy-mode = "rgmii-id";
nvmem-cells = <&macaddr_uboot_ethaddr 0>;
nvmem-cell-names = "mac-address";
pll-data = <0x82000000 0x80000101 0x80001313>; pll-data = <0x82000000 0x80000101 0x80001313>;
gmac-config { gmac-config {
@ -142,5 +152,11 @@
&wmac { &wmac {
status = "okay"; status = "okay";
qca,no-eeprom; nvmem-cells = <&cal_art_1000>;
nvmem-cell-names = "calibration";
led {
led-sources = <13>;
led-active-low;
};
}; };

View File

@ -722,9 +722,7 @@ ath79_setup_macs()
;; ;;
elecom,wab-i1750-ps|\ elecom,wab-i1750-ps|\
elecom,wab-s1167-ps|\ elecom,wab-s1167-ps|\
elecom,wab-s600-ps|\ elecom,wab-s600-ps)
engenius,ecb1200|\
engenius,ecb1750)
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
label_mac=$lan_mac label_mac=$lan_mac
;; ;;

View File

@ -15,11 +15,6 @@ case "$FIRMWARE" in
avm,fritzdvbc) avm,fritzdvbc)
caldata_extract_reverse "urlader" 0x1541 0x440 caldata_extract_reverse "urlader" 0x1541 0x440
;; ;;
engenius,ecb1200|\
engenius,ecb1750)
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env athaddr) 1)
;;
sitecom,wlr-7100|\ sitecom,wlr-7100|\
sitecom,wlr-8100) sitecom,wlr-8100)
caldata_extract "art" 0x1000 0x440 caldata_extract "art" 0x1000 0x440

View File

@ -49,8 +49,7 @@ case "$board" in
;; ;;
engenius,ecb1200|\ engenius,ecb1200|\
engenius,ecb1750) engenius,ecb1750)
[ "$PHYNBR" -eq 0 ] && \ macaddr_add "$(mtd_get_mac_ascii u-boot-env athaddr)" ${PHYNBR} > /sys${DEVPATH}/macaddress
mtd_get_mac_ascii u-boot-env athaddr > /sys${DEVPATH}/macaddress
;; ;;
enterasys,ws-ap3705i) enterasys,ws-ap3705i)
[ "$PHYNBR" -eq 0 ] && \ [ "$PHYNBR" -eq 0 ] && \