[OpenWrt-Devel] [PATCH] ath79: fix base-files for zyxel, nbg6716 after split
Adrian Schmutzler
freifunk at adrianschmutzler.de
Sun Oct 27 09:40:37 EDT 2019
Due to rebase of the base-files split patch after adding support
for zyxel,nbg6716, its base-files were added to the generic
subtarget, although the device belongs to nand.
This moves the definitions to their proper locations.
Fixes: 0130022baec0 ("ath79: split base-files into subtargets")
Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
This is a quick fix. Expect less care than usual.
---
.../generic/base-files/etc/board.d/02_network | 8 -------
.../etc/hotplug.d/firmware/10-ath9k-eeprom | 4 ----
.../etc/hotplug.d/firmware/11-ath10k-caldata | 4 ----
.../base-files/lib/upgrade/platform.sh | 3 ---
.../nand/base-files/etc/board.d/02_network | 8 +++++++
.../etc/hotplug.d/firmware/10-ath9k-eeprom | 21 ++++++++++++++++++
.../etc/hotplug.d/firmware/11-ath10k-caldata | 22 +++++++++++++++++++
.../nand/base-files/lib/upgrade/platform.sh | 3 +++
8 files changed, 54 insertions(+), 19 deletions(-)
create mode 100644 target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
create mode 100644 target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
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 7507c6584c..90f622b262 100755
--- a/target/linux/ath79/generic/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network
@@ -261,10 +261,6 @@ ath79_setup_interfaces()
ucidef_add_switch "switch0" \
"0 at eth0" "3:lan:1" "4:lan:2"
;;
- zyxel,nbg6716)
- ucidef_add_switch "switch0" \
- "0 at eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6 at eth1"
- ;;
*)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
;;
@@ -399,10 +395,6 @@ ath79_setup_macs()
wd,mynet-wifi-rangeextender)
lan_mac=$(nvram get et0macaddr)
;;
- zyxel,nbg6716)
- lan_mac=$(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +2)
- wan_mac=$(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +3)
- ;;
esac
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index f1bc6c3c22..4b07660f02 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -47,10 +47,6 @@ case "$FIRMWARE" in
caldata_extract "radiocfg" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan24mac")
;;
- zyxel,nbg6716)
- caldata_extract "art" 0x1000 0x440
- ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env ethaddr)
- ;;
*)
caldata_die "board $board is not supported yet"
;;
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 91e813f121..b2ec803a72 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -113,10 +113,6 @@ case "$FIRMWARE" in
ubnt,unifiac-pro)
caldata_extract "EEPROM" 0x5000 0x844
;;
- zyxel,nbg6716)
- caldata_extract "art" 0x5000 0x844
- ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1)
- ;;
esac
;;
"ath10k/pre-cal-pci-0000:00:00.0.bin")
diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
index 83c4e78d25..10756abbaf 100644
--- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
@@ -51,9 +51,6 @@ platform_do_upgrade() {
ubnt,routerstation-pro)
echo "Sysupgrade disabled due bug FS#2428"
;;
- zyxel,nbg6716)
- nand_do_upgrade "$1"
- ;;
*)
default_do_upgrade "$1"
;;
diff --git a/target/linux/ath79/nand/base-files/etc/board.d/02_network b/target/linux/ath79/nand/base-files/etc/board.d/02_network
index 65ce439545..1e013f40d1 100755
--- a/target/linux/ath79/nand/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/nand/base-files/etc/board.d/02_network
@@ -8,6 +8,10 @@ ath79_setup_interfaces()
local board="$1"
case "$board" in
+ zyxel,nbg6716)
+ ucidef_add_switch "switch0" \
+ "0 at eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6 at eth1"
+ ;;
*)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
;;
@@ -19,6 +23,10 @@ ath79_setup_macs()
local board="$1"
case "$board" in
+ zyxel,nbg6716)
+ lan_mac=$(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +2)
+ wan_mac=$(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +3)
+ ;;
esac
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
new file mode 100644
index 0000000000..88a40b5d41
--- /dev/null
+++ b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+[ -e /lib/firmware/$FIRMWARE ] && exit 0
+
+. /lib/functions/caldata.sh
+
+board=$(board_name)
+
+case "$FIRMWARE" in
+"ath9k-eeprom-ahb-18100000.wmac.bin")
+ case $board in
+ zyxel,nbg6716)
+ caldata_extract "art" 0x1000 0x440
+ ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env ethaddr)
+ ;;
+ *)
+ caldata_die "board $board is not supported yet"
+ ;;
+ esac
+ ;;
+esac
diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
new file mode 100644
index 0000000000..75fdd42cdd
--- /dev/null
+++ b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+[ -e /lib/firmware/$FIRMWARE ] && exit 0
+
+. /lib/functions/caldata.sh
+. /lib/functions/k2t.sh
+
+board=$(board_name)
+
+case "$FIRMWARE" in
+"ath10k/cal-pci-0000:00:00.0.bin")
+ case $board in
+ zyxel,nbg6716)
+ caldata_extract "art" 0x5000 0x844
+ ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1)
+ ;;
+ esac
+ ;;
+*)
+ exit 1
+ ;;
+esac
diff --git a/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh b/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh
index b02ab9a080..6abd7dd0f1 100644
--- a/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh
@@ -13,6 +13,9 @@ platform_do_upgrade() {
local board=$(board_name)
case "$board" in
+ zyxel,nbg6716)
+ nand_do_upgrade "$1"
+ ;;
*)
default_do_upgrade "$1"
;;
--
2.20.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list