From b288c56e1e0b4a45579169906845c90b61e5ace4 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Sun, 27 Oct 2019 14:40:37 +0100 Subject: ath79: move base-files for ZyXEL NBG6716 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 [improve commit message, rebase] Signed-off-by: David Bauer --- .../ath79/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 ++++++++++++++++++++++ .../ath79/nand/base-files/lib/upgrade/platform.sh | 3 ++- 4 files changed, 53 insertions(+), 1 deletion(-) 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 (limited to 'target/linux/ath79/nand/base-files') 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 87c52a65cb..faf70218ac 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 @@ -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 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 bc62ede65f..6f8c7d47ff 100644 --- a/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh @@ -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" ;; *) -- cgit v1.2.3