summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRosen Penev2024-06-11 22:37:37 +0000
committerHauke Mehrtens2025-08-24 14:41:37 +0000
commit132b6862a074f9ebae8ef055b03e7994a2ce469f (patch)
tree5d30f194aad501c020949e0dd62eeeccf6ebae89
parent749fa79e016cd3c22ce5ee7a53c4dc61f67c8a8a (diff)
downloadopenwrt-132b6862a074f9ebae8ef055b03e7994a2ce469f.tar.gz
ath79: trendnet,tew-823dru: use nvmem
Removes deprecated userspace handling. Signed-off-by: Rosen Penev <rosenp@gmail.com> Link: https://github.com/openwrt/openwrt/pull/16287 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts36
-rw-r--r--target/linux/ath79/generic/base-files/etc/board.d/02_network5
-rw-r--r--target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac8
3 files changed, 34 insertions, 15 deletions
diff --git a/target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts b/target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts
index d2e381eb4b..817ce3bf1e 100644
--- a/target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts
+++ b/target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts
@@ -11,6 +11,7 @@
model = "TRENDNET TEW-823DRU";
aliases {
+ label-mac-device = &eth1;
led-boot = &led_power_green;
led-failsafe = &led_power_green;
led-running = &led_power_green;
@@ -64,6 +65,13 @@
&pcie0 {
status = "okay";
+
+ wifi@0,0 {
+ compatible = "qcom,ath10k";
+ reg = <0 0 0 0 0>;
+ nvmem-cells = <&maccaddr_mac_wan 1>;
+ nvmem-cell-names = "mac-address";
+ };
};
&pcie1 {
@@ -133,6 +141,24 @@
label = "mac";
reg = <0xfe0000 0x010000>;
read-only;
+
+ nvmem-layout {
+ compatible = "fixed-layout";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ maccaddr_mac_lan: macaddr@4 {
+ compatible = "mac-base";
+ reg = <0x4 0x11>;
+ #nvmem-cell-cells = <1>;
+ };
+
+ maccaddr_mac_wan: macaddr@18 {
+ compatible = "mac-base";
+ reg = <0x18 0x11>;
+ #nvmem-cell-cells = <1>;
+ };
+ };
};
partition@ff0000 {
@@ -172,6 +198,9 @@
&eth0 {
status = "okay";
+ nvmem-cells = <&maccaddr_mac_lan 0>;
+ nvmem-cell-names = "mac-address";
+
phy-handle = <&phy0>;
pll-data = <0x56000000 0x00000101 0x00001616>;
@@ -184,6 +213,9 @@
&eth1 {
status = "okay";
+ nvmem-cells = <&maccaddr_mac_wan 0>;
+ nvmem-cell-names = "mac-address";
+
pll-data = <0x03000101 0x00000101 0x00001616>;
fixed-link {
@@ -195,6 +227,6 @@
&wmac {
status = "okay";
- nvmem-cells = <&cal_art_1000>;
- nvmem-cell-names = "calibration";
+ nvmem-cells = <&cal_art_1000>, <&maccaddr_mac_lan 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 545bc14e36..f38eaa7866 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
@@ -846,11 +846,6 @@ ath79_setup_macs()
base_mac=$(mtd_get_mac_binary info 0x8)
wan_mac=$(macaddr_add "$base_mac" 1)
;;
- trendnet,tew-823dru)
- lan_mac=$(mtd_get_mac_text mac 0x4)
- wan_mac=$(mtd_get_mac_text mac 0x18)
- label_mac=$wan_mac
- ;;
ubnt,powerbridge-m|\
ubnt,rocket-m|\
ubnt,unifi)
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 4dfc67e280..9b5593b972 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
@@ -112,14 +112,6 @@ case "$board" in
[ "$PHYNBR" -eq 1 ] && \
macaddr_add $base_mac 1 > /sys${DEVPATH}/macaddress
;;
- trendnet,tew-823dru)
- # set the 2.4G interface mac address to LAN MAC
- [ "$PHYNBR" -eq 1 ] && \
- mtd_get_mac_text mac 4 > /sys${DEVPATH}/macaddress
- # set the 5G interface mac address to WAN MAC + 1
- [ "$PHYNBR" -eq 0 ] && \
- macaddr_add "$(mtd_get_mac_text mac 0x18)" 1 > /sys${DEVPATH}/macaddress
- ;;
zyxel,nwa1123-ac)
[ "$PHYNBR" -eq 0 ] && \
mtd_get_mac_text mib0 0x66 > /sys${DEVPATH}/macaddress