Skip to content

Commit 5e3a602

Browse files
nehebhauke
authored andcommitted
ath79: sitecom,wlrx100: use nvmem
Userspace handling is deprecated. Also use led-sources for simplicity. Signed-off-by: Rosen Penev <[email protected]> Link: openwrt/openwrt#20508 Signed-off-by: Hauke Mehrtens <[email protected]>
1 parent ff1419f commit 5e3a602

File tree

5 files changed

+51
-30
lines changed

5 files changed

+51
-30
lines changed

target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
compatible = "sitecom,wlr-7100", "qca,ar9344";
1212

1313
aliases {
14+
label-mac-device = &eth0;
1415
led-boot = &led_power;
1516
led-failsafe = &led_power;
1617
led-running = &led_power;
@@ -47,12 +48,6 @@
4748
gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
4849
default-state = "on";
4950
};
50-
51-
wlan2g {
52-
label = "blue:wlan2g";
53-
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
54-
linux,default-trigger = "phy1tpt";
55-
};
5651
};
5752
};
5853

@@ -64,6 +59,9 @@
6459
phy-mode = "rgmii";
6560
phy-handle = <&phy0>;
6661

62+
nvmem-cells = <&macaddr_uboot_ethaddr 0>;
63+
nvmem-cell-names = "mac-address";
64+
6765
gmac-config {
6866
device = <&gmac>;
6967
rgmii-gmac0 = <1>;
@@ -95,8 +93,8 @@
9593
wifi@0,0 {
9694
compatible = "qcom,ath10k";
9795
reg = <0x0000 0 0 0 0>;
98-
nvmem-cells = <&cal_art_5000>;
99-
nvmem-cell-names = "calibration";
96+
nvmem-cells = <&cal_art_5000>, <&macaddr_uboot_ethaddr 1>;
97+
nvmem-cell-names = "calibration", "mac-address";
10098
};
10199
};
102100

@@ -127,6 +125,14 @@
127125
label = "u-boot-env";
128126
reg = <0x030000 0x010000>;
129127
read-only;
128+
129+
nvmem-layout {
130+
compatible = "u-boot,env";
131+
132+
macaddr_uboot_ethaddr: ethaddr {
133+
#nvmem-cell-cells = <1>;
134+
};
135+
};
130136
};
131137

132138
partition@40000 {
@@ -157,6 +163,10 @@
157163
#address-cells = <1>;
158164
#size-cells = <1>;
159165

166+
cal_art_1000: calibration@1000 {
167+
reg = <0x1000 0x440>;
168+
};
169+
160170
cal_art_5000: calibration@5000 {
161171
reg = <0x5000 0x844>;
162172
};
@@ -177,5 +187,11 @@
177187
&wmac {
178188
status = "okay";
179189

180-
qca,no-eeprom;
190+
nvmem-cells = <&cal_art_1000>, <&macaddr_uboot_ethaddr 0>;
191+
nvmem-cell-names = "calibration", "mac-address";
192+
193+
led {
194+
led-sources = <14>;
195+
led-active-low;
196+
};
181197
};

target/linux/ath79/dts/qca9558_sitecom_wlr-8100.dts

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
compatible = "sitecom,wlr-8100", "qca,qca9558";
1212

1313
aliases {
14+
label-mac-device = &eth0;
1415
led-boot = &led_status_amber;
1516
led-failsafe = &led_status_amber;
1617
led-running = &led_status_amber;
@@ -48,12 +49,6 @@
4849
gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
4950
};
5051

51-
wifi2g {
52-
label = "blue:wifi2g";
53-
gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
54-
linux,default-trigger = "phy1tpt";
55-
};
56-
5752
wifi5g {
5853
label = "blue:wifi5g";
5954
gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
@@ -85,6 +80,14 @@
8580
label = "u-boot-env";
8681
reg = <0x030000 0x010000>;
8782
read-only;
83+
84+
nvmem-layout {
85+
compatible = "u-boot,env";
86+
87+
macaddr_uboot_ethaddr: ethaddr {
88+
#nvmem-cell-cells = <1>;
89+
};
90+
};
8891
};
8992

9093
partition@40000 {
@@ -121,6 +124,10 @@
121124
#address-cells = <1>;
122125
#size-cells = <1>;
123126

127+
cal_art_1000: calibration@1000 {
128+
reg = <0x1000 0x440>;
129+
};
130+
124131
cal_art_5000: calibration@5000 {
125132
reg = <0x5000 0x844>;
126133
};
@@ -140,8 +147,8 @@
140147
wifi@0,0 {
141148
compatible = "qcom,ath10k";
142149
reg = <0 0 0 0 0>;
143-
nvmem-cells = <&cal_art_5000>;
144-
nvmem-cell-names = "calibration";
150+
nvmem-cells = <&cal_art_5000>, <&macaddr_uboot_ethaddr 1>;
151+
nvmem-cell-names = "calibration", "mac-address";
145152
};
146153
};
147154

@@ -175,6 +182,9 @@
175182
phy-handle = <&phy0>;
176183
pll-data = <0xa6000000 0x00000101 0x00001616>;
177184

185+
nvmem-cells = <&macaddr_uboot_ethaddr 0>;
186+
nvmem-cell-names = "mac-address";
187+
178188
gmac-config {
179189
device = <&gmac>;
180190
rgmii-enabled = <1>;
@@ -183,5 +193,12 @@
183193

184194
&wmac {
185195
status = "okay";
186-
qca,no-eeprom;
196+
197+
nvmem-cells = <&cal_art_1000>, <&macaddr_uboot_ethaddr 0>;
198+
nvmem-cell-names = "calibration", "mac-address";
199+
200+
led {
201+
led-sources = <19>;
202+
led-active-low;
203+
};
187204
};

target/linux/ath79/generic/base-files/etc/board.d/02_network

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -808,9 +808,7 @@ ath79_setup_macs()
808808
;;
809809
sitecom,wlr-7100|\
810810
sitecom,wlr-8100)
811-
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
812811
wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
813-
label_mac=$lan_mac
814812
;;
815813
tplink,archer-a7-v5|\
816814
tplink,archer-a9-v6|\

target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ case "$FIRMWARE" in
1515
avm,fritzdvbc)
1616
caldata_extract_reverse "urlader" 0x1541 0x440
1717
;;
18-
sitecom,wlr-7100|\
19-
sitecom,wlr-8100)
20-
caldata_extract "art" 0x1000 0x440
21-
ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env ethaddr)
22-
;;
2318
moxa,awk-1137c)
2419
caldata_extract "art" 0x1000 0x440
2520
ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env mac_addr)

target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,6 @@ case "$board" in
8080
# which would allow to patch the macaddress
8181
macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" $PHYNBR > /sys${DEVPATH}/macaddress
8282
;;
83-
sitecom,wlr-7100|\
84-
sitecom,wlr-8100)
85-
[ "$PHYNBR" -eq 0 ] && \
86-
macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 1 > /sys${DEVPATH}/macaddress
87-
;;
8883
dlink,dir-842-c1|\
8984
dlink,dir-842-c2|\
9085
dlink,dir-842-c3|\

0 commit comments

Comments
 (0)