ath79: move base-files for ZyXEL NBG6716
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>
Sun, 27 Oct 2019 13:40:37 +0000 (14:40 +0100)
committerDavid Bauer <mail@david-bauer.net>
Sun, 27 Oct 2019 17:03:56 +0000 (18:03 +0100)
Due to rebase of the base-files split patch after adding support
for the ZyXEL NBG6716, its base-files were added to the generic
subtarget, although the device belongs to the nand subtarget.

This moves the definitions to their proper locations.

Fixes: 0130022baec0 ("ath79: split base-files into subtargets")
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[improve commit message, rebase]
Signed-off-by: David Bauer <mail@david-bauer.net>
target/linux/ath79/generic/base-files/etc/board.d/02_network
target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
target/linux/ath79/nand/base-files/etc/board.d/02_network
target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom [new file with mode: 0644]
target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata [new file with mode: 0644]
target/linux/ath79/nand/base-files/lib/upgrade/platform.sh

index 7507c6584cae8c798381ae26114bb0525982f88d..90f622b26209b16ece65dd0e77a544761d24c8b4 100755 (executable)
@@ -261,10 +261,6 @@ ath79_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "0@eth0" "3:lan:1" "4:lan:2"
                ;;
-       zyxel,nbg6716)
-               ucidef_add_switch "switch0" \
-                       "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@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
index f1bc6c3c2222959939f62d67264f023339e696da..4b07660f02d21b08b3cf228f3aea01210e59ed93 100644 (file)
@@ -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"
                ;;
index 91e813f121cbf75667857e658b2303a6bd6bb369..b2ec803a72a315465e365b83c3de6e75a0475599 100644 (file)
@@ -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")
index 83c4e78d25c131fd92233339c0963180061b2150..10756abbafd50cd8a248d1c31d6416690a7c41a5 100644 (file)
@@ -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"
                ;;
index 87c52a65cba225abb70a0506ea09df52d5e6fd3e..faf70218acf7ae1ec87be31f46bd8132681050ce 100755 (executable)
@@ -11,6 +11,10 @@ ath79_setup_interfaces()
        aerohive,hiveap-121)
                ucidef_set_interface_lan "eth0"
                ;;
+       zyxel,nbg6716)
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
+               ;;
        *)
                ucidef_set_interfaces_lan_wan "eth0" "eth1"
                ;;
@@ -22,6 +26,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 (file)
index 0000000..88a40b5
--- /dev/null
@@ -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 (file)
index 0000000..75fdd42
--- /dev/null
@@ -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
index bc62ede65fdccb10e801ea1c9c4c6af7aecb05e5..6f8c7d47ff2d94e57c6c422d133ba77dc91e8668 100644 (file)
@@ -13,7 +13,8 @@ platform_do_upgrade() {
        local board=$(board_name)
 
        case "$board" in
-       aerohive,hiveap-121)
+       aerohive,hiveap-121|\
+       zyxel,nbg6716)
                nand_do_upgrade "$1"
                ;;
        *)