aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorLech Perczak <lech.perczak@gmail.com>2023-11-16 17:30:11 +0100
committerChristian Marangi <ansuelsmth@gmail.com>2023-11-27 00:34:49 +0100
commit32098554d911f092b9779e4768bf6d819d850bb5 (patch)
tree9ad5c8f18fb035e7374682e9076c6c6545bbd6f3 /target/linux
parent7e5e0100358d59e6652ddbe2869f804c19854922 (diff)
downloadupstream-32098554d911f092b9779e4768bf6d819d850bb5.tar.gz
upstream-32098554d911f092b9779e4768bf6d819d850bb5.tar.bz2
upstream-32098554d911f092b9779e4768bf6d819d850bb5.zip
ath79: fortinet-fap-221-b: convert to nvmem-layout
Now that MAC address parser supports the hex format (without delimiters), use the canonical MAC address stored in U-boot partition. Get rid of the userspace adjustments which are no longer necessary. While at that, move the mac-base to the common part, as it is again exactly the same in both models. And convert ART partition too - keep that one separate, as calibration data length differs between the models. Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/ath79/dts/ar9344_fortinet_fap-221-b.dts33
-rw-r--r--target/linux/ath79/generic/base-files/etc/board.d/02_network4
-rw-r--r--target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac3
-rw-r--r--target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh3
4 files changed, 23 insertions, 20 deletions
diff --git a/target/linux/ath79/dts/ar9344_fortinet_fap-221-b.dts b/target/linux/ath79/dts/ar9344_fortinet_fap-221-b.dts
index b78a588f5cc..0cad9b76d15 100644
--- a/target/linux/ath79/dts/ar9344_fortinet_fap-221-b.dts
+++ b/target/linux/ath79/dts/ar9344_fortinet_fap-221-b.dts
@@ -6,6 +6,10 @@
compatible = "fortinet,fap-221-b", "qca,ar9344";
model = "Fortinet FAP-221-B";
+ aliases {
+ label-mac-device = <&eth0>;
+ };
+
leds {
compatible = "gpio-leds";
@@ -51,25 +55,34 @@
&ath9k {
ieee80211-freq-limit = <2402000 2482000>;
- nvmem-cells = <&calibration_pcie>;
- nvmem-cell-names = "calibration";
+ nvmem-cells = <&calibration_pcie>, <&macaddr_uboot_3ff80 8>;
+ nvmem-cell-names = "calibration", "mac-address";
+};
+
+&eth0 {
+ nvmem-cells = <&macaddr_uboot_3ff80 0>;
+ nvmem-cell-names = "mac-address";
};
&wmac {
ieee80211-freq-limit = <2402000 2482000 4900000 5990000>;
- nvmem-cells = <&calibration_wmac>;
- nvmem-cell-names = "calibration";
+ nvmem-cells = <&calibration_wmac>, <&macaddr_uboot_3ff80 1>;
+ nvmem-cell-names = "calibration", "mac-address";
};
&art {
- compatible = "nvmem-cells";
+ nvmem-layout {
+ compatible = "fixed-layout";
+ #address-cells = <1>;
+ #size-cells = <1>;
- calibration_wmac: calibration@1000 {
- reg = <0x1000 0x440>;
- };
+ calibration_wmac: calibration@1000 {
+ reg = <0x1000 0x440>;
+ };
- calibration_pcie: calibration@5000 {
- reg = <0x5000 0x440>;
+ calibration_pcie: calibration@5000 {
+ reg = <0x5000 0x440>;
+ };
};
};
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 cdea3b5f67f..b74a7ff6b43 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
@@ -726,10 +726,6 @@ ath79_setup_macs()
enterasys,ws-ap3705i)
label_mac=$(mtd_get_mac_ascii u-boot-env0 ethaddr)
;;
- fortinet,fap-221-b)
- lan_mac=$(mtd_get_mac_text u-boot 0x3ff80 12)
- label_mac=$lan_mac
- ;;
hak5,lan-turtle|\
hak5,packet-squirrel)
label_mac=$(mtd_get_mac_binary u-boot 0x1fc00)
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 ccff35e5c63..42b69d2ca0c 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
@@ -47,9 +47,6 @@ case "$board" in
engenius,esr900)
macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" "$PHYNBR" > /sys${DEVPATH}/macaddress
;;
- fortinet,fap-221-b)
- macaddr_add "$(mtd_get_mac_text u-boot 0x3ff80 12)" $((PHYNBR*7+1)) > /sys${DEVPATH}/macaddress
- ;;
iodata,wn-ac1600dgr)
# There is no eeprom data for 5 GHz wlan in "art" partition
# which would allow to patch the macaddress
diff --git a/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh b/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh
index 8b39a17eb0c..76f4b93a356 100644
--- a/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh
+++ b/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh
@@ -25,9 +25,6 @@ preinit_set_mac_address() {
siemens,ws-ap3610)
ip link set dev eth0 address $(mtd_get_mac_ascii cfg1 ethaddr)
;;
- fortinet,fap-221-b)
- ip link set dev eth0 address $(mtd_get_mac_text u-boot 0x3ff80 12)
- ;;
moxa,awk-1137c)
ip link set dev eth0 address $(mtd_get_mac_ascii u-boot-env mac_addr)
;;