From patchwork Mon Jan 28 13:54:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [v2,3/5] Add support for Archer C60 v2 From: Adrian Schmutzler X-Patchwork-Id: 998 Message-Id: <20190128135425.8722-3-freifunk@adrianschmutzler.de> To: franken-dev@freifunk.net Date: Mon, 28 Jan 2019 14:54:23 +0100 This device requires an additional patch to set the 5 GHz MAC address correctly. This seems to be wrong in OpenWrt, the patch has been sent upstream. Signed-off-by: Adrian Schmutzler Reviewed-by: Christian Dresel --- Changes in v2: - Removed CPUPORT This has been tested by me on two devices, again only with my firmware (newer OpenWrt, generic subtarget). I will use it in production now. --- bsp/ar71xx/.config | 2 ++ bsp/board_ar71xx.bsp | 1 + .../0005-allow-building-all-devives-as-tiny.patch | 11 +++--- ...x-Fix-5-GHz-MAC-address-for-Archer-C60-v2.patch | 41 ++++++++++++++++++++++ .../fff/fff-network/ar71xx/network.archer-c60-v2 | 9 +++++ 5 files changed, 59 insertions(+), 5 deletions(-) create mode 100644 build_patches/openwrt/0006-ar71xx-Fix-5-GHz-MAC-address-for-Archer-C60-v2.patch create mode 100644 src/packages/fff/fff-network/ar71xx/network.archer-c60-v2 diff --git a/bsp/ar71xx/.config b/bsp/ar71xx/.config index 22716c40..ec90edf2 100644 --- a/bsp/ar71xx/.config +++ b/bsp/ar71xx/.config @@ -8,6 +8,8 @@ CONFIG_TARGET_DEVICE_ar71xx_tiny_DEVICE_archer-c25-v1=y CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_tiny_DEVICE_archer-c25-v1="-kmod-ath10k kmod-ath10k-ct" CONFIG_TARGET_DEVICE_ar71xx_tiny_DEVICE_archer-c60-v1=y CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_tiny_DEVICE_archer-c60-v1="-kmod-ath10k kmod-ath10k-ct -ath10k-firmware-qca9888 ath10k-firmware-qca9888-ct" +CONFIG_TARGET_DEVICE_ar71xx_tiny_DEVICE_archer-c60-v2=y +CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_tiny_DEVICE_archer-c60-v2="-kmod-ath10k kmod-ath10k-ct -ath10k-firmware-qca9888 ath10k-firmware-qca9888-ct" CONFIG_TARGET_DEVICE_ar71xx_tiny_DEVICE_archer-c7-v2=y CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_tiny_DEVICE_archer-c7-v2="-kmod-ath10k kmod-ath10k-ct" CONFIG_TARGET_DEVICE_ar71xx_tiny_DEVICE_cpe210-220-v1=y diff --git a/bsp/board_ar71xx.bsp b/bsp/board_ar71xx.bsp index dad4d1f5..db5d3059 100644 --- a/bsp/board_ar71xx.bsp +++ b/bsp/board_ar71xx.bsp @@ -4,6 +4,7 @@ subtarget=tiny target=$builddir/$machine images=("openwrt-${chipset}-${subtarget}-archer-c25-v1-squashfs-sysupgrade.bin" "openwrt-${chipset}-${subtarget}-archer-c60-v1-squashfs-sysupgrade.bin" + "openwrt-${chipset}-${subtarget}-archer-c60-v2-squashfs-sysupgrade.bin" "openwrt-${chipset}-${subtarget}-archer-c7-v2-squashfs-sysupgrade.bin" "openwrt-${chipset}-${subtarget}-cpe210-220-v1-squashfs-sysupgrade.bin" "openwrt-${chipset}-${subtarget}-cpe510-520-v1-squashfs-sysupgrade.bin" diff --git a/build_patches/openwrt/0005-allow-building-all-devives-as-tiny.patch b/build_patches/openwrt/0005-allow-building-all-devives-as-tiny.patch index 326dff6d..ddef06ed 100644 --- a/build_patches/openwrt/0005-allow-building-all-devives-as-tiny.patch +++ b/build_patches/openwrt/0005-allow-building-all-devives-as-tiny.patch @@ -1,12 +1,12 @@ -From 7b0cf3e8670a1cb67f96d53b4aaf34f1a9774c6b Mon Sep 17 00:00:00 2001 +From 9c48a9ca226ed0c408fc1fb1cd9d66e80b4e7f19 Mon Sep 17 00:00:00 2001 From: Tim Niemeyer Date: Mon, 6 Aug 2018 18:39:04 +0200 Subject: [PATCH] allow building all devives as tiny --- target/linux/ar71xx/image/Makefile | 5 +++++ - target/linux/ar71xx/tiny/config-default | 15 +++++++++++++++ - 2 files changed, 20 insertions(+) + target/linux/ar71xx/tiny/config-default | 16 ++++++++++++++++ + 2 files changed, 21 insertions(+) diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile index 1eaf1e4..602323b 100644 @@ -25,16 +25,17 @@ index 1eaf1e4..602323b 100644 ifeq ($(SUBTARGET),nand) include ./nand.mk diff --git a/target/linux/ar71xx/tiny/config-default b/target/linux/ar71xx/tiny/config-default -index 2e9031a..4549c4a 100644 +index 2e9031a..02836de 100644 --- a/target/linux/ar71xx/tiny/config-default +++ b/target/linux/ar71xx/tiny/config-default -@@ -70,3 +70,18 @@ CONFIG_SOC_AR933X=y +@@ -70,3 +70,19 @@ CONFIG_SOC_AR933X=y CONFIG_SOC_AR934X=y CONFIG_SOC_QCA953X=y CONFIG_SOC_QCA956X=y +# FFF +CONFIG_ATH79_MACH_ARCHER_C25_V1=y +CONFIG_ATH79_MACH_ARCHER_C60_V1=y ++CONFIG_ATH79_MACH_ARCHER_C60_V2=y +CONFIG_ATH79_MACH_ARCHER_C7=y +CONFIG_ATH79_MACH_CPE510=y +CONFIG_ATH79_MACH_GL_AR150=y diff --git a/build_patches/openwrt/0006-ar71xx-Fix-5-GHz-MAC-address-for-Archer-C60-v2.patch b/build_patches/openwrt/0006-ar71xx-Fix-5-GHz-MAC-address-for-Archer-C60-v2.patch new file mode 100644 index 00000000..fecf7e6f --- /dev/null +++ b/build_patches/openwrt/0006-ar71xx-Fix-5-GHz-MAC-address-for-Archer-C60-v2.patch @@ -0,0 +1,41 @@ +From 604f8eac152cc7fec397516539b485d2e59bca70 Mon Sep 17 00:00:00 2001 +From: Adrian Schmutzler +Date: Sat, 26 Jan 2019 13:57:33 +0100 +Subject: [PATCH] ar71xx: Fix 5 GHz MAC address for Archer C60 v2 + +Looks like C60 v2 needs this the MAC address to be calculated +manually, while the C60 v1 gets it correctly without manual +interference. + +Signed-off-by: Adrian Schmutzler +--- + .../ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +index 53f5377..d21d413 100644 +--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata ++++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +@@ -168,13 +168,18 @@ case "$FIRMWARE" in + archer-c58-v1|\ + archer-c59-v1|\ + archer-c60-v1|\ +- archer-c60-v2|\ + cf-e355ac-v2|\ + cf-e375ac) + ath10kcal_extract "art" 20480 12064 + ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ + /lib/firmware/ath10k/QCA9888/hw2.0/board.bin + ;; ++ archer-c60-v2) ++ ath10kcal_extract "art" 20480 12064 ++ ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ ++ /lib/firmware/ath10k/QCA9888/hw2.0/board.bin ++ ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) -1) ++ ;; + cf-e385ac) + ath10kcal_extract "art" 20480 12064 + ;; +-- +2.7.4 + diff --git a/src/packages/fff/fff-network/ar71xx/network.archer-c60-v2 b/src/packages/fff/fff-network/ar71xx/network.archer-c60-v2 new file mode 100644 index 00000000..c1be2dc1 --- /dev/null +++ b/src/packages/fff/fff-network/ar71xx/network.archer-c60-v2 @@ -0,0 +1,9 @@ +PORTORDER="4 3 2 1" + +WANDEV=eth0 +SWITCHDEV=eth1 +CLIENT_PORTS="1 2 0t" +BATMAN_PORTS="3 4 0t" + +ETHMESHMAC=$(cat /sys/class/net/eth1/address) +ROUTERMAC=$(cat /sys/class/net/eth0/address)