Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 0x4A6F-master
  • 0x4A6F-rpi4
  • autinerd/experimental-openwrt-24.10
  • experimental
  • feature/addMikrotikwAP
  • master
  • nrb/airmax-test
  • nrb/ar9344-reset-sequence
  • nrb/gluon-master-cpe510
  • nrb/test-radv-filter
  • nrbffs/fastd-remove-delay
  • nrbffs/netgear-ex6120
  • v2018.2.2-ffs
  • v2018.2.3-ffs
  • v2019.1-ffs
  • v2019.1.1-ffs
  • v2019.1.2-ffs
  • v2020.1-ffs
  • v2020.1.1-ffs
  • v2020.1.3-ffs
  • v2020.2-ffs
  • v2020.2.1-ffs
  • v2020.2.2-ffs
  • v2020.2.3-ffs
  • v2021.1-ffs
  • v2021.1.1-ffs
  • v2021.1.2-ffs
  • v2022.1.1-ffs
  • v2022.1.3-ffs
  • v2022.1.4-ffs
  • v2023.1-ffs
  • v2023.2-ffs
  • v2023.2.2-ffs
  • v2023.2.3-ffs
  • v2023.2.4-ffs
  • experimental-2022-09-24
  • experimental-2022-09-24-base
  • experimental-2023-03-11
  • experimental-2023-03-11-base
  • experimental-2023-03-12
  • experimental-2023-03-12-base
  • experimental-2023-03-16
  • experimental-2023-03-16-base
  • experimental-2023-03-20
  • experimental-2023-03-20-base
  • experimental-2023-03-23
  • experimental-2023-03-23-base
  • experimental-2023-03-25
  • experimental-2023-03-25-base
  • experimental-2023-03-26
  • experimental-2023-03-26-base
  • experimental-2023-03-30
  • experimental-2023-03-30-base
  • experimental-2023-03-31
  • experimental-2023-03-31-base
  • experimental-2023-04-01
  • experimental-2023-04-01-base
  • experimental-2023-04-08
  • experimental-2023-04-08-base
  • experimental-2023-04-10
  • experimental-2023-04-10-base
  • experimental-2023-04-13
  • experimental-2023-04-13-base
  • experimental-2023-04-15
  • experimental-2023-04-15-base
  • experimental-2023-04-16
  • experimental-2023-04-16-base
  • experimental-2023-04-18
  • experimental-2023-04-18-base
  • experimental-2023-04-20
  • experimental-2023-04-20-base
  • experimental-2023-04-26
  • experimental-2023-04-26-base
  • experimental-2023-04-28
  • experimental-2023-04-28-base
  • experimental-2023-04-30
  • experimental-2023-04-30-base
  • experimental-2023-05-02
  • experimental-2023-05-02-base
  • experimental-2023-05-03
  • experimental-2023-05-03-base
  • experimental-2023-05-12
  • experimental-2023-05-12-base
  • experimental-2023-05-21
  • experimental-2023-05-21-base
  • experimental-2023-05-25
  • experimental-2023-05-25-base
  • experimental-2023-07-02
  • experimental-2023-07-02-base
  • experimental-2023-07-04
  • experimental-2023-07-04-base
  • experimental-2023-07-12
  • experimental-2023-07-12-base
  • experimental-2023-07-16
  • experimental-2023-07-16-base
  • experimental-2023-08-04
  • experimental-2023-08-04-base
  • experimental-2023-08-10
  • experimental-2023-08-10-base
  • experimental-2023-09-08
  • experimental-2023-09-08-base
  • experimental-2023-09-09
  • experimental-2023-09-09-base
  • experimental-2023-09-10
  • experimental-2023-09-10-base
  • experimental-2023-09-11
  • experimental-2023-09-11-base
  • experimental-2023-09-12
  • experimental-2023-09-12-base
  • experimental-2023-09-13
  • experimental-2023-09-13-base
  • experimental-2023-09-15
  • experimental-2023-09-15-base
  • experimental-2023-09-16
  • experimental-2023-09-16-base
  • experimental-2023-09-18
  • experimental-2023-09-18-base
  • experimental-2023-09-20
  • experimental-2023-09-20-base
  • experimental-2023-09-27
  • experimental-2023-09-27-base
  • experimental-2023-09-28
  • experimental-2023-09-28-base
  • experimental-2023-09-29
  • experimental-2023-09-29-base
  • experimental-2023-10-02
  • experimental-2023-10-02-base
  • experimental-2023-10-13
  • experimental-2023-10-13-base
  • experimental-2023-10-14
  • experimental-2023-10-14-base
  • experimental-2023-10-16
  • experimental-2023-10-16-base
  • experimental-2023-10-23
  • experimental-2023-10-23-base
135 results

Target

Select target project
  • firmware/gluon
  • 0x4A6F/gluon
  • patrick/gluon
3 results
Select Git revision
  • 0x4A6F-master
  • 0x4A6F-rpi4
  • 2014.3.x
  • 2014.4.x
  • babel
  • hoodselector
  • master
  • radv-filterd
  • v2015.1.x
  • v2016.1.x
  • v2016.2.4-batmanbug
  • v2016.2.x
  • v2018.2.2-ffs
  • v2018.2.x
  • v2014.1
  • v2014.2
  • v2014.3
  • v2014.3.1
  • v2014.4
  • v2015.1
  • v2015.1.1
  • v2015.1.2
  • v2016.1
  • v2016.1.1
  • v2016.1.2
  • v2016.1.3
  • v2016.1.4
  • v2016.1.5
  • v2016.1.6
  • v2016.2
  • v2016.2.1
  • v2016.2.2
  • v2016.2.3
  • v2016.2.4
  • v2016.2.5
  • v2016.2.6
  • v2016.2.7
  • v2017.1
  • v2017.1.1
  • v2017.1.2
  • v2017.1.3
  • v2017.1.4
  • v2017.1.5
  • v2017.1.6
  • v2017.1.7
  • v2017.1.8
  • v2018.1
  • v2018.1.1
  • v2018.1.2
  • v2018.1.3
  • v2018.1.4
  • v2018.2
  • v2018.2-ffs0.1
  • v2018.2.1
  • v2018.2.1-ffs0.1
  • v2018.2.2-ffs0.1
56 results
Show changes
Showing
with 0 additions and 2776 deletions
From: Piotr Dymacz <pepe2k@gmail.com>
Date: Mon, 6 Nov 2017 23:17:24 +0100
Subject: ar71xx: increase kernel partition size for TP-Link RE450 v1
This increases kernel partition size and fixes rootfs (file-system)
partition size on TP-Link RE450 v1. Also, while we are at it, switch
from statically defined kernel and rootfs partitions in kernel cmdline
to "tplink-fw" mtd splitter.
Fixes: FS#1072.
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk
index 1a6e58fca882fc9d122c184ee8167537751acf25..60dfe0e3edafcadad4ddc08be7645b49f269907c 100644
--- a/target/linux/ar71xx/image/tp-link.mk
+++ b/target/linux/ar71xx/image/tp-link.mk
@@ -207,7 +207,7 @@ TARGET_DEVICES += cpe210-220 cpe510-520 wbs210 wbs510
define Device/re450
DEVICE_TITLE := TP-LINK RE450
DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x
- MTDPARTS := spi0.0:128k(u-boot)ro,1344k(kernel),4672k(rootfs),64k(pation-table)ro,64k(product-info)ro,1856k(config)ro,64k(art)ro,6016k@0x20000(firmware)
+ MTDPARTS := spi0.0:128k(u-boot)ro,6016k(firmware),64k(partition-table)ro,64k(product-info)ro,1856k(config)ro,64k(art)ro
IMAGE_SIZE := 7936k
BOARDNAME := RE450
TPLINK_BOARD_NAME := RE450
diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c
index ba86c71d870c8f38abb92c657c3656086a7782be..23b69f3bd0eb66aca650eb2ffd7d5cd2a7cb5194 100644
--- a/tools/firmware-utils/src/tplink-safeloader.c
+++ b/tools/firmware-utils/src/tplink-safeloader.c
@@ -689,8 +689,8 @@ static struct device_info boards[] = {
*/
.partitions = {
{"fs-uboot", 0x00000, 0x20000},
- {"os-image", 0x20000, 0x150000},
- {"file-system", 0x170000, 0x4a0000},
+ {"os-image", 0x20000, 0x180000},
+ {"file-system", 0x1a0000, 0x460000},
{"partition-table", 0x600000, 0x02000},
{"default-mac", 0x610000, 0x00020},
{"pin", 0x610100, 0x00020},
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Tue, 10 Apr 2018 09:03:52 +0200
Subject: include/kernel.mk: build kmod packages with empty FILES
kmod packages without FILES did not have an install step defined, leading
to no package being built. This affected netfilter/iptables packages, which
filter out builtin modules from FILES.
Not building a package that it is selected in .config is problematic, as
the generated empty package may be necessary to satisfy dependencies.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/include/kernel.mk b/include/kernel.mk
index b1d0e8d927cb462b486cfd645d68963f1b6ab8ff..d8d457fe7a5d3584d8aa4e27430da84533c85ed0 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -194,8 +194,7 @@ $(call KernelPackage/$(1)/config)
$(call KernelPackage/depends)
ifneq ($(if $(filter-out %=y %=n %=m,$(KCONFIG)),$(filter m y,$(foreach c,$(filter-out %=y %=n %=m,$(KCONFIG)),$($(c)))),.),)
- ifneq ($(strip $(FILES)),)
- define Package/kmod-$(1)/install
+ define Package/kmod-$(1)/install
@for mod in $$(call version_filter,$$(FILES)); do \
if grep -q "$$$$$$$${mod##$(LINUX_DIR)/}" "$(LINUX_DIR)/modules.builtin"; then \
echo "NOTICE: module '$$$$$$$$mod' is built-in."; \
@@ -209,8 +208,7 @@ $(call KernelPackage/$(1)/config)
done;
$(call ModuleAutoLoad,$(1),$$(1),$(AUTOLOAD))
$(call KernelPackage/$(1)/install,$$(1))
- endef
- endif
+ endef
$(if $(CONFIG_PACKAGE_kmod-$(1)),
else
compile: $(1)-disabled
From: Mathias Kresin <dev@kresin.me>
Date: Sat, 25 Mar 2017 19:18:37 +0100
Subject: build: move lzma2eva build step to image-commands.mk
Move it to image-commands.mk so that it can used by other targets with
eva based boards as well.
Signed-off-by: Mathias Kresin <dev@kresin.me>
diff --git a/include/image-commands.mk b/include/image-commands.mk
index ec35e0fcfe97d9d98c731459d1f1681d2bcfe5ad..19d98feefe02b6deb43735ccd436aac39fc0a8ab 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -11,6 +11,11 @@ define Build/uImage
mv $@.new $@
endef
+define Build/eva-image
+ $(STAGING_DIR_HOST)/bin/lzma2eva $(KERNEL_LOADADDR) $(KERNEL_LOADADDR) $@ $@.new
+ mv $@.new $@
+endef
+
define Build/netgear-chk
$(STAGING_DIR_HOST)/bin/mkchkimg \
-o $@.new \
diff --git a/target/linux/lantiq/image/Makefile b/target/linux/lantiq/image/Makefile
index a96e528aab2c5c5c95f01b087f589cecc57c6e51..2cac925bfd95fedd5f76f30e72300cc0fd7d37a9 100644
--- a/target/linux/lantiq/image/Makefile
+++ b/target/linux/lantiq/image/Makefile
@@ -20,9 +20,8 @@ else
UBIFS_OPTS := -m 2048 -e 126KiB -c 4096
endif
-define Build/eva-image
- lzma2eva $(KERNEL_LOADADDR) $(KERNEL_LOADADDR) $@ $@.new
- ( dd if=$@.new bs=64k conv=sync; cat ./eva.dummy.squashfs; ) > $@
+define Build/append-avm-fakeroot
+ cat ./eva.dummy.squashfs >> $@
endef
define Build/dgn3500-sercom-footer
@@ -104,6 +103,8 @@ endef
define Device/AVM
KERNEL := kernel-bin | append-dtb | lzma | eva-image
+ IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | append-avm-fakeroot | \
+ append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
endef
ifeq ($(SUBTARGET),xway_legacy)
From: David Bauer <mail@david-bauer.net>
Date: Tue, 24 Apr 2018 19:52:13 +0200
Subject: ar71xx: add support for Fritz!Box 4020
This commit adds support for the AVM Fritz!Box 4020 WiFi-router.
SoC: Qualcomm Atheros QCA9561 (Dragonfly) 750MHz
RAM: Winbond W971GG6KB-25
FLASH: Macronix MX25L12835F
WiFi: QCA9561 b/g/n 3x3 450Mbit/s
USB: 1x USB 2.0
IN: WPS button, WiFi button
OUT: Power LED green, Internet LED green, WLAN LED green,
LAN LED green, INFO LED green, INFO LED red
UART: Header Next to Black metal shield
Pinout is 3.3V - RX - TX - GND (Square Pad is 3.3V)
The Serial setting is 115200-8-N-1.
Tested and working:
- Ethernet (LAN + WAN)
- WiFi (correct MAC)
- Installation via EVA bootloader
- OpenWRT sysupgrade
- Buttons
- LEDs
Not working:
- USB port
Installation via EVA:
In the first seconds after Power is connected, the bootloader will
listen for FTP connections on 169.254.157.1 (Might also be 192.168.178.1). Firmware can be uploaded
like following:
ftp> quote USER adam2
ftp> quote PASS adam2
ftp> binary
ftp> debug
ftp> passive
ftp> quote MEDIA FLSH
ftp> put openwrt-sysupgrade.bin mtd1
Note that this procedure might take up to two minutes. After transfer is
complete you need to powercycle the device to boot OpenWRT.
Signed-off-by: David Bauer <mail@david-bauer.net>
diff --git a/include/image-commands.mk b/include/image-commands.mk
index 19d98feefe02b6deb43735ccd436aac39fc0a8ab..7e77b878361ef5a4f6278733d25b0a1fed0ce5ff 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -16,6 +16,16 @@ define Build/eva-image
mv $@.new $@
endef
+define Build/append-squashfs-fakeroot-be
+ rm -rf $@.fakefs $@.fakesquashfs
+ mkdir $@.fakefs
+ $(STAGING_DIR_HOST)/bin/mksquashfs-lzma \
+ $@.fakefs $@.fakesquashfs \
+ -noappend -root-owned -be -nopad -b 65536 \
+ $(if $(SOURCE_DATE_EPOCH),-fixed-time $(SOURCE_DATE_EPOCH))
+ cat $@.fakesquashfs >> $@
+endef
+
define Build/netgear-chk
$(STAGING_DIR_HOST)/bin/mkchkimg \
-o $@.new \
diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds
index f9483e9a706fbd98ce6a42e968bc0d31e9da5c84..e8b13af7c24dea86519c962fa6381fd75971e8b9 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -305,6 +305,12 @@ dlan-pro-1200-ac)
ucidef_set_led_gpio "plcw" "dLAN" "devolo:status:dlan" "17" "0"
ucidef_set_led_gpio "plcr" "dLAN" "devolo:error:dlan" "16" "0"
;;
+fritz4020)
+ ucidef_set_led_default "power" "Power" "$board:green:power" "1"
+ ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth1"
+ ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth0"
+ ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
+ ;;
gl-ar150|\
gl-ar300|\
gl-ar300m|\
diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network
index 1690172b5dfac1e1aa278c38c27ba64cfd61ade0..1018ab4449f896d565b57ecbdc73b7e3d7fbe486 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -207,6 +207,7 @@ ar71xx_setup_interfaces()
;;
archer-c58-v1|\
archer-c59-v1|\
+ fritz4020|\
rb-450g)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
ucidef_add_switch "switch0" \
diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index 945167bee6f7dad76bc650a2bb8a7a71f96b738d..7cb708ebe2e9e7546f165022233d17224905a49c 100644
--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -40,6 +40,24 @@ ath9k_ubi_eeprom_extract() {
ath9k_eeprom_die "failed to extract from $ubi"
}
+ath9k_eeprom_extract_reverse() {
+ local part=$1
+ local offset=$2
+ local count=$3
+ local mtd
+ local reversed
+ local caldata
+
+ mtd=$(find_mtd_chardev "$part")
+ reversed=$(hexdump -v -s $offset -n $count -e '/1 "%02x "' $mtd)
+
+ for byte in $reversed; do
+ caldata="\x${byte}${caldata}"
+ done
+
+ printf "%b" "$caldata" > /lib/firmware/$FIRMWARE
+}
+
ath9k_patch_firmware_mac() {
local mac=$1
@@ -58,6 +76,9 @@ case "$FIRMWARE" in
ath9k_eeprom_extract "art" 4096 2048
ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary art 0) +1)
;;
+ fritz4020)
+ ath9k_eeprom_extract_reverse "urlader" 5441 1088
+ ;;
mr18)
. /lib/upgrade/nand.sh
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 59ede17653bbb1994ce9fa734c86c877aedf67e4..a815ffe07322c20cddaa3c4f97e3bf62a3cf15ec 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -638,6 +638,9 @@ ar71xx_board_detect() {
name="gl-inet"
gl_inet_board_detect
;;
+ *"FRITZ!Box 4020")
+ name="fritz4020"
+ ;;
*"GL AR150")
name="gl-ar150"
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 5e8a06a7ae70ec349693c09deedbfce41a52cfc2..491b5d5a98b44844f14441d4024f2ad9667186e0 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -612,6 +612,9 @@ platform_check_image() {
return 0;
;;
+ fritz4020)
+ return 0
+ ;;
esac
echo "Sysupgrade is not yet supported on $board."
diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4
index 396a4fa02adb37c6e5f9f7f1cc40fd1014361654..45bf500643837a7270b45e32b22225c06c5fb841 100644
--- a/target/linux/ar71xx/config-4.4
+++ b/target/linux/ar71xx/config-4.4
@@ -106,6 +106,7 @@ CONFIG_ATH79_MACH_ESR1750=y
CONFIG_ATH79_MACH_ESR900=y
CONFIG_ATH79_MACH_EW_DORIN=y
CONFIG_ATH79_MACH_F9K1115V2=y
+CONFIG_ATH79_MACH_FRITZ4020=y
CONFIG_ATH79_MACH_GL_AR150=y
CONFIG_ATH79_MACH_GL_AR300=y
CONFIG_ATH79_MACH_GL_AR300M=y
@@ -373,6 +374,7 @@ CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-2
CONFIG_MTD_REDBOOT_PARTS=y
CONFIG_MTD_SPI_NOR=y
+CONFIG_MTD_SPLIT_EVA_FW=y
CONFIG_MTD_SPLIT_FIRMWARE=y
CONFIG_MTD_SPLIT_LZMA_FW=y
CONFIG_MTD_SPLIT_SEAMA_FW=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
index 4c9012acc6b4c40d88ffc8752086cac86b9b9c92..46366e0d922808e5e14fed0f2b5409cda11afd26 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
@@ -1918,3 +1918,12 @@ config ATH79_MACH_TL_WPA8630
select ATH79_DEV_LEDS_GPIO
select ATH79_DEV_M25P80
select ATH79_DEV_WMAC
+
+config ATH79_MACH_FRITZ4020
+ bool "AVM FRITZ!Box 4020 support"
+ select SOC_QCA956X
+ select ATH79_DEV_ETH
+ select ATH79_DEV_GPIO_BUTTONS
+ select ATH79_DEV_LEDS_GPIO
+ select ATH79_DEV_USB
+ select ATH79_DEV_M25P80
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
index 8408894669dc5f14f05701359073ef233a1b89f0..29c9c65bc122c0d02839adf1abb61dcda0795fb6 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
@@ -111,6 +111,7 @@ obj-$(CONFIG_ATH79_MACH_ESR1750) += mach-esr1750.o
obj-$(CONFIG_ATH79_MACH_ESR900) += mach-esr900.o
obj-$(CONFIG_ATH79_MACH_EW_DORIN) += mach-ew-dorin.o
obj-$(CONFIG_ATH79_MACH_F9K1115V2) += mach-f9k1115v2.o
+obj-$(CONFIG_ATH79_MACH_FRITZ4020) += mach-fritz4020.o
obj-$(CONFIG_ATH79_MACH_GL_AR150) += mach-gl-ar150.o
obj-$(CONFIG_ATH79_MACH_GL_AR300) += mach-gl-ar300.o
obj-$(CONFIG_ATH79_MACH_GL_AR300M) += mach-gl-ar300m.o
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
index 427de6a50d0fcbc9dae11f8e6921194c0a5b09ed..5f971ea32d35035617229076b7a7fc30ed4d2dcc 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
@@ -1224,6 +1224,15 @@ void __init ath79_parse_ascii_mac(char *mac_str, u8 *mac)
}
}
+void __init ath79_extract_mac_reverse(u8 *ptr, u8 *out)
+{
+ int i;
+
+ for (i = 0; i < ETH_ALEN; i++) {
+ out[i] = ptr[ETH_ALEN-i-1];
+ }
+}
+
static void __init ath79_set_mac_base_ascii(char *str)
{
u8 mac[ETH_ALEN];
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.h b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.h
index fb9e4f63c66ef9008e423007ecff02c93c321fb8..4d78260fbe35db20f8dc6dd245abcd0cbb275477 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.h
+++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.h
@@ -18,6 +18,7 @@ struct platform_device;
extern unsigned char ath79_mac_base[] __initdata;
void ath79_parse_ascii_mac(char *mac_str, u8 *mac);
+void ath79_extract_mac_reverse(u8 *ptr, u8 *out);
void ath79_init_mac(unsigned char *dst, const unsigned char *src,
int offset);
void ath79_init_local_mac(unsigned char *dst, const unsigned char *src);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-fritz4020.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-fritz4020.c
new file mode 100644
index 0000000000000000000000000000000000000000..ed7f9a8b3ead80dbbe7f8d27c7dd5ecf0543d733
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-fritz4020.c
@@ -0,0 +1,242 @@
+/*
+ * AVM FRITZ!Box 4020 board support
+ *
+ * Copyright (C) 2018 David Bauer <mail@david-bauer.net>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ */
+
+#include <linux/init.h>
+#include <linux/ath9k_platform.h>
+#include <linux/etherdevice.h>
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
+#include <linux/platform_data/mdio-gpio.h>
+#include <linux/spi/spi_gpio.h>
+#include <linux/spi/74x164.h>
+
+#include <asm/mach-ath79/ath79.h>
+#include <asm/mach-ath79/ar71xx_regs.h>
+
+#include "common.h"
+#include "dev-eth.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-spi.h"
+#include "dev-usb.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+
+
+#define FRITZ4020_GPIO_SHIFT_SER 19 /* DS, Data Serial Input */
+#define FRITZ4020_GPIO_SHIFT_SRCLK 20 /* SHCP, Shift Reg Clock Input */
+
+#define FRITZ4020_SSR_BIT_0 0
+#define FRITZ4020_SSR_BIT_1 1
+#define FRITZ4020_SSR_BIT_2 2
+#define FRITZ4020_SSR_BIT_3 3
+#define FRITZ4020_SSR_BIT_4 4
+#define FRITZ4020_SSR_BIT_5 5
+#define FRITZ4020_SSR_BIT_6 6
+#define FRITZ4020_SSR_BIT_7 7
+
+#define FRITZ4020_74HC_GPIO_BASE 32
+#define FRITZ4020_74HC_GPIO_LED_LAN (FRITZ4020_74HC_GPIO_BASE + 0)
+#define FRITZ4020_74HC_GPIO_LED_INFO_RED (FRITZ4020_74HC_GPIO_BASE + 1)
+#define FRITZ4020_74HC_GPIO_LED_POWER (FRITZ4020_74HC_GPIO_BASE + 2)
+#define FRITZ4020_74HC_GPIO_LED_WLAN (FRITZ4020_74HC_GPIO_BASE + 3)
+#define FRITZ4020_74HC_GPIO_LED_WAN (FRITZ4020_74HC_GPIO_BASE + 4)
+#define FRITZ4020_74HC_GPIO_USB_RST (FRITZ4020_74HC_GPIO_BASE + 5)
+#define FRITZ4020_74HC_GPIO_LED_INFO (FRITZ4020_74HC_GPIO_BASE + 6)
+
+
+#define FRITZ4020_GPIO_BTN_WPS 2
+#define FRITZ4020_GPIO_BTN_WLAN 21
+#define FRITZ4020_KEYS_POLL_INTERVAL 20 /* msecs */
+#define FRITZ4020_KEYS_DEBOUNCE_INTERVAL (3 * FRITZ4020_KEYS_POLL_INTERVAL)
+
+#define FRTIZ4020_OFFSET_URLADER_WIFI_MAC_REVERSE 0x1979
+
+
+static struct spi_gpio_platform_data fritz4020_spi_data = {
+ .sck = FRITZ4020_GPIO_SHIFT_SRCLK,
+ .miso = SPI_GPIO_NO_MISO,
+ .mosi = FRITZ4020_GPIO_SHIFT_SER,
+ .num_chipselect = 1,
+};
+
+static u8 fritz4020_ssr_initdata[] = {
+ BIT(FRITZ4020_SSR_BIT_7) |
+ BIT(FRITZ4020_SSR_BIT_6) |
+ BIT(FRITZ4020_SSR_BIT_5) |
+ BIT(FRITZ4020_SSR_BIT_4) |
+ BIT(FRITZ4020_SSR_BIT_3) |
+ BIT(FRITZ4020_SSR_BIT_2) |
+ BIT(FRITZ4020_SSR_BIT_1)
+};
+
+static struct gen_74x164_chip_platform_data fritz4020_ssr_data = {
+ .base = FRITZ4020_74HC_GPIO_BASE,
+ .num_registers = ARRAY_SIZE(fritz4020_ssr_initdata),
+ .init_data = fritz4020_ssr_initdata,
+};
+
+static struct platform_device fritz4020_spi_device = {
+ .name = "spi_gpio",
+ .id = 1,
+ .dev = {
+ .platform_data = &fritz4020_spi_data,
+ },
+};
+
+static struct spi_board_info fritz4020_spi_info[] = {
+ {
+ .bus_num = 1,
+ .chip_select = 0,
+ .max_speed_hz = 10000000,
+ .modalias = "74x164",
+ .platform_data = &fritz4020_ssr_data,
+ .controller_data = (void *) 0x0,
+ },
+};
+
+static struct mtd_partition fritz4020_flash_partitions[] = {
+ {
+ .name = "urlader",
+ .offset = 0,
+ .size = 0x0020000,
+ .mask_flags = MTD_WRITEABLE,
+ }, {
+ .name = "firmware",
+ .offset = 0x0020000,
+ .size = 0x0EE0000,
+ }, {
+ .name = "tffs (1)",
+ .offset = 0x0f00000,
+ .size = 0x0080000,
+ .mask_flags = MTD_WRITEABLE,
+ }, {
+ .name = "tffs (2)",
+ .offset = 0x0f80000,
+ .size = 0x0080000,
+ .mask_flags = MTD_WRITEABLE,
+ }
+};
+
+static struct flash_platform_data fritz4020_flash_data = {
+ .parts = fritz4020_flash_partitions,
+ .nr_parts = ARRAY_SIZE(fritz4020_flash_partitions),
+};
+
+static struct gpio_led fritz4020_leds_gpio[] __initdata = {
+ {
+ .name = "fritz4020:green:lan",
+ .gpio = FRITZ4020_74HC_GPIO_LED_LAN,
+ .active_low = 1,
+ }, {
+ .name = "fritz4020:green:info",
+ .gpio = FRITZ4020_74HC_GPIO_LED_INFO,
+ .active_low = 1,
+ }, {
+ .name = "fritz4020:red:info",
+ .gpio = FRITZ4020_74HC_GPIO_LED_INFO_RED,
+ .active_low = 1,
+ }, {
+ .name = "fritz4020:green:power",
+ .gpio = FRITZ4020_74HC_GPIO_LED_POWER,
+ .active_low = 1,
+ }, {
+ .name = "fritz4020:green:wlan",
+ .gpio = FRITZ4020_74HC_GPIO_LED_WLAN,
+ .active_low = 1,
+ }, {
+ .name = "fritz4020:green:wan",
+ .gpio = FRITZ4020_74HC_GPIO_LED_WAN,
+ .active_low = 1,
+ },
+};
+
+static struct gpio_keys_button fritz4020_gpio_keys[] __initdata = {
+ {
+ .desc = "RFKILL button",
+ .type = EV_KEY,
+ .code = KEY_RFKILL,
+ .debounce_interval = FRITZ4020_KEYS_DEBOUNCE_INTERVAL,
+ .gpio = FRITZ4020_GPIO_BTN_WLAN,
+ .active_low = 0,
+ },
+ {
+ .desc = "WPS button",
+ .type = EV_KEY,
+ .code = KEY_WPS_BUTTON,
+ .debounce_interval = FRITZ4020_KEYS_DEBOUNCE_INTERVAL,
+ .gpio = FRITZ4020_GPIO_BTN_WPS,
+ .active_low = 0,
+ },
+};
+
+static void __init fritz4020_setup(void) {
+ u8 *urlader = (u8 *) KSEG1ADDR(0x1f000000);
+ u8 wifi_mac[ETH_ALEN];
+
+ ath79_register_m25p80(&fritz4020_flash_data);
+
+ /* Initialize ethernet */
+ ath79_extract_mac_reverse(urlader + FRTIZ4020_OFFSET_URLADER_WIFI_MAC_REVERSE, wifi_mac);
+ ath79_setup_qca956x_eth_cfg(QCA956X_ETH_CFG_SW_PHY_SWAP |
+ QCA956X_ETH_CFG_SW_PHY_ADDR_SWAP);
+
+ ath79_register_mdio(0, 0x0);
+ ath79_register_mdio(1, 0x0);
+ ath79_init_mac(ath79_eth0_data.mac_addr, wifi_mac, -1);
+ ath79_init_mac(ath79_eth1_data.mac_addr, wifi_mac, -2);
+
+ /* WAN port */
+ ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
+ ath79_eth0_data.speed = SPEED_100;
+ ath79_eth0_data.duplex = DUPLEX_FULL;
+ ath79_eth0_data.phy_mask = BIT(0);
+ ath79_register_eth(0);
+
+ /* LAN ports */
+ ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
+ ath79_eth1_data.speed = SPEED_1000;
+ ath79_eth1_data.duplex = DUPLEX_FULL;
+ ath79_switch_data.phy_poll_mask |= BIT(0);
+ ath79_switch_data.phy4_mii_en = 1;
+ ath79_register_eth(1);
+
+ /* Initialize 2.4GHz WiFi */
+ ath79_register_wmac_simple();
+
+ /* Activate USB Power */
+ gpio_request_one(FRITZ4020_74HC_GPIO_USB_RST,
+ GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
+ "USB power");
+
+ /* Initialize USB port */
+ ath79_register_usb();
+
+ /* Register LED shift-register */
+ spi_register_board_info(fritz4020_spi_info,
+ ARRAY_SIZE(fritz4020_spi_info));
+ platform_device_register(&fritz4020_spi_device);
+
+ /* Register GPIO buttons */
+ ath79_register_gpio_keys_polled(-1, FRITZ4020_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(fritz4020_gpio_keys),
+ fritz4020_gpio_keys);
+
+ /* Register LEDs */
+ ath79_register_leds_gpio(-1, ARRAY_SIZE(fritz4020_leds_gpio),
+ fritz4020_leds_gpio);
+}
+
+MIPS_MACHINE(ATH79_MACH_FRITZ4020, "FRITZ4020",
+ "AVM FRITZ!Box 4020", fritz4020_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
index 72c1e38c74707aba8fbd3aebc36f35becabd4987..07f1877180e27ff189387c5f34a61702d0fa9bd2 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
+++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
@@ -102,6 +102,7 @@ enum ath79_mach_type {
ATH79_MACH_EW_DORIN, /* embedded wireless Dorin Platform */
ATH79_MACH_EW_DORIN_ROUTER, /* embedded wireless Dorin Router Platform */
ATH79_MACH_F9K1115V2, /* Belkin AC1750DB */
+ ATH79_MACH_FRITZ4020, /* AVM FRITZ!Box 4020 */
ATH79_MACH_GL_AR150, /* GL-AR150 support */
ATH79_MACH_GL_AR300, /* GL-AR300 */
ATH79_MACH_GL_AR300M, /* GL-AR300M */
diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk
index e11a8992f9c2f950079fddf121eb30c34926e33d..d113c5ad621bb2f15d4cbc4fd50e60904313a7da 100644
--- a/target/linux/ar71xx/image/generic.mk
+++ b/target/linux/ar71xx/image/generic.mk
@@ -738,3 +738,22 @@ define Device/bhr-4grv2
IMAGE/factory.bin = append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | mkbuffaloimg
endef
TARGET_DEVICES += bhr-4grv2
+
+define Device/AVM
+ DEVICE_PACKAGES := fritz-tffs -uboot-envtools
+ KERNEL := kernel-bin | patch-cmdline | lzma | eva-image
+ KERNEL_INITRAMFS := $$(KERNEL)
+ IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | \
+ append-squashfs-fakeroot-be | pad-to 256 | \
+ append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
+endef
+
+define Device/fritz4020
+ $(call Device/AVM)
+ DEVICE_TITLE := AVM FRITZ!Box 4020
+ DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-storage
+ BOARDNAME := FRITZ4020
+ SUPPORTED_DEVICES := fritz4020
+ IMAGE_SIZE := 15232k
+endef
+TARGET_DEVICES += fritz4020
diff --git a/target/linux/ar71xx/mikrotik/config-default b/target/linux/ar71xx/mikrotik/config-default
index 23e862762600f0724a37fe1a390d4d09639c472c..e0401102229c00985e8000331dce43375903e1aa 100644
--- a/target/linux/ar71xx/mikrotik/config-default
+++ b/target/linux/ar71xx/mikrotik/config-default
@@ -71,6 +71,7 @@
# CONFIG_ATH79_MACH_ESR900 is not set
# CONFIG_ATH79_MACH_EW_DORIN is not set
# CONFIG_ATH79_MACH_F9K1115V2 is not set
+# CONFIG_ATH79_MACH_FRITZ4020 is not set
# CONFIG_ATH79_MACH_GL_AR150 is not set
# CONFIG_ATH79_MACH_GL_AR300 is not set
# CONFIG_ATH79_MACH_GL_AR300M is not set
@@ -217,6 +218,7 @@ CONFIG_MTD_NAND_ECC=y
CONFIG_MTD_NAND_RB4XX=y
CONFIG_MTD_NAND_RB750=y
CONFIG_MTD_NAND_RB91X=y
+# CONFIG_MTD_SPLIT_EVA_FW is not set
# CONFIG_MTD_REDBOOT_PARTS is not set
# CONFIG_MTD_TPLINK_PARTS is not set
CONFIG_MTD_UBI=y
diff --git a/target/linux/ar71xx/nand/config-default b/target/linux/ar71xx/nand/config-default
index c11ccfe29795d013776870cf21fb6ca8d907af1b..790fa8f9bd42aba8521b960c2a49a742285e6157 100644
--- a/target/linux/ar71xx/nand/config-default
+++ b/target/linux/ar71xx/nand/config-default
@@ -29,6 +29,7 @@
# CONFIG_ATH79_MACH_DIR_869_A1 is not set
# CONFIG_ATH79_MACH_EAP7660D is not set
# CONFIG_ATH79_MACH_EW_DORIN is not set
+# CONFIG_ATH79_MACH_FRITZ4020 is not set
# CONFIG_ATH79_MACH_HORNET_UB is not set
# CONFIG_ATH79_MACH_JA76PF is not set
# CONFIG_ATH79_MACH_JWAP003 is not set
@@ -104,6 +105,7 @@ CONFIG_MTD_NAND_ECC=y
CONFIG_MTD_NAND_ECC_BCH=y
# CONFIG_MTD_REDBOOT_PARTS is not set
# CONFIG_MTD_SM_COMMON is not set
+# CONFIG_MTD_SPLIT_EVA_FW is not set
# CONFIG_MTD_SPLIT_SEAMA_FW is not set
# CONFIG_MTD_TPLINK_PARTS is not set
CONFIG_MTD_UBI=y
From: Robert Marko <robimarko@gmail.com>
Date: Wed, 21 Feb 2018 13:15:17 +0100
Subject: ar71xx: add support for TP-Link TL-WR940N v6
Add support for TL-WR940N v6 board. It is pretty much the same as v5
except they only left WAN LED and removed other ones.
Installation: flash factory image through WEB UI or use TFTP.
Signed-off-by: Robert Marko <robimarko@gmail.com>
diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds
index e8b13af7c24dea86519c962fa6381fd75971e8b9..62d7f014be28782b9961551f2377a66ccadfb329 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -676,6 +676,9 @@ tl-wr941nd-v6)
ucidef_set_led_switch "lan4" "LAN4" "tp-link:blue:lan4" "switch0" "0x02"
ucidef_set_led_wlan "wlan" "WLAN" "tp-link:blue:wlan" "phy0tpt"
;;
+tl-wr940n-v6)
+ ucidef_set_led_netdev "wan" "WAN" "tp-link:blue:wan" "eth0"
+ ;;
tl-wr841n-v9|\
tl-wr841n-v11|\
tl-wr842n-v3)
diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network
index 1018ab4449f896d565b57ecbdc73b7e3d7fbe486..ae82cfe008169a8282ac51746cf2299eec8c81d8 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -298,6 +298,7 @@ ar71xx_setup_interfaces()
tl-wdr6500-v2|\
tl-wr841n-v8|\
tl-wr940n-v4|\
+ tl-wr940n-v6|\
tl-wr941nd-v5|\
tl-wr941nd-v6|\
wnr1000-v2|\
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 382500b75ee6dc1fe1126fb3121f4ae205c901d4..4d792e773c8efe0cb2e5e328d777db853cdd846b 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -397,6 +397,9 @@ get_status_led() {
tl-wr941nd-v6)
status_led="tp-link:blue:system"
;;
+ tl-wr940n-v6)
+ status_led="tp-link:orange:diag"
+ ;;
tl-wr841n-v9)
status_led="tp-link:green:qss"
;;
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index a815ffe07322c20cddaa3c4f97e3bf62a3cf15ec..21b1c44404d383ef99860caf95a8e19b9cbf5087 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -1082,6 +1082,9 @@ ar71xx_board_detect() {
*TL-WR941ND)
name="tl-wr941nd"
;;
+ *"TL-WR940N v6")
+ name="tl-wr940n-v6"
+ ;;
*"TL-WR941N/ND v5")
name="tl-wr941nd-v5"
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 491b5d5a98b44844f14441d4024f2ad9667186e0..03677ad1240c9a5af341354b95561f9d493a9cd8 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -443,6 +443,7 @@ platform_check_image() {
tl-wr941nd-v5|\
tl-wr941nd-v6|\
tl-wr940n-v4|\
+ tl-wr940n-v6|\
tl-wr941nd)
local magic_ver="0100"
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr940n-v4.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr940n-v4.c
index d693b947c843d2a74cd252503fa8bf68b20da4ab..b530622d9f00b8ce3b906ad5fe62de019d82763a 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr940n-v4.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr940n-v4.c
@@ -1,5 +1,5 @@
/*
- * TP-LINK TL-WR940N v4 board support
+ * TP-LINK TL-WR940N v4 and v6 board support
*
* Copyright (C) 2016 David Lutz <kpanic@ff3l.net>
*
@@ -32,12 +32,15 @@
#define TL_WR940N_V4_GPIO_LED_LAN1 8
#define TL_WR940N_V4_GPIO_LED_WLAN 7
#define TL_WR940N_V4_GPIO_LED_SYSTEM 5
+/* WR940N v6 specific GPIO*/
+#define TL_WR940N_V6_GPIO_LED_DIAG_ORANGE 15
+#define TL_WR940N_V6_GPIO_LED_WAN_BLUE 14
#define TL_WR940N_V4_GPIO_BTN_RESET 1
#define TL_WR940N_V4_GPIO_BTN_RFKILL 2
-#define TL_WR940N_V4_KEYS_POLL_INTERVAL 20
-#define TL_WR940N_V4_KEYS_DEBOUNCE_INTERVAL (3 * TL_WR940N_V4_KEYS_POLL_INTERVAL)
+#define TL_WR940N_KEYS_POLL_INTERVAL 20
+#define TL_WR940N_KEYS_DEBOUNCE_INTERVAL (3 * TL_WR940N_KEYS_POLL_INTERVAL)
static struct gpio_led tl_wr940n_v4_leds_gpio[] __initdata = {
@@ -93,43 +96,49 @@ static struct gpio_keys_button tl_wr940n_v4_gpio_keys[] __initdata = {
.desc = "Reset button",
.type = EV_KEY,
.code = KEY_RESTART,
- .debounce_interval = TL_WR940N_V4_KEYS_DEBOUNCE_INTERVAL,
+ .debounce_interval = TL_WR940N_KEYS_DEBOUNCE_INTERVAL,
.gpio = TL_WR940N_V4_GPIO_BTN_RESET,
.active_low = 1,
}, {
.desc = "RFKILL button",
.type = EV_KEY,
.code = KEY_RFKILL,
- .debounce_interval = TL_WR940N_V4_KEYS_DEBOUNCE_INTERVAL,
+ .debounce_interval = TL_WR940N_KEYS_DEBOUNCE_INTERVAL,
.gpio = TL_WR940N_V4_GPIO_BTN_RFKILL,
.active_low = 1,
}
};
+static struct gpio_led tl_wr940n_v6_leds_gpio[] __initdata = {
+ {
+ .name = "tp-link:blue:wan",
+ .gpio = TL_WR940N_V6_GPIO_LED_WAN_BLUE,
+ .active_low = 1,
+ },
+ {
+ .name = "tp-link:orange:diag",
+ .gpio = TL_WR940N_V6_GPIO_LED_DIAG_ORANGE,
+ .active_low = 0,
+ },
+};
+
-static const char *tl_wr940n_v4_part_probes[] = {
+static const char *tl_wr940n_part_probes[] = {
"tp-link",
NULL,
};
-static struct flash_platform_data tl_wr940n_v4_flash_data = {
- .part_probes = tl_wr940n_v4_part_probes,
+static struct flash_platform_data tl_wr940n_flash_data = {
+ .part_probes = tl_wr940n_part_probes,
};
-static void __init tl_wr940n_v4_setup(void)
+static void __init tl_wr940n_setup(void)
{
u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
- ath79_register_m25p80(&tl_wr940n_v4_flash_data);
-
- ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr940n_v4_leds_gpio),
- tl_wr940n_v4_leds_gpio);
-
- ath79_register_gpio_keys_polled(-1, TL_WR940N_V4_KEYS_POLL_INTERVAL,
- ARRAY_SIZE(tl_wr940n_v4_gpio_keys),
- tl_wr940n_v4_gpio_keys);
+ ath79_register_m25p80(&tl_wr940n_flash_data);
ath79_register_mdio(0, 0x0);
@@ -145,5 +154,31 @@ static void __init tl_wr940n_v4_setup(void)
}
+static void __init tl_wr940n_v4_setup(void)
+{
+ tl_wr940n_setup();
+
+ ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr940n_v4_leds_gpio),
+ tl_wr940n_v4_leds_gpio);
+
+ ath79_register_gpio_keys_polled(-1, TL_WR940N_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(tl_wr940n_v4_gpio_keys),
+ tl_wr940n_v4_gpio_keys);
+}
+
+static void __init tl_wr940n_v6_setup(void)
+{
+ tl_wr940n_setup();
+
+ ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr940n_v6_leds_gpio),
+ tl_wr940n_v6_leds_gpio);
+
+ ath79_register_gpio_keys_polled(-1, TL_WR940N_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(tl_wr940n_v4_gpio_keys),
+ tl_wr940n_v4_gpio_keys);
+}
+
MIPS_MACHINE(ATH79_MACH_TL_WR940N_V4, "TL-WR940N-v4", "TP-LINK TL-WR940N v4",
tl_wr940n_v4_setup);
+MIPS_MACHINE(ATH79_MACH_TL_WR940N_V6, "TL-WR940N-v6", "TP-LINK TL-WR940N v6",
+ tl_wr940n_v6_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
index 07f1877180e27ff189387c5f34a61702d0fa9bd2..89ddbbc976c9393608a80b9ce56e02a4d403ea2a 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
+++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
@@ -242,6 +242,7 @@ enum ath79_mach_type {
ATH79_MACH_TL_WR941ND_V5, /* TP-LINK TL-WR941ND v5 */
ATH79_MACH_TL_WR941ND_V6, /* TP-LINK TL-WR941ND v6 */
ATH79_MACH_TL_WR940N_V4, /* TP-LINK TL-WR940N v4 */
+ ATH79_MACH_TL_WR940N_V6, /* TP-LINK TL-WR940N v6 */
ATH79_MACH_TUBE2H, /* Alfa Network Tube2H */
ATH79_MACH_UBNT_AIRGW, /* Ubiquiti AirGateway */
ATH79_MACH_UBNT_AIRGWP, /* Ubiquiti AirGateway Pro */
diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk
index 60dfe0e3edafcadad4ddc08be7645b49f269907c..1e40d943ac2aa43aea670fd86268708aea39a46c 100644
--- a/target/linux/ar71xx/image/tp-link.mk
+++ b/target/linux/ar71xx/image/tp-link.mk
@@ -857,6 +857,14 @@ define Device/tl-wr940n-v4
IMAGE/factory-eu.bin := append-rootfs | mktplinkfw factory -C EU
endef
+define Device/tl-wr940n-v6
+ $(Device/tl-wr940n-v4)
+ DEVICE_TITLE := TP-LINK TL-WR940N v6
+ BOARDNAME := TL-WR940N-v6
+ TPLINK_HWID := 0x09400006
+endef
+TARGET_DEVICES += tl-wr940n-v6
+
# Chinese version (unlike European) is similar to the TL-WDR3500
define Device/tl-wr941nd-v6-cn
$(Device/tplink-4mlzma)
From: Wojciech Jowsa <w.jowsa@radytek.com>
Date: Wed, 15 Feb 2017 12:38:07 +0100
Subject: ar71xx: set status led for the gl-* boards
Signed-off-by: Wojciech Jowsa <w.jowsa@radytek.com>
diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds
index 62d7f014be28782b9961551f2377a66ccadfb329..f4d83cee519406a188cc9dde355f509dd644625a 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -311,19 +311,18 @@ fritz4020)
ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth0"
ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
;;
-gl-ar150|\
-gl-ar300|\
-gl-ar300m|\
+gl-ar300m)
+ ucidef_set_led_wlan "wlan" "WLAN" "$board:red:wlan" "phy0tpt"
+ ;;
gl-mifi)
+ ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
+ ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth0"
+ ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth1"
+ ucidef_set_led_netdev "3gnet" "3GNET" "$board:green:net" "3g-wan"
+ ;;
+gl-ar150|\
+gl-ar300)
ucidef_set_led_wlan "wlan" "WLAN" "$board:wlan" "phy0tpt"
-
- case "$board" in
- gl-mifi)
- ucidef_set_led_netdev "wan" "WAN" "$board:wan" "eth0"
- ucidef_set_led_netdev "lan" "LAN" "$board:lan" "eth1"
- ucidef_set_led_netdev "3gnet" "3GNET" "$board:net" "3g-wan"
- ;;
- esac
;;
gl-domino|\
wrt160nl)
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 4d792e773c8efe0cb2e5e328d777db853cdd846b..336d078f72a06073e3465c36ca98035c7d70282f 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -64,7 +64,9 @@ get_status_led() {
ap90q|\
cpe830|\
cpe870|\
- gl-inet)
+ gl-inet|\
+ gl-mifi|\
+ gl-ar300m)
status_led="$board:green:lan"
;;
ap96)
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c
index 62906a1922f890eb36ad212e9542dc52dc56006c..ca44b364c51559350fedc5551a023b2772bb69a1 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c
@@ -6,9 +6,9 @@
* Copyright (C) 2013 alzhao <alzhao@gmail.com>
* Copyright (C) 2014 Michel Stempin <michel.stempin@wanadoo.fr>
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
*/
#include <linux/gpio.h>
@@ -37,130 +37,130 @@
#define GL_AR300M_GPIO_BTN_LEFT 0
#define GL_AR300M_GPIO_BTN_RIGHT 1
-#define GL_AR300M_KEYS_POLL_INTERVAL 20 /* msecs */
-#define GL_AR300M_KEYS_DEBOUNCE_INTERVAL (3 * GL_AR300M_KEYS_POLL_INTERVAL)
+#define GL_AR300M_KEYS_POLL_INTERVAL 20 /* msecs */
+#define GL_AR300M_KEYS_DEBOUNCE_INTERVAL (3 * GL_AR300M_KEYS_POLL_INTERVAL)
-#define GL_AR300M_MAC0_OFFSET 0
-#define GL_AR300M_MAC1_OFFSET 6
-#define GL_AR300M_WMAC_CALDATA_OFFSET 0x1000
-#define GL_AR300M_PCIE_CALDATA_OFFSET 0x5000
+#define GL_AR300M_MAC0_OFFSET 0
+#define GL_AR300M_MAC1_OFFSET 6
+#define GL_AR300M_WMAC_CALDATA_OFFSET 0x1000
+#define GL_AR300M_PCIE_CALDATA_OFFSET 0x5000
static struct gpio_led gl_ar300m_leds_gpio[] __initdata = {
- {
- .name = "gl-ar300m:usb",
- .gpio = GL_AR300M_GPIO_LED_USB,
- .active_low = 0,
- .default_state = 1,
- },
- {
- .name = "gl-ar300m:wlan",
- .gpio = GL_AR300M_GPIO_LED_WLAN,
- .active_low = 1,
- },
- {
- .name = "gl-ar300m:lan",
- .gpio = GL_AR300M_GPIO_LED_LAN,
- .active_low = 1,
- },
- {
- .name = "gl-ar300m:system",
- .gpio = GL_AR300M_GPIO_LED_SYSTEM,
- .active_low = 1,
- .default_state = 1,
- },
+ {
+ .name = "gl-ar300m:green:usb",
+ .gpio = GL_AR300M_GPIO_LED_USB,
+ .active_low = 0,
+ .default_state = 1,
+ },
+ {
+ .name = "gl-ar300m:green:wlan",
+ .gpio = GL_AR300M_GPIO_LED_WLAN,
+ .active_low = 1,
+ },
+ {
+ .name = "gl-ar300m::green:lan",
+ .gpio = GL_AR300M_GPIO_LED_LAN,
+ .active_low = 1,
+ },
+ {
+ .name = "gl-ar300m:green:system",
+ .gpio = GL_AR300M_GPIO_LED_SYSTEM,
+ .active_low = 1,
+ .default_state = 1,
+ },
};
static struct gpio_keys_button gl_ar300m_gpio_keys[] __initdata = {
- {
- .desc = "reset",
- .type = EV_KEY,
- .code = KEY_RESTART,
- .debounce_interval = GL_AR300M_KEYS_DEBOUNCE_INTERVAL,
- .gpio = GL_AR300M_GPIO_BTN_RESET,
- .active_low = 1,
- },
- {
- .desc = "button right",
- .type = EV_KEY,
- .code = BTN_0,
- .debounce_interval = GL_AR300M_KEYS_DEBOUNCE_INTERVAL,
- .gpio = GL_AR300M_GPIO_BTN_LEFT,
- .active_low = 0,
- },
- {
- .desc = "button left",
- .type = EV_KEY,
- .code = BTN_1,
- .debounce_interval = GL_AR300M_KEYS_DEBOUNCE_INTERVAL,
- .gpio = GL_AR300M_GPIO_BTN_RIGHT,
- .active_low = 0,
- },
+ {
+ .desc = "reset",
+ .type = EV_KEY,
+ .code = KEY_RESTART,
+ .debounce_interval = GL_AR300M_KEYS_DEBOUNCE_INTERVAL,
+ .gpio = GL_AR300M_GPIO_BTN_RESET,
+ .active_low = 1,
+ },
+ {
+ .desc = "button right",
+ .type = EV_KEY,
+ .code = BTN_0,
+ .debounce_interval = GL_AR300M_KEYS_DEBOUNCE_INTERVAL,
+ .gpio = GL_AR300M_GPIO_BTN_LEFT,
+ .active_low = 0,
+ },
+ {
+ .desc = "button left",
+ .type = EV_KEY,
+ .code = BTN_1,
+ .debounce_interval = GL_AR300M_KEYS_DEBOUNCE_INTERVAL,
+ .gpio = GL_AR300M_GPIO_BTN_RIGHT,
+ .active_low = 0,
+ },
};
static struct spi_board_info gl_ar300m_spi_info[] = {
- {
- .bus_num = 0,
- .chip_select = 0,
- .max_speed_hz = 25000000,
- .modalias = "m25p80",
- .platform_data = NULL,
- },
- {
- .bus_num = 0,
- .chip_select = 1,
- .max_speed_hz = 25000000,
- .modalias = "ath79-spinand",
- .platform_data = NULL,
- }
+ {
+ .bus_num = 0,
+ .chip_select = 0,
+ .max_speed_hz = 25000000,
+ .modalias = "m25p80",
+ .platform_data = NULL,
+ },
+ {
+ .bus_num = 0,
+ .chip_select = 1,
+ .max_speed_hz = 25000000,
+ .modalias = "ath79-spinand",
+ .platform_data = NULL,
+ }
};
static struct ath79_spi_platform_data gl_ar300m_spi_data = {
- .bus_num = 0,
- .num_chipselect = 2,
+ .bus_num = 0,
+ .num_chipselect = 2,
};
static void __init gl_ar300m_setup(void)
{
- u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
- u8 tmpmac[ETH_ALEN];
-
- ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE);
- ath79_register_spi(&gl_ar300m_spi_data, gl_ar300m_spi_info, 2);
-
- /* register gpio LEDs and keys */
- ath79_register_leds_gpio(-1, ARRAY_SIZE(gl_ar300m_leds_gpio),
- gl_ar300m_leds_gpio);
- ath79_register_gpio_keys_polled(-1, GL_AR300M_KEYS_POLL_INTERVAL,
- ARRAY_SIZE(gl_ar300m_gpio_keys),
- gl_ar300m_gpio_keys);
-
- ath79_register_mdio(0, 0x0);
-
- /* WAN */
- ath79_init_mac(ath79_eth0_data.mac_addr, art + GL_AR300M_MAC0_OFFSET, 0);
- ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
- ath79_eth0_data.speed = SPEED_100;
- ath79_eth0_data.duplex = DUPLEX_FULL;
- ath79_eth0_data.phy_mask = BIT(4);
- ath79_register_eth(0);
-
- /* LAN */
- ath79_init_mac(ath79_eth1_data.mac_addr, art + GL_AR300M_MAC1_OFFSET, 0);
- ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
- ath79_eth1_data.speed = SPEED_1000;
- ath79_eth1_data.duplex = DUPLEX_FULL;
- ath79_switch_data.phy_poll_mask |= BIT(4);
- ath79_switch_data.phy4_mii_en = 1;
- ath79_register_eth(1);
-
- ath79_init_mac(tmpmac, art + GL_AR300M_WMAC_CALDATA_OFFSET + 2, 0);
- ath79_register_wmac(art + GL_AR300M_WMAC_CALDATA_OFFSET, tmpmac);
-
- /* enable usb */
- ath79_register_usb();
- /* enable pci */
- ath79_register_pci();
+ u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
+ u8 tmpmac[ETH_ALEN];
+
+ ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE);
+ ath79_register_spi(&gl_ar300m_spi_data, gl_ar300m_spi_info, 2);
+
+ /* register gpio LEDs and keys */
+ ath79_register_leds_gpio(-1, ARRAY_SIZE(gl_ar300m_leds_gpio),
+ gl_ar300m_leds_gpio);
+ ath79_register_gpio_keys_polled(-1, GL_AR300M_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(gl_ar300m_gpio_keys),
+ gl_ar300m_gpio_keys);
+
+ ath79_register_mdio(0, 0x0);
+
+ /* WAN */
+ ath79_init_mac(ath79_eth0_data.mac_addr, art + GL_AR300M_MAC0_OFFSET, 0);
+ ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
+ ath79_eth0_data.speed = SPEED_100;
+ ath79_eth0_data.duplex = DUPLEX_FULL;
+ ath79_eth0_data.phy_mask = BIT(4);
+ ath79_register_eth(0);
+
+ /* LAN */
+ ath79_init_mac(ath79_eth1_data.mac_addr, art + GL_AR300M_MAC1_OFFSET, 0);
+ ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
+ ath79_eth1_data.speed = SPEED_1000;
+ ath79_eth1_data.duplex = DUPLEX_FULL;
+ ath79_switch_data.phy_poll_mask |= BIT(4);
+ ath79_switch_data.phy4_mii_en = 1;
+ ath79_register_eth(1);
+
+ ath79_init_mac(tmpmac, art + GL_AR300M_WMAC_CALDATA_OFFSET + 2, 0);
+ ath79_register_wmac(art + GL_AR300M_WMAC_CALDATA_OFFSET, tmpmac);
+
+ /* enable usb */
+ ath79_register_usb();
+ /* enable pci */
+ ath79_register_pci();
}
MIPS_MACHINE(ATH79_MACH_GL_AR300M, "GL-AR300M", "GL-AR300M",
- gl_ar300m_setup);
+ gl_ar300m_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-mifi.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-mifi.c
index 42f4415d7fe0252aadf39e2ca50f96566c023728..412c562fa042e7abb0ccb35208bb55821efc8660 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-mifi.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-mifi.c
@@ -41,27 +41,27 @@
static struct gpio_led gl_mifi_leds_gpio[] __initdata = {
{
- .name = "gl-mifi:wan",
+ .name = "gl-mifi:greeen:wan",
.gpio = GL_MIFI_GPIO_LED_WAN,
.active_low = 0,
},
{
- .name = "gl-mifi:lan",
+ .name = "gl-mifi:green:lan",
.gpio = GL_MIFI_GPIO_LED_LAN,
.active_low = 0,
},
{
- .name = "gl-mifi:wlan",
+ .name = "gl-mifi:green:wlan",
.gpio = GL_MIFI_GPIO_LED_WLAN,
.active_low = 0,
},
{
- .name = "gl-mifi:net",
+ .name = "gl-mifi:green:net",
.gpio = GL_MIFI_GPIO_LED_NET,
.active_low = 0,
},
{
- .name = "gl-mifi:3gcontrol",
+ .name = "gl-mifi:green:3gcontrol",
.gpio = GL_MIFI_GPIO_LED_3GCONTROL,
.active_low = 0,
}
From: Piotr Dymacz <pepe2k@gmail.com>
Date: Tue, 17 Oct 2017 23:30:01 +0200
Subject: ar71xx: add support for GL.iNet GL-AR750
GL.iNet GL-AR750 is a small size, dual-band (AC750) router, based on
Qualcomm/Atheros QCA9531 v2 + QCA9887. FCC ID: 2AFIW-AR750.
Specification:
- 650/597/216 MHz (CPU/DDR/AHB)
- 128 MB of RAM (DDR2)
- 16 MB of FLASH (SPI NOR)
- 3x 10/100 Mbps Ethernet
- 2T2R 2.4 GHz (QCA9531)
- 1T1R 5 GHz (QCA9887)
- 1x USB 2.0 (power controlled by GPIO)
- 1x microSD (GL857L)
- 3x LED (all driven by GPIO)
- 1x button (reset)
- 1x 2-pos switch
- header for optional PoE module
- 1x micro USB for main power input
- UART + I2C header on PCB
Flash instruction:
Vendor firmware is based on OpenWrt/LEDE. GUI or sysupgrade can be used
to flash OpenWrt/LEDE firmware.
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds
index f4d83cee519406a188cc9dde355f509dd644625a..f94cc3c85b798458cc97c06bb0d44bdc426d057d 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -314,6 +314,10 @@ fritz4020)
gl-ar300m)
ucidef_set_led_wlan "wlan" "WLAN" "$board:red:wlan" "phy0tpt"
;;
+gl-ar750)
+ ucidef_set_led_wlan "wlan2g" "WLAN2G" "$board:white:wlan2g" "phy1tpt"
+ ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:white:wlan5g" "phy0tpt"
+ ;;
gl-mifi)
ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth0"
diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network
index ae82cfe008169a8282ac51746cf2299eec8c81d8..c8990c60f504286d0fd28c7b17f54c9c3b5a891e 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -369,6 +369,7 @@ ar71xx_setup_interfaces()
onion-omega)
ucidef_set_interface_lan "wlan0"
;;
+ gl-ar750|\
rb-435g)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
ucidef_add_switch "switch0" \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 336d078f72a06073e3465c36ca98035c7d70282f..01d3b787bedcab82a5797c9a4801e8139887cc2c 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -249,6 +249,7 @@ get_status_led() {
nbg460n_550n_550nh)
status_led="nbg460n:green:power"
;;
+ gl-ar750|\
nbg6716)
status_led="$board:white:power"
;;
@@ -489,7 +490,8 @@ set_state() {
done)
status_led_on
case $(ar71xx_board_name) in
- gl-ar300m)
+ gl-ar300m|\
+ gl-ar750)
fw_printenv lc >/dev/null 2>&1 && fw_setenv "bootcount" 0
;;
qihoo-c301)
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 91bdf0d3c591516f58030b165052b3dd2751314f..1626622a8e46484bbf2719f19843e61d9cc92506 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
@@ -103,6 +103,7 @@ case "$FIRMWARE" in
ath10kcal_extract "art" 20480 2116
ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) -2)
;;
+ gl-ar750|\
tl-wpa8630)
ath10kcal_extract "art" 20480 2116
ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1)
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 21b1c44404d383ef99860caf95a8e19b9cbf5087..35b742a5f1fee0bc24ab2d88e32f118c1df4e2b3 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -650,6 +650,9 @@ ar71xx_board_detect() {
*"GL-AR300M")
name="gl-ar300m"
;;
+ *"GL-AR750")
+ name="gl-ar750"
+ ;;
*"GL-MIFI")
name="gl-mifi"
;;
diff --git a/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx b/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx
index d677599d8c6380d9920e95abc9fb4b92cc0cec29..ba6e08b00d979bc73f7199756e22ca3941fad97d 100644
--- a/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx
+++ b/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx
@@ -17,6 +17,7 @@ set_preinit_iface() {
archer-c7 |\
bhr-4grv2 |\
dir-505-a1 |\
+ gl-ar750|\
gl-inet |\
jwap003 |\
pb42 |\
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 03677ad1240c9a5af341354b95561f9d493a9cd8..236520b27c4d6d0b1b7e483d1100fb5ab156d475 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -253,6 +253,7 @@ platform_check_image() {
gl-ar150|\
gl-ar300m|\
gl-ar300|\
+ gl-ar750|\
gl-domino|\
gl-mifi|\
hiwifi-hc6361|\
diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4
index 45bf500643837a7270b45e32b22225c06c5fb841..d96642b97c36187febb1f3843e7dd9acfab0e40d 100644
--- a/target/linux/ar71xx/config-4.4
+++ b/target/linux/ar71xx/config-4.4
@@ -110,6 +110,7 @@ CONFIG_ATH79_MACH_FRITZ4020=y
CONFIG_ATH79_MACH_GL_AR150=y
CONFIG_ATH79_MACH_GL_AR300=y
CONFIG_ATH79_MACH_GL_AR300M=y
+CONFIG_ATH79_MACH_GL_AR750=y
CONFIG_ATH79_MACH_GL_DOMINO=y
CONFIG_ATH79_MACH_GL_INET=y
CONFIG_ATH79_MACH_GL_MIFI=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
index 46366e0d922808e5e14fed0f2b5409cda11afd26..2449a8d6bce17f0a703d8fc4f82dd38e1f861ae3 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
@@ -691,6 +691,17 @@ config ATH79_MACH_GL_AR300M
select ATH79_DEV_USB
select ATH79_DEV_WMAC
+config ATH79_MACH_GL_AR750
+ bool "GL.iNet GL-AR750 support"
+ select SOC_QCA953X
+ select ATH79_DEV_AP9X_PCI if PCI
+ select ATH79_DEV_ETH
+ select ATH79_DEV_GPIO_BUTTONS
+ select ATH79_DEV_LEDS_GPIO
+ select ATH79_DEV_M25P80
+ select ATH79_DEV_USB
+ select ATH79_DEV_WMAC
+
config ATH79_MACH_GL_DOMINO
bool "DOMINO support"
select SOC_AR933X
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
index 29c9c65bc122c0d02839adf1abb61dcda0795fb6..98281db31a05713168713f3e0fd62f736a2e7614 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
@@ -115,6 +115,7 @@ obj-$(CONFIG_ATH79_MACH_FRITZ4020) += mach-fritz4020.o
obj-$(CONFIG_ATH79_MACH_GL_AR150) += mach-gl-ar150.o
obj-$(CONFIG_ATH79_MACH_GL_AR300) += mach-gl-ar300.o
obj-$(CONFIG_ATH79_MACH_GL_AR300M) += mach-gl-ar300m.o
+obj-$(CONFIG_ATH79_MACH_GL_AR750) += mach-gl-ar750.o
obj-$(CONFIG_ATH79_MACH_GL_DOMINO) += mach-gl-domino.o
obj-$(CONFIG_ATH79_MACH_GL_INET) += mach-gl-inet.o
obj-$(CONFIG_ATH79_MACH_GL_MIFI) += mach-gl-mifi.o
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar750.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar750.c
new file mode 100644
index 0000000000000000000000000000000000000000..9ee6e29c02139b972a83a555fcd693765bf8194f
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar750.c
@@ -0,0 +1,146 @@
+/*
+ * GL.iNet GL-AR750 board support
+ *
+ * Copyright (C) 2018 Piotr Dymacz <pepe2k@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ */
+
+#include <linux/gpio.h>
+#include <linux/i2c.h>
+#include <linux/i2c-gpio.h>
+#include <linux/platform_device.h>
+
+#include <asm/mach-ath79/ath79.h>
+#include <asm/mach-ath79/ar71xx_regs.h>
+
+#include "common.h"
+#include "dev-ap9x-pci.h"
+#include "dev-eth.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-usb.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+
+#define GL_AR750_GPIO_LED_POWER 12
+#define GL_AR750_GPIO_LED_WLAN2G 14
+#define GL_AR750_GPIO_LED_WLAN5G 13
+
+#define GL_AR750_GPIO_BTN_RESET 3
+#define GL_AR750_GPIO_BTN_SW1 0
+
+#define GL_AR750_GPIO_I2C_SCL 16
+#define GL_AR750_GPIO_I2C_SDA 17
+
+#define GL_AR750_GPIO_USB_POWER 2
+
+#define GL_AR750_KEYS_POLL_INTERVAL 20
+#define GL_AR750_KEYS_DEBOUNCE_INTERVAL (3 * GL_AR750_KEYS_POLL_INTERVAL)
+
+#define GL_AR750_MAC0_OFFSET 0
+#define GL_AR750_WMAC2G_CALDATA_OFFSET 0x1000
+#define GL_AR750_WMAC5G_CALDATA_OFFSET 0x5000
+
+static struct gpio_led gl_ar750_leds_gpio[] __initdata = {
+ {
+ .name = "gl-ar750:white:power",
+ .gpio = GL_AR750_GPIO_LED_POWER,
+ .default_state = LEDS_GPIO_DEFSTATE_KEEP,
+ .active_low = 1,
+ }, {
+ .name = "gl-ar750:white:wlan2g",
+ .gpio = GL_AR750_GPIO_LED_WLAN2G,
+ .active_low = 1,
+ }, {
+ .name = "gl-ar750:white:wlan5g",
+ .gpio = GL_AR750_GPIO_LED_WLAN5G,
+ .active_low = 1,
+ },
+};
+
+static struct gpio_keys_button gl_ar750_gpio_keys[] __initdata = {
+ {
+ .desc = "reset",
+ .type = EV_KEY,
+ .code = KEY_RESTART,
+ .debounce_interval = GL_AR750_KEYS_DEBOUNCE_INTERVAL,
+ .gpio = GL_AR750_GPIO_BTN_RESET,
+ .active_low = 1,
+ }, {
+ .desc = "sw1",
+ .type = EV_KEY,
+ .code = BTN_0,
+ .debounce_interval = GL_AR750_KEYS_DEBOUNCE_INTERVAL,
+ .gpio = GL_AR750_GPIO_BTN_SW1,
+ .active_low = 1,
+ },
+};
+
+static struct i2c_gpio_platform_data gl_ar750_i2c_gpio_data = {
+ .sda_pin = GL_AR750_GPIO_I2C_SDA,
+ .scl_pin = GL_AR750_GPIO_I2C_SCL,
+};
+
+static struct platform_device gl_ar750_i2c_gpio = {
+ .name = "i2c-gpio",
+ .id = 0,
+ .dev = {
+ .platform_data = &gl_ar750_i2c_gpio_data,
+ },
+};
+
+static void __init gl_ar750_setup(void)
+{
+ u8 *art = (u8 *) KSEG1ADDR(0x1f050000);
+
+ ath79_register_m25p80(NULL);
+
+ ath79_setup_ar933x_phy4_switch(false, false);
+ ath79_register_mdio(0, 0x0);
+
+ ath79_switch_data.phy4_mii_en = 1;
+ ath79_switch_data.phy_poll_mask = 0xfc;
+
+ /* WAN */
+ ath79_eth0_data.duplex = DUPLEX_FULL;
+ ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
+ ath79_eth0_data.phy_mask = BIT(4);
+ ath79_eth0_data.speed = SPEED_100;
+ ath79_init_mac(ath79_eth0_data.mac_addr, art + GL_AR750_MAC0_OFFSET, 0);
+ ath79_register_eth(0);
+
+ /* LAN */
+ ath79_eth1_data.duplex = DUPLEX_FULL;
+ ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
+ ath79_init_mac(ath79_eth1_data.mac_addr, art + GL_AR750_MAC0_OFFSET, 1);
+ ath79_register_eth(1);
+
+ /* Disable JTAG (enables GPIO0-3) */
+ ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE);
+
+ ath79_register_leds_gpio(-1, ARRAY_SIZE(gl_ar750_leds_gpio),
+ gl_ar750_leds_gpio);
+
+ ath79_register_gpio_keys_polled(-1, GL_AR750_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(gl_ar750_gpio_keys),
+ gl_ar750_gpio_keys);
+
+ gpio_request_one(GL_AR750_GPIO_USB_POWER,
+ GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
+ "USB power");
+
+ platform_device_register(&gl_ar750_i2c_gpio);
+
+ ath79_register_usb();
+
+ ath79_register_wmac(art + GL_AR750_WMAC2G_CALDATA_OFFSET, NULL);
+
+ ap91_pci_init(art + GL_AR750_WMAC5G_CALDATA_OFFSET, NULL);
+}
+
+MIPS_MACHINE(ATH79_MACH_GL_AR750, "GL-AR750", "GL.iNet GL-AR750",
+ gl_ar750_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
index 89ddbbc976c9393608a80b9ce56e02a4d403ea2a..11ccdbb5083807ef137b8cd2d110de7a97a34e38 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
+++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
@@ -106,6 +106,7 @@ enum ath79_mach_type {
ATH79_MACH_GL_AR150, /* GL-AR150 support */
ATH79_MACH_GL_AR300, /* GL-AR300 */
ATH79_MACH_GL_AR300M, /* GL-AR300M */
+ ATH79_MACH_GL_AR750, /* GL.iNet GL-AR750 */
ATH79_MACH_GL_DOMINO, /* Domino */
ATH79_MACH_GL_INET, /* GL-CONNECT GL-INET */
ATH79_MACH_GL_MIFI, /* GL-MIFI support */
diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk
index d113c5ad621bb2f15d4cbc4fd50e60904313a7da..d1375c8742d8aea6224f7aca3d9e9522d8056a94 100644
--- a/target/linux/ar71xx/image/generic.mk
+++ b/target/linux/ar71xx/image/generic.mk
@@ -161,6 +161,19 @@ define Device/gl-ar300m
endef
TARGET_DEVICES += gl-ar300m
+define Device/gl-ar750
+ DEVICE_TITLE := GL.iNet GL-AR750
+ DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca9887 kmod-usb-core \
+ kmod-usb2 kmod-usb-storage
+ BOARDNAME := GL-AR750
+ SUPPORTED_DEVICES := gl-ar750
+ IMAGE_SIZE := 16000k
+ MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env),64k(art)ro,-(firmware)
+ IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
+ append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
+endef
+TARGET_DEVICES += gl-ar750
+
define Device/gl-domino
DEVICE_TITLE := GL Domino Pi
DEVICE_PACKAGES := kmod-usb-core kmod-usb2
From: Piotr Dymacz <pepe2k@gmail.com>
Date: Tue, 17 Oct 2017 23:32:11 +0200
Subject: uboot-envtools: add support for GL.iNet GL-AR750
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index 25bec7eb33fd691bae417512c4c03e133d93213d..26f1ff938b8191e84315cf308f78e0907264c671 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -29,6 +29,7 @@ cr3000|\
cr5000|\
eap300v2|\
gl-ar300m|\
+gl-ar750|\
hornet-ub|\
hornet-ub-x2|\
jwap230|\
From: David Bauer <mail@david-bauer.net>
Date: Sun, 25 Feb 2018 12:09:38 +0100
Subject: ar71xx: add model detection for UBNT AC-Mesh
This commit adds correct model detection for UniFi
AC-Mesh. Previously said device was incorrectly detected
as UniFi AC-Lite.
The Information about the device is stored at 0xC in the EEPROM
partition. It corresponds to the sysid in /etc/board.info of the
Ubiquiti stock firmware.
Signed-off-by: David Bauer <mail@david-bauer.net>
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 35b742a5f1fee0bc24ab2d88e32f118c1df4e2b3..59c1899a588007d6a6a1860fcf95064b0ec35561 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -98,6 +98,27 @@ ubnt_xm_board_detect() {
[ -z "$model" ] || AR71XX_MODEL="${model}${magic:3:1}"
}
+ubnt_ac_lite_get_mtd_part_magic() {
+ ar71xx_get_mtd_offset_size_format EEPROM 12 2 %02x
+}
+
+ubnt_ac_lite_board_detect() {
+ local model
+ local magic
+
+ magic="$(ubnt_ac_lite_get_mtd_part_magic)"
+ case ${magic:0:4} in
+ "e517")
+ model="Ubiquiti UniFi-AC-LITE"
+ ;;
+ "e557")
+ model="Ubiquiti UniFi-AC-MESH"
+ ;;
+ esac
+
+ [ -z "$model" ] || AR71XX_MODEL="${model}"
+}
+
cybertan_get_hw_magic() {
local part
@@ -1129,6 +1150,7 @@ ar71xx_board_detect() {
;;
*"UniFi-AC-LITE")
name="unifiac-lite"
+ ubnt_ac_lite_board_detect
;;
*"UniFi-AC-PRO")
name="unifiac-pro"
From: Piotr Dymacz <pepe2k@gmail.com>
Date: Mon, 3 Jul 2017 18:57:36 +0200
Subject: ar71xx: generic: enable CONFIG_MTD_SPLIT_TPLINK_FW
We can use "tplink-fw" mtd splitter for TP-Link devices which use kernel
with TP-Link header embedded inside "safeloader" image type and thus get
rid of statically defined "kernel" and "rootfs" partitions in cmdline.
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4
index d96642b97c36187febb1f3843e7dd9acfab0e40d..6c29cd7748b3ce7e53adf359cd5002ba01066fbd 100644
--- a/target/linux/ar71xx/config-4.4
+++ b/target/linux/ar71xx/config-4.4
@@ -379,6 +379,7 @@ CONFIG_MTD_SPLIT_EVA_FW=y
CONFIG_MTD_SPLIT_FIRMWARE=y
CONFIG_MTD_SPLIT_LZMA_FW=y
CONFIG_MTD_SPLIT_SEAMA_FW=y
+CONFIG_MTD_SPLIT_TPLINK_FW=y
CONFIG_MTD_SPLIT_UIMAGE_FW=y
CONFIG_MTD_SPLIT_WRGG_FW=y
CONFIG_MTD_TPLINK_PARTS=y
diff --git a/target/linux/ar71xx/mikrotik/config-default b/target/linux/ar71xx/mikrotik/config-default
index e0401102229c00985e8000331dce43375903e1aa..f5d48ae0f674883371f8d549594f695913c3d216 100644
--- a/target/linux/ar71xx/mikrotik/config-default
+++ b/target/linux/ar71xx/mikrotik/config-default
@@ -219,6 +219,7 @@ CONFIG_MTD_NAND_RB4XX=y
CONFIG_MTD_NAND_RB750=y
CONFIG_MTD_NAND_RB91X=y
# CONFIG_MTD_SPLIT_EVA_FW is not set
+# CONFIG_MTD_SPLIT_TPLINK_FW is not set
# CONFIG_MTD_REDBOOT_PARTS is not set
# CONFIG_MTD_TPLINK_PARTS is not set
CONFIG_MTD_UBI=y
diff --git a/target/linux/ar71xx/nand/config-default b/target/linux/ar71xx/nand/config-default
index 790fa8f9bd42aba8521b960c2a49a742285e6157..0eee52d3ee69990fadf77de9f03f03c9c9b59190 100644
--- a/target/linux/ar71xx/nand/config-default
+++ b/target/linux/ar71xx/nand/config-default
@@ -107,6 +107,7 @@ CONFIG_MTD_NAND_ECC_BCH=y
# CONFIG_MTD_SM_COMMON is not set
# CONFIG_MTD_SPLIT_EVA_FW is not set
# CONFIG_MTD_SPLIT_SEAMA_FW is not set
+# CONFIG_MTD_SPLIT_TPLINK_FW is not set
# CONFIG_MTD_TPLINK_PARTS is not set
CONFIG_MTD_UBI=y
CONFIG_MTD_UBI_BEB_LIMIT=20
From: Sven Eckelmann <sven.eckelmann@openmesh.com>
Date: Wed, 6 Jun 2018 11:21:53 +0200
Subject: mac80211: initialize sinfo in cfg80211_get_station
Most of the implementations behind cfg80211_get_station will not initialize
sinfo to zero before manipulating it. For example, the member "filled",
which indicates the filled in parts of this struct, is often only modified
by enabling certain bits in the bitfield while keeping the remaining bits
in their original state. A caller without a preinitialized sinfo.filled can
then no longer decide which parts of sinfo were filled in by
cfg80211_get_station (or actually the underlying implementations).
cfg80211_get_station must therefore take care that sinfo is initialized to
zero. Otherwise, the caller may tries to read information which was not
filled in and which must therefore also be considered uninitialized. In
batadv_v_elp_get_throughput's case, an invalid "random" expected throughput
may be stored for this neighbor and thus the B.A.T.M.A.N V algorithm may
switch to non-optimal neighbors for certain destinations.
Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Forwarded: https://github.com/openwrt/openwrt/pull/1015
diff --git a/package/kernel/mac80211/patches/379-cfg80211-initialize-sinfo-in-cfg80211_get_station.patch b/package/kernel/mac80211/patches/379-cfg80211-initialize-sinfo-in-cfg80211_get_station.patch
new file mode 100644
index 0000000000000000000000000000000000000000..37323c1f7defee830b3f876a46f255acf21fce42
--- /dev/null
+++ b/package/kernel/mac80211/patches/379-cfg80211-initialize-sinfo-in-cfg80211_get_station.patch
@@ -0,0 +1,42 @@
+From 4f717a2589be649afddbbd3ac58b67ebfa7426f7 Mon Sep 17 00:00:00 2001
+From: Sven Eckelmann <sven@narfation.org>
+Date: Wed, 6 Jun 2018 10:18:31 +0200
+Subject: [PATCH v2] cfg80211: initialize sinfo in cfg80211_get_station
+
+Most of the implementations behind cfg80211_get_station will not initialize
+sinfo to zero before manipulating it. For example, the member "filled",
+which indicates the filled in parts of this struct, is often only modified
+by enabling certain bits in the bitfield while keeping the remaining bits
+in their original state. A caller without a preinitialized sinfo.filled can
+then no longer decide which parts of sinfo were filled in by
+cfg80211_get_station (or actually the underlying implementations).
+
+cfg80211_get_station must therefore take care that sinfo is initialized to
+zero. Otherwise, the caller may tries to read information which was not
+filled in and which must therefore also be considered uninitialized. In
+batadv_v_elp_get_throughput's case, an invalid "random" expected throughput
+may be stored for this neighbor and thus the B.A.T.M.A.N V algorithm may
+switch to non-optimal neighbors for certain destinations.
+
+Fixes: 7406353d43c8 ("cfg80211: implement cfg80211_get_station cfg80211 API")
+Reported-by: Thomas Lauer <holminateur@gmail.com>
+Reported-by: Marcel Schmidt <ff.z-casparistrasse@mailbox.org>
+Cc: b.a.t.m.a.n@lists.open-mesh.org
+Signed-off-by: Sven Eckelmann <sven@narfation.org>
+
+Forwarded: https://patchwork.kernel.org/patch/10449857/
+---
+ net/wireless/util.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/net/wireless/util.c
++++ b/net/wireless/util.c
+@@ -1749,6 +1749,8 @@ int cfg80211_get_station(struct net_devi
+ if (!rdev->ops->get_station)
+ return -EOPNOTSUPP;
+
++ memset(sinfo, 0, sizeof(*sinfo));
++
+ return rdev_get_station(rdev, dev, mac_addr, sinfo);
+ }
+ EXPORT_SYMBOL(cfg80211_get_station);
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Wed, 6 Jun 2018 20:51:05 +0200
Subject: ar71xx: lzma-loader: move padding workaround to gzip step
Some devices (TP-Link TL-WR1043ND v1) don't boot reliably when the
uncompressed loader is too small. This was workarounded in the loader by
adding 512KB of padding to the .data section of the loader binary.
This approach had two issues:
- The padding was only working when .data was non-empty (otherwise the
section would become NOBITS, omitting it in the binary). .data was only
empty when no CMDLINE was set, leading to further workarounds like
fe594bf90d09 ("ath79: fix loader-okli, lzma-loader"), and this
workaround was only effective because a missing "const" led to the kernel
argv being stored in .data instead of .rodata
- The padding was not only added to the compressed .gz loader, but also
uncompressed .bin and .elf loaders. The prevented embedding the kernel
cmdline in the loader for non-gz loader types.
To fix both issues, move the creation of the padding from the linker script
to the gzip step.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/target/linux/ar71xx/image/lzma-loader/Makefile b/target/linux/ar71xx/image/lzma-loader/Makefile
index 9b81e87306f235d1e7284401828240b9b9787011..738093a958013624abb8f84a3874e1c795da349d 100644
--- a/target/linux/ar71xx/image/lzma-loader/Makefile
+++ b/target/linux/ar71xx/image/lzma-loader/Makefile
@@ -47,7 +47,11 @@ loader-compile: $(PKG_BUILD_DIR)/.prepared
clean all
loader.gz: $(PKG_BUILD_DIR)/loader.bin
- gzip -nc9 $< > $(LOADER_GZ)
+ # Workaround for buggy bootloaders: Some devices
+ # (TP-Link TL-WR1043ND v1) don't work correctly when
+ # the uncompressed loader is too small (probably a cache
+ # invalidation issue)
+ dd if=$< bs=512K conv=sync | gzip -nc9 > $(LOADER_GZ)
loader.elf: $(PKG_BUILD_DIR)/loader.elf
$(CP) $< $(LOADER_ELF)
diff --git a/target/linux/ar71xx/image/lzma-loader/src/loader.lds b/target/linux/ar71xx/image/lzma-loader/src/loader.lds
index 80cc7ca3ecf53a747fc139560b89c233f4343293..01ff85236147dc62bae480b191a44005171b1561 100644
--- a/target/linux/ar71xx/image/lzma-loader/src/loader.lds
+++ b/target/linux/ar71xx/image/lzma-loader/src/loader.lds
@@ -13,7 +13,6 @@ SECTIONS {
.data : {
*(.data)
*(.data.*)
- . = . + 524288; /* workaround for buggy bootloaders */
}
. = ALIGN(32);
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Wed, 6 Jun 2018 00:27:42 +0200
Subject: ar71xx: lzma-loader: set page size to 4KB
The text section in the ELF loader is aligned to the maximum page size,
which defaults to 64KB. Reduce it to the actual page size to avoid wasting
flash space for this alignment.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/target/linux/ar71xx/image/lzma-loader/src/Makefile b/target/linux/ar71xx/image/lzma-loader/src/Makefile
index 5f10bdb8f1499f24f00a8bf4d53f370fef88bd1e..fadb7e6206070c07aab3e8b323324976c6998eea 100644
--- a/target/linux/ar71xx/image/lzma-loader/src/Makefile
+++ b/target/linux/ar71xx/image/lzma-loader/src/Makefile
@@ -95,7 +95,7 @@ loader2.o: loader.bin
$(LD) -r -b binary --oformat $(O_FORMAT) -o $@ $<
loader.elf: loader2.o
- $(LD) -e startup -T loader2.lds -Ttext $(LOADADDR) -o $@ $<
+ $(LD) -z max-page-size=0x1000 -e startup -T loader2.lds -Ttext $(LOADADDR) -o $@ $<
mrproper: clean
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Wed, 6 Jun 2018 00:30:57 +0200
Subject: ar71xx: lzma-loader: constify kernel argv array
By making the kernel argv array const, the .data section can always be
omitted from the laoder binary.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/target/linux/ar71xx/image/lzma-loader/src/loader.c b/target/linux/ar71xx/image/lzma-loader/src/loader.c
index cc73eb1721cbfbf2ad1bb94e8e6d3ab006983c5d..794c4b6285a7fa0423c22d172828415e6f2be93b 100644
--- a/target/linux/ar71xx/image/lzma-loader/src/loader.c
+++ b/target/linux/ar71xx/image/lzma-loader/src/loader.c
@@ -75,7 +75,7 @@ static unsigned long kernel_la;
#ifdef CONFIG_KERNEL_CMDLINE
#define kernel_argc 2
static const char kernel_cmdline[] = CONFIG_KERNEL_CMDLINE;
-static const char *kernel_argv[] = {
+static const char *const kernel_argv[] = {
NULL,
kernel_cmdline,
NULL,
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Wed, 6 Jun 2018 00:34:25 +0200
Subject: ar71xx: make loader-okli build step more generic
Add support for different loader types.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 8eac5fc997cab0203718fb0558e6f5aaaeec9c38..de27f5d7c5ce6dbd31305c139afc128edaed15ee 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -73,8 +73,9 @@ define Build/loader-kernel-cmdline
$(call Build/loader-common,LOADER_DATA="$@" KERNEL_CMDLINE="$(CMDLINE)")
endef
+# Arguments: <output name> <kernel offset>
define Build/loader-okli
- dd if=$(KDIR)/loader-$(1).gz bs=7680 conv=sync of="$@.new"
+ dd if=$(KDIR)/loader-$(word 1,$(1)).$(LOADER_TYPE) bs=$(word 2,$(1)) conv=sync of="$@.new"
cat "$@" >> "$@.new"
mv "$@.new" "$@"
endef
diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk
index 1e40d943ac2aa43aea670fd86268708aea39a46c..18e2c73737f477f4d00020893878cbdfb81a735b 100644
--- a/target/linux/ar71xx/image/tp-link.mk
+++ b/target/linux/ar71xx/image/tp-link.mk
@@ -69,7 +69,7 @@ $(Device/tplink)
LOADER_FLASH_OFFS := 0x22000
COMPILE := loader-$(1).gz
COMPILE/loader-$(1).gz := loader-okli-compile
- KERNEL := copy-file $(KDIR)/vmlinux.bin.lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1)
+ KERNEL := copy-file $(KDIR)/vmlinux.bin.lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) 7680
KERNEL_INITRAMFS := copy-file $(KDIR)/vmlinux-initramfs.bin.lzma | loader-kernel-cmdline | mktplinkfw-combined
endef
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Wed, 6 Jun 2018 00:35:17 +0200
Subject: ar71xx: switch CPE/WBS 210/510 to okli-loader
We recently increased the kernel partition size of the CPE/WBS 210/510.
This works fine for new installations of the factory image, but on
sysupgrades, the partition table read by the bootloader is not adjusted.
This limits the maximum size of the kernel loaded by the bootloader to the
old partition size.
While adjusting the partition table would be a cleanest solution, such a
migration would have to happen before an upgrade to a new version with a
newer kernel. This is error-prone and would require a two-step upgrade, as
we mark the partition table partition read-only.
Instead, switch from the lzma-loader with embedded kernel to the
okli-loader, so only the tiny lzma-loader is loaded by the bootloader as
"kernel", and the lzma-loader will then load the rest of the kernel by
itself.
Fixes: e39847ea2f70 ("ar71xx: increase kernel partition size for CPE/WBS 210/510")
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk
index 18e2c73737f477f4d00020893878cbdfb81a735b..709b1558a5f8487c50e922ec4d27b643f080cbcc 100644
--- a/target/linux/ar71xx/image/tp-link.mk
+++ b/target/linux/ar71xx/image/tp-link.mk
@@ -173,7 +173,10 @@ define Device/cpe510-520
TPLINK_BOARD_NAME := CPE510
DEVICE_PROFILE := CPE510
LOADER_TYPE := elf
- KERNEL := kernel-bin | patch-cmdline | lzma | loader-kernel
+ LOADER_FLASH_OFFS := 0x43000
+ COMPILE := loader-$(1).elf
+ COMPILE/loader-$(1).elf := loader-okli-compile
+ KERNEL := kernel-bin | lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) 12288
IMAGES := sysupgrade.bin factory.bin
IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade
IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
From: Paul Wassi <p.wassi@gmx.at>
Date: Sun, 22 Oct 2017 22:39:30 +0200
Subject: ar71xx: add support for TP-Link TL-WA901ND v5
The TL-WA901ND v5 has the same hardware as v4, although the PCB has
a different layout. Installation from factory is done via TFTP.
(rename -factory image to wa901ndv4_tp_recovery.bin for tftp)
Signed-off-by: Paul Wassi <p.wassi@gmx.at>
diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds
index f94cc3c85b798458cc97c06bb0d44bdc426d057d..a742854bc9b0aa48c61b37e58288177bbb56d14d 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -606,7 +606,8 @@ tl-wa860re|\
tl-wa830re-v2|\
tl-wa801nd-v2|\
tl-wa901nd-v3|\
-tl-wa901nd-v4)
+tl-wa901nd-v4|\
+tl-wa901nd-v5)
ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
;;
diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network
index c8990c60f504286d0fd28c7b17f54c9c3b5a891e..875a1a38ada9fb66503505d2f094310db1295a07 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -110,6 +110,7 @@ ar71xx_setup_interfaces()
tl-wa901nd-v2|\
tl-wa901nd-v3|\
tl-wa901nd-v4|\
+ tl-wa901nd-v5|\
tl-wr703n|\
tl-wr802n-v1|\
tube2h|\
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 01d3b787bedcab82a5797c9a4801e8139887cc2c..f8d2eb314f7b57a1134b68c504c0dac202ed947c 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -363,6 +363,7 @@ get_status_led() {
tl-wa901nd-v2|\
tl-wa901nd-v3|\
tl-wa901nd-v4|\
+ tl-wa901nd-v5|\
tl-wdr3320-v2|\
tl-wdr3500|\
tl-wr1041n-v2|\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 59c1899a588007d6a6a1860fcf95064b0ec35561..b365b6ae4aa6021960499b3889d846b5171eec0f 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -1058,6 +1058,9 @@ ar71xx_board_detect() {
*"TL-WA901ND v4")
name="tl-wa901nd-v4"
;;
+ *"TL-WA901ND v5")
+ name="tl-wa901nd-v5"
+ ;;
*"TL-WDR3320 v2")
name="tl-wdr3320-v2"
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 236520b27c4d6d0b1b7e483d1100fb5ab156d475..0b422d71c2639a31bc7e88a20976266b66ec4490 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -415,6 +415,7 @@ platform_check_image() {
tl-wa901nd-v2|\
tl-wa901nd-v3|\
tl-wa901nd-v4|\
+ tl-wa901nd-v5|\
tl-wa901nd|\
tl-wdr3320-v2|\
tl-wdr3500|\
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa901nd-v4.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa901nd-v4.c
index 9c651bb1d256bc13a3fe31b664f2cd3590e8092f..ffbcd6fe42df9b7c0dd86ae23a21ab7c90917a8c 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa901nd-v4.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa901nd-v4.c
@@ -1,5 +1,5 @@
/*
- * TP-LINK TL-WA901ND v4 board
+ * TP-LINK TL-WA901ND v4, v5 board
*
* Copyright (C) 2015 Matthias Schiffer <mschiffer@universe-factory.net>
* Copyright (C) 2016 Tiziano Bacocco <tizbac2@gmail.com>
@@ -110,3 +110,6 @@ static void __init TL_WA901ND_V4_setup(void)
MIPS_MACHINE(ATH79_MACH_TL_WA901ND_V4, "TL-WA901ND-v4", "TP-LINK TL-WA901ND v4",
TL_WA901ND_V4_setup);
+
+MIPS_MACHINE(ATH79_MACH_TL_WA901ND_V5, "TL-WA901ND-v5", "TP-LINK TL-WA901ND v5",
+ TL_WA901ND_V4_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
index 11ccdbb5083807ef137b8cd2d110de7a97a34e38..a4c7f52fe94e17bc48bebfb460f12f3e5ac35afe 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
+++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
@@ -213,6 +213,7 @@ enum ath79_mach_type {
ATH79_MACH_TL_WA901ND_V2, /* TP-LINK TL-WA901ND v2 */
ATH79_MACH_TL_WA901ND_V3, /* TP-LINK TL-WA901ND v3 */
ATH79_MACH_TL_WA901ND_V4, /* TP-LINK TL-WA901ND v4 */
+ ATH79_MACH_TL_WA901ND_V5, /* TP-LINK TL-WA901ND v5 */
ATH79_MACH_TL_WDR3320_V2, /* TP-LINK TL-WDR3320 v2 */
ATH79_MACH_TL_WDR3500, /* TP-LINK TL-WDR3500 */
ATH79_MACH_TL_WDR4300, /* TP-LINK TL-WDR4300 */
diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk
index 709b1558a5f8487c50e922ec4d27b643f080cbcc..6a3faef518ebfa4f36d3074ee9c102b801e04275 100644
--- a/target/linux/ar71xx/image/tp-link.mk
+++ b/target/linux/ar71xx/image/tp-link.mk
@@ -1103,7 +1103,13 @@ define Device/tl-wa901nd-v4
IMAGE/factory.bin := append-rootfs | mktplinkfw factory -C EU
endef
-TARGET_DEVICES += tl-wa901nd-v1 tl-wa901nd-v2 tl-wa901nd-v3 tl-wa901nd-v4
+define Device/tl-wa901nd-v5
+ $(Device/tl-wa901nd-v4)
+ DEVICE_TITLE := TP-LINK TL-WA901N/ND v5
+ BOARDNAME := TL-WA901ND-v5
+ TPLINK_HWID := 0x09010005
+endef
+TARGET_DEVICES += tl-wa901nd-v1 tl-wa901nd-v2 tl-wa901nd-v3 tl-wa901nd-v4 tl-wa901nd-v5
define Device/tl-wa7210n-v2
$(Device/tplink-4mlzma)
From: Sven Eckelmann <sven@narfation.org>
Date: Fri, 19 Jan 2018 14:02:09 +0100
Subject: ar71xx: disable 40Mhz refclk for QCA953x
The "QCA9531 v2.0 802.11n 2x2 2.4 GHz Premium SOC for WLAN Platforms"
datasheet (80-Y7991-1 Rev. C - October 2014) doesn't specify support for a
40 Mhz reference clock. The register description for "Bootstrap Options"
(page 31) defines following states for the bit 4 (REF_CLK):
* 0 - CLK25 (default)
* 1 - (reserved)
Devices like the TP-Link CPE210 v2 has this bit set to 1 but is using a 25
Mhz reference clock. OpenWrt is still interpreted this bit as 40 Mhz and
then break the bootup of the system due to this incorrect interpretation.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
[refreshed patches]
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
Origin: backport, https://github.com/openwrt/openwrt/commit/b1d57dadb2da0e010e157fd2383523578c9dcc2e
diff --git a/target/linux/ar71xx/patches-4.4/620-MIPS-ath79-add-support-for-QCA953x-SoC.patch b/target/linux/ar71xx/patches-4.4/620-MIPS-ath79-add-support-for-QCA953x-SoC.patch
index 777f7b2c8838f2c93f79d5d5212f90b2bd82ced3..d55c97165a5abad8cb25fcc6ddc29415f238c7e6 100644
--- a/target/linux/ar71xx/patches-4.4/620-MIPS-ath79-add-support-for-QCA953x-SoC.patch
+++ b/target/linux/ar71xx/patches-4.4/620-MIPS-ath79-add-support-for-QCA953x-SoC.patch
@@ -44,7 +44,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
config ATH79_NVRAM
--- a/arch/mips/ath79/clock.c
+++ b/arch/mips/ath79/clock.c
-@@ -354,6 +354,91 @@ static void __init ar934x_clocks_init(vo
+@@ -354,6 +354,87 @@ static void __init ar934x_clocks_init(vo
iounmap(dpll_base);
}
@@ -56,13 +56,9 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
+ unsigned long ahb_rate;
+ u32 pll, out_div, ref_div, nint, frac, clk_ctrl, postdiv;
+ u32 cpu_pll, ddr_pll;
-+ u32 bootstrap;
+
-+ bootstrap = ath79_reset_rr(QCA953X_RESET_REG_BOOTSTRAP);
-+ if (bootstrap & QCA953X_BOOTSTRAP_REF_CLK_40)
-+ ref_rate = 40 * 1000 * 1000;
-+ else
-+ ref_rate = 25 * 1000 * 1000;
++ /* QCA953X only supports 25MHz ref_clk */
++ ref_rate = 25 * 1000 * 1000;
+
+ pll = ath79_pll_rr(QCA953X_PLL_CPU_CONFIG_REG);
+ out_div = (pll >> QCA953X_PLL_CPU_CONFIG_OUTDIV_SHIFT) &
@@ -136,7 +132,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
static void __init qca955x_clocks_init(void)
{
unsigned long ref_rate;
-@@ -451,6 +536,8 @@ void __init ath79_clocks_init(void)
+@@ -451,6 +532,8 @@ void __init ath79_clocks_init(void)
ar933x_clocks_init();
else if (soc_is_ar934x())
ar934x_clocks_init();
@@ -247,14 +243,12 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
ath79_wmac_data.external_reset = ar933x_wmac_reset;
}
-@@ -151,6 +151,26 @@ static void ar934x_wmac_setup(void)
+@@ -151,6 +151,21 @@ static void ar934x_wmac_setup(void)
ath79_wmac_data.get_mac_revision = ar93xx_get_soc_revision;
}
+static void qca953x_wmac_setup(void)
+{
-+ u32 t;
-+
+ ath79_wmac_device.name = "qca953x_wmac";
+
+ ath79_wmac_resources[0].start = QCA953X_WMAC_BASE;
@@ -262,11 +256,8 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
+ ath79_wmac_resources[1].start = ATH79_IP2_IRQ(1);
+ ath79_wmac_resources[1].end = ATH79_IP2_IRQ(1);
+
-+ t = ath79_reset_rr(QCA953X_RESET_REG_BOOTSTRAP);
-+ if (t & QCA953X_BOOTSTRAP_REF_CLK_40)
-+ ath79_wmac_data.is_clk_25mhz = false;
-+ else
-+ ath79_wmac_data.is_clk_25mhz = true;
++ /* QCA953X only supports 25MHz ref_clk */
++ ath79_wmac_data.is_clk_25mhz = true;
+
+ ath79_wmac_data.get_mac_revision = ar93xx_get_soc_revision;
+}
@@ -274,7 +265,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
static void qca955x_wmac_setup(void)
{
u32 t;
-@@ -368,6 +388,8 @@ void __init ath79_register_wmac(u8 *cal_
+@@ -368,6 +383,8 @@ void __init ath79_register_wmac(u8 *cal_
ar933x_wmac_setup();
else if (soc_is_ar934x())
ar934x_wmac_setup();
@@ -550,7 +541,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
+#define QCA953X_BOOTSTRAP_SW_OPTION2 BIT(12)
+#define QCA953X_BOOTSTRAP_SW_OPTION1 BIT(11)
+#define QCA953X_BOOTSTRAP_EJTAG_MODE BIT(5)
-+#define QCA953X_BOOTSTRAP_REF_CLK_40 BIT(4)
++#define QCA953X_BOOTSTRAP_REF_CLK BIT(4)
+#define QCA953X_BOOTSTRAP_SDRAM_DISABLED BIT(1)
+#define QCA953X_BOOTSTRAP_DDR1 BIT(0)
+
diff --git a/target/linux/ar71xx/patches-4.4/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch b/target/linux/ar71xx/patches-4.4/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch
index ed90c40d882fcff1a451533748912865cc78c6e8..de0ee4604cdeb946bab222cacaa51fb150b25aab 100644
--- a/target/linux/ar71xx/patches-4.4/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch
+++ b/target/linux/ar71xx/patches-4.4/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch
@@ -24,7 +24,7 @@
config ATH79_NVRAM
--- a/arch/mips/ath79/clock.c
+++ b/arch/mips/ath79/clock.c
-@@ -524,6 +524,100 @@ static void __init qca955x_clocks_init(v
+@@ -520,6 +520,100 @@ static void __init qca955x_clocks_init(v
clk_add_alias("uart", NULL, "ref", NULL);
}
@@ -125,7 +125,7 @@
void __init ath79_clocks_init(void)
{
if (soc_is_ar71xx())
-@@ -540,6 +634,8 @@ void __init ath79_clocks_init(void)
+@@ -536,6 +630,8 @@ void __init ath79_clocks_init(void)
qca953x_clocks_init();
else if (soc_is_qca955x())
qca955x_clocks_init();
@@ -219,7 +219,7 @@
}
--- a/arch/mips/ath79/dev-wmac.c
+++ b/arch/mips/ath79/dev-wmac.c
-@@ -189,6 +189,26 @@ static void qca955x_wmac_setup(void)
+@@ -184,6 +184,26 @@ static void qca955x_wmac_setup(void)
ath79_wmac_data.is_clk_25mhz = true;
}
@@ -246,7 +246,7 @@
static bool __init
ar93xx_wmac_otp_read_word(void __iomem *base, int addr, u32 *data)
{
-@@ -392,6 +412,8 @@ void __init ath79_register_wmac(u8 *cal_
+@@ -387,6 +407,8 @@ void __init ath79_register_wmac(u8 *cal_
qca953x_wmac_setup();
else if (soc_is_qca955x())
qca955x_wmac_setup();
diff --git a/target/linux/ar71xx/patches-4.4/631-MIPS-ath79-wmac-enable-set-led-pin.patch b/target/linux/ar71xx/patches-4.4/631-MIPS-ath79-wmac-enable-set-led-pin.patch
index 16a0b909c570b403473346b0c992f9de02b67132..b0e15379787ade16a02363c78c143e878f27a7f2 100644
--- a/target/linux/ar71xx/patches-4.4/631-MIPS-ath79-wmac-enable-set-led-pin.patch
+++ b/target/linux/ar71xx/patches-4.4/631-MIPS-ath79-wmac-enable-set-led-pin.patch
@@ -1,6 +1,6 @@
--- a/arch/mips/ath79/dev-wmac.c
+++ b/arch/mips/ath79/dev-wmac.c
-@@ -400,6 +400,11 @@ void __init ath79_wmac_set_ext_lna_gpio(
+@@ -395,6 +395,11 @@ void __init ath79_wmac_set_ext_lna_gpio(
ar934x_set_ext_lna_gpio(chain, gpio);
}
diff --git a/target/linux/ar71xx/patches-4.4/640-MIPS-ath79-add-QCA955x-wmac-reset.patch b/target/linux/ar71xx/patches-4.4/640-MIPS-ath79-add-QCA955x-wmac-reset.patch
index 8aa5957a7152af27854f6f7c197120b8029cf9e8..b59e43c7712a18e5e81944361c358dfb08c488ea 100644
--- a/target/linux/ar71xx/patches-4.4/640-MIPS-ath79-add-QCA955x-wmac-reset.patch
+++ b/target/linux/ar71xx/patches-4.4/640-MIPS-ath79-add-QCA955x-wmac-reset.patch
@@ -32,7 +32,7 @@
*/
--- a/arch/mips/ath79/dev-wmac.c
+++ b/arch/mips/ath79/dev-wmac.c
-@@ -171,6 +171,27 @@ static void qca953x_wmac_setup(void)
+@@ -166,6 +166,27 @@ static void qca953x_wmac_setup(void)
ath79_wmac_data.get_mac_revision = ar93xx_get_soc_revision;
}
@@ -60,7 +60,7 @@
static void qca955x_wmac_setup(void)
{
u32 t;
-@@ -187,6 +208,8 @@ static void qca955x_wmac_setup(void)
+@@ -182,6 +203,8 @@ static void qca955x_wmac_setup(void)
ath79_wmac_data.is_clk_25mhz = false;
else
ath79_wmac_data.is_clk_25mhz = true;
From: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Date: Fri, 19 Jan 2018 12:58:40 +0100
Subject: ar71xx: Add TP-Link Pharos v2 board detection
Add support for detecting TP-Link Pharos v2 boards.
They use different format in product-info partition than v1 boards.
Code was written mostly by Alexander Couzens <lynxis@fe80.eu>
Signed-off-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Origin: backport, https://github.com/openwrt/openwrt/commit/2524febf7927a1bf430d64b7790feb126023e3d1
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index b365b6ae4aa6021960499b3889d846b5171eec0f..94311f75989b0861e188dc89b3e714b5545c1ad8 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -375,7 +375,7 @@ tplink_pharos_get_model_string() {
}
tplink_pharos_board_detect() {
- local model_string="$(tplink_pharos_get_model_string | tr -d '\r')"
+ local model_string="$1"
local oIFS="$IFS"; IFS=":"; set -- $model_string; IFS="$oIFS"
local model="${1%%\(*}"
@@ -396,6 +396,14 @@ gl_inet_board_detect() {
esac
}
+tplink_pharos_v2_get_model_string() {
+ local part
+ part=$(find_mtd_part 'product-info')
+ [ -z "$part" ] && return 1
+
+ dd if=$part bs=1 skip=4360 count=64 2>/dev/null | tr -d '\r\0' | head -n 1
+}
+
ar71xx_board_detect() {
local machine
local name
@@ -546,11 +554,15 @@ ar71xx_board_detect() {
;;
*"CPE210/220")
name="cpe210"
- tplink_pharos_board_detect
+ tplink_pharos_board_detect "$(tplink_pharos_get_model_string | tr -d '\r')"
+ ;;
+ *"CPE210 v2")
+ name="cpe210-v2"
+ tplink_pharos_board_detect "$(tplink_pharos_v2_get_model_string)"
;;
*"CPE510/520")
name="cpe510"
- tplink_pharos_board_detect
+ tplink_pharos_board_detect "$(tplink_pharos_get_model_string | tr -d '\r')"
;;
*CPE830)
name="cpe830"
@@ -560,11 +572,11 @@ ar71xx_board_detect() {
;;
*WBS210)
name="wbs210"
- tplink_pharos_board_detect
+ tplink_pharos_board_detect "$(tplink_pharos_get_model_string | tr -d '\r')"
;;
*WBS510)
name="wbs510"
- tplink_pharos_board_detect
+ tplink_pharos_board_detect "$(tplink_pharos_get_model_string | tr -d '\r')"
;;
*CR3000)
name="cr3000"
@@ -641,7 +653,7 @@ ar71xx_board_detect() {
;;
*"EAP120")
name="eap120"
- tplink_pharos_board_detect
+ tplink_pharos_board_detect "$(tplink_pharos_get_model_string | tr -d '\r')"
;;
*"EAP300 v2")
name="eap300v2"
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 0b422d71c2639a31bc7e88a20976266b66ec4490..9bc49c41a6308b732e45a7ae35c851133c367254 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -97,10 +97,11 @@ tplink_pharos_check_support_list() {
local image="$1"
local offset="$2"
local model="$3"
+ local trargs="$4"
# Here $image is given to dd directly instead of using get_image;
# otherwise the skip will take almost a second (as dd can't seek)
- dd if="$image" bs=1 skip=$offset count=1024 2>/dev/null | (
+ dd if="$image" bs=1 skip=$offset count=1024 2>/dev/null | tr -d "$trargs" | (
while IFS= read -r line; do
[ "$line" = "$model" ] && exit 0
done
@@ -110,17 +111,19 @@ tplink_pharos_check_support_list() {
}
tplink_pharos_check_image() {
- local magic_long="$(get_magic_long "$1")"
- [ "$magic_long" != "7f454c46" ] && {
- echo "Invalid image magic '$magic_long'"
+ local image_magic="$(get_magic_long "$1")"
+ local board_magic="$2"
+ [ "$image_magic" != "$board_magic" ] && {
+ echo "Invalid image magic '$image_magic'. Expected '$board_magic'."
return 1
}
- local model_string="$(tplink_pharos_get_model_string)"
+ local model_string="$3"
+ local trargs="$4"
# New images have the support list at 7802888, old ones at 1511432
- tplink_pharos_check_support_list "$1" 7802888 "$model_string" || \
- tplink_pharos_check_support_list "$1" 1511432 "$model_string" || {
+ tplink_pharos_check_support_list "$1" 7802888 "$model_string" "$trargs" || \
+ tplink_pharos_check_support_list "$1" 1511432 "$model_string" "$trargs" || {
echo "Unsupported image (model not in support-list)"
return 1
}
@@ -507,7 +510,11 @@ platform_check_image() {
eap120|\
wbs210|\
wbs510)
- tplink_pharos_check_image "$1" && return 0
+ tplink_pharos_check_image "$1" "7f454c46" "$(tplink_pharos_get_model_string)" '' && return 0
+ return 1
+ ;;
+ cpe210-v2)
+ tplink_pharos_check_image "$1" "01000000" "$(tplink_pharos_v2_get_model_string)" '\0\xff\r' && return 0
return 1
;;
a40|\
From: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Date: Fri, 19 Jan 2018 14:45:42 +0100
Subject: ar71xx: Add support for TP-Link CPE210 v2
This PR adds support for a popular low-cost 2.4GHz N based AP
Specifications:
- SoC: Qualcomm Atheros QCA9533 (650MHz)
- RAM: 64MB
- Storage: 8 MB SPI NOR
- Wireless: 2.4GHz N based built into SoC 2x2
- Ethernet: 1x 100/10 Mbps, integrated into SoC, 24V POE IN
Installation:
Flash factory image through stock firmware WEB UI
or through TFTP
To get to TFTP recovery just hold reset button while powering on for
around 4-5 seconds and release.
Rename factory image to recovery.bin
Stock TFTP server IP:192.168.0.100
Stock device TFTP adress:192.168.0.254
Notes:
TP-Link does not use bootstrap registers so without this patch reference
clock detects as 40MHz while it is actually 25MHz.
This is due to messed up bootstrap resistor configuration on the PCB.
Provided GPL code just forces 25MHz reference clock.
That causes booting with completely wrong clocks, for example, CPU tries
to boot at 1040MHz while the stock is 650MHz.
So this PR depends on PR #672 to remove 40MHz reference clock.
Thanks to Sven Eckelmann <sven@narfation.org> for properly patching that.
Signed-off-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Origin: backport, https://github.com/openwrt/openwrt/commit/5c5bf8b8658a588423f6ec445d7ef6a36f99a396
diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds
index a742854bc9b0aa48c61b37e58288177bbb56d14d..54046dffc9a4d4ad0216dcda32bf98ee5d38b569 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -187,16 +187,25 @@ cf-e530n)
ucidef_set_led_netdev "wan" "WAN" "$board:blue:wan" "eth1"
;;
cpe210|\
+cpe210-v2|\
cpe510|\
wbs210|\
wbs510)
- ucidef_set_led_switch "lan0" "LAN0" "tp-link:green:lan0" "switch0" "0x20"
- ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"
ucidef_set_rssimon "wlan0" "200000" "1"
ucidef_set_led_rssi "rssilow" "RSSILOW" "tp-link:green:link1" "wlan0" "1" "100" "0" "13"
ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "tp-link:green:link2" "wlan0" "26" "100" "-25" "13"
ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "tp-link:green:link3" "wlan0" "51" "100" "-50" "13"
ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "76" "100" "-75" "13"
+
+ case "$board" in
+ cpe210-v2)
+ ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan0" "eth0"
+ ;;
+ *)
+ ucidef_set_led_switch "lan0" "LAN0" "tp-link:green:lan0" "switch0" "0x20"
+ ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"
+ ;;
+ esac
;;
cr3000)
ucidef_set_led_netdev "wan" "WAN" "pcs:blue:wan" "eth1"
diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network
index 875a1a38ada9fb66503505d2f094310db1295a07..633d4e1b7415983f44164187ad3696311ec25621 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -67,6 +67,7 @@ ar71xx_setup_interfaces()
cap4200ag|\
cf-e380ac-v1|\
cf-e380ac-v2|\
+ cpe210-v2|\
eap120|\
eap300v2|\
eap7660d|\
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
index 2449a8d6bce17f0a703d8fc4f82dd38e1f861ae3..35532d86ac3ad32630592c79477c79783af4addb 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
@@ -1301,6 +1301,7 @@ config ATH79_MACH_ARCHER_C7
config ATH79_MACH_CPE510
bool "TP-LINK CPE510 support"
select SOC_AR934X
+ select SOC_QCA953X
select ATH79_DEV_ETH
select ATH79_DEV_GPIO_BUTTONS
select ATH79_DEV_LEDS_GPIO
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
index d2dbed1fe286c44d3188262e984253faaee7edba..ceb1769ddd522d51014228fe65e2662f2f3e627c 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
@@ -1,7 +1,8 @@
/*
- * TP-LINK CPE210/220/510/520 board support
+ * TP-LINK CPE210/210 v2/220/510/520 board support
*
* Copyright (C) 2014 Matthias Schiffer <mschiffer@universe-factory.net>
+ * Copyright (C) 2017 Robert Marko <robimarko@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
@@ -41,6 +42,8 @@
#define CPE510_KEYS_POLL_INTERVAL 20 /* msecs */
#define CPE510_KEYS_DEBOUNCE_INTERVAL (3 * CPE510_KEYS_POLL_INTERVAL)
+/* CPE210 v2 reset GPIO */
+#define CPE210_V2_GPIO_BTN_RESET 17
static struct gpio_led cpe510_leds_gpio[] __initdata = {
{
@@ -98,6 +101,30 @@ static struct gpio_led wbs510_leds_gpio[] __initdata = {
},
};
+static struct gpio_led cpe210_v2_leds_gpio[] __initdata = {
+ {
+ .name = "tp-link:green:lan0",
+ .gpio = CPE510_GPIO_LED_LAN0,
+ .active_low = 1,
+ }, {
+ .name = "tp-link:green:link1",
+ .gpio = CPE510_GPIO_LED_L1,
+ .active_low = 1,
+ }, {
+ .name = "tp-link:green:link2",
+ .gpio = CPE510_GPIO_LED_L2,
+ .active_low = 1,
+ }, {
+ .name = "tp-link:green:link3",
+ .gpio = CPE510_GPIO_LED_L3,
+ .active_low = 1,
+ }, {
+ .name = "tp-link:green:link4",
+ .gpio = CPE510_GPIO_LED_L4,
+ .active_low = 1,
+ },
+};
+
static struct gpio_keys_button cpe510_gpio_keys[] __initdata = {
{
.desc = "Reset button",
@@ -109,6 +136,17 @@ static struct gpio_keys_button cpe510_gpio_keys[] __initdata = {
}
};
+static struct gpio_keys_button cpe210_v2_gpio_keys[] __initdata = {
+ {
+ .desc = "Reset button",
+ .type = EV_KEY,
+ .code = KEY_RESTART,
+ .debounce_interval = CPE510_KEYS_DEBOUNCE_INTERVAL,
+ .gpio = CPE210_V2_GPIO_BTN_RESET,
+ .active_low = 1,
+ }
+};
+
static void __init cpe_setup(u8 *mac)
{
/* Disable JTAG, enabling GPIOs 0-3 */
@@ -171,9 +209,33 @@ static void __init wbs_setup(void)
ath79_register_wmac(ee, mac);
}
+static void __init cpe210_v2_setup(void)
+{
+ u8 *mac = (u8 *) KSEG1ADDR(0x1f830008);
+ u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
+
+ ath79_register_leds_gpio(-1, ARRAY_SIZE(cpe210_v2_leds_gpio),
+ cpe210_v2_leds_gpio);
+ ath79_register_gpio_keys_polled(-1, CPE510_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(cpe210_v2_gpio_keys),
+ cpe210_v2_gpio_keys);
+ ath79_register_m25p80(NULL);
+ ath79_register_mdio(0, 0x0);
+ ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
+ ath79_eth0_data.duplex = DUPLEX_FULL;
+ ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
+ ath79_eth0_data.speed = SPEED_100;
+ ath79_eth0_data.phy_mask = BIT(4);
+ ath79_register_eth(0);
+ ath79_register_wmac(ee, mac);
+}
+
MIPS_MACHINE(ATH79_MACH_CPE210, "CPE210", "TP-LINK CPE210/220",
cpe210_setup);
+MIPS_MACHINE(ATH79_MACH_CPE210_V2, "CPE210V2", "TP-LINK CPE210 v2",
+ cpe210_v2_setup);
+
MIPS_MACHINE(ATH79_MACH_CPE510, "CPE510", "TP-LINK CPE510/520",
cpe510_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
index a4c7f52fe94e17bc48bebfb460f12f3e5ac35afe..e7e7f94775a3122286dc39447f04b42f4863f313 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
+++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
@@ -64,7 +64,8 @@ enum ath79_mach_type {
ATH79_MACH_CF_E380AC_V2, /* COMFAST CF-E380AC v2 */
ATH79_MACH_CF_E520N, /* COMFAST CF-E520N */
ATH79_MACH_CF_E530N, /* COMFAST CF-E530N */
- ATH79_MACH_CPE210, /* TP-LINK CPE210 */
+ ATH79_MACH_CPE210, /* TP-LINK CPE210 v1 */
+ ATH79_MACH_CPE210_V2, /* TP-LINK CPE210 v2 */
ATH79_MACH_CPE510, /* TP-LINK CPE510 */
ATH79_MACH_CPE830, /* YunCore CPE830 */
ATH79_MACH_CPE870, /* YunCore CPE870 */
diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk
index 6a3faef518ebfa4f36d3074ee9c102b801e04275..b61ef6dc78918dd8d040c0f2bfb6451e5e13ba92 100644
--- a/target/linux/ar71xx/image/tp-link.mk
+++ b/target/linux/ar71xx/image/tp-link.mk
@@ -164,22 +164,26 @@ define Device/archer-c60-v1
endef
TARGET_DEVICES += archer-c60-v1
-define Device/cpe510-520
- DEVICE_TITLE := TP-LINK CPE510/520
+define Device/cpexxx
DEVICE_PACKAGES := rssileds
MTDPARTS := spi0.0:128k(u-boot)ro,64k(partition-table)ro,64k(product-info)ro,1792k(kernel),5888k(rootfs),192k(config)ro,64k(ART)ro,7680k@0x40000(firmware)
IMAGE_SIZE := 7680k
- BOARDNAME := CPE510
- TPLINK_BOARD_NAME := CPE510
DEVICE_PROFILE := CPE510
LOADER_TYPE := elf
+ IMAGES := sysupgrade.bin factory.bin
+ IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade
+ IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
+endef
+
+define Device/cpe510-520
+ $(Device/cpexxx)
+ DEVICE_TITLE := TP-LINK CPE510/520 v1
+ BOARDNAME := CPE510
+ TPLINK_BOARD_NAME := CPE510
LOADER_FLASH_OFFS := 0x43000
COMPILE := loader-$(1).elf
COMPILE/loader-$(1).elf := loader-okli-compile
KERNEL := kernel-bin | lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) 12288
- IMAGES := sysupgrade.bin factory.bin
- IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade
- IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
endef
define Device/cpe210-220
@@ -190,6 +194,19 @@ $(Device/cpe510-520)
TPLINK_BOARD_NAME := CPE210
endef
+define Device/cpe210-v2
+ $(Device/cpexxx)
+ DEVICE_TITLE := TP-LINK CPE210 v2
+ BOARDNAME := CPE210V2
+ TPLINK_BOARD_NAME := CPE210V2
+ KERNEL := kernel-bin | patch-cmdline | lzma | mktplinkfw-combined
+ TPLINK_HWID := 0x0
+ TPLINK_HWREV := 0
+ TPLINK_HEADER_VERSION := 1
+ TPLINK_FLASHLAYOUT := 8Mlzma
+endef
+TARGET_DEVICES += cpe210-v2
+
define Device/wbs210
$(Device/cpe510-520)
DEVICE_TITLE := TP-LINK WBS210
diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c
index 23b69f3bd0eb66aca650eb2ffd7d5cd2a7cb5194..e6ecc5b2c52c1627c8b998fa731b50ed39649f96 100644
--- a/tools/firmware-utils/src/tplink-safeloader.c
+++ b/tools/firmware-utils/src/tplink-safeloader.c
@@ -154,6 +154,48 @@ static struct device_info boards[] = {
.last_sysupgrade_partition = "support-list",
},
+ /** Firmware layout for the CPE210 V2 */
+ {
+ .id = "CPE210V2",
+ .vendor = "CPE210(TP-LINK|UN|N300-2|00000000):2.0\r\n",
+ .support_list =
+ "SupportList:\r\n"
+ "CPE210(TP-LINK|EU|N300-2|00000000):2.0\r\n"
+ "CPE210(TP-LINK|EU|N300-2|45550000):2.0\r\n"
+ "CPE210(TP-LINK|EU|N300-2|55530000):2.0\r\n"
+ "CPE210(TP-LINK|UN|N300-2|00000000):2.0\r\n"
+ "CPE210(TP-LINK|UN|N300-2|45550000):2.0\r\n"
+ "CPE210(TP-LINK|UN|N300-2|55530000):2.0\r\n"
+ "CPE210(TP-LINK|US|N300-2|55530000):2.0\r\n"
+ "CPE210(TP-LINK|UN|N300-2):2.0\r\n"
+ "CPE210(TP-LINK|EU|N300-2):2.0\r\n"
+ "CPE210(TP-LINK|US|N300-2):2.0\r\n",
+ .support_trail = '\xff',
+ .soft_ver = NULL,
+
+ .partitions = {
+ {"fs-uboot", 0x00000, 0x20000},
+ {"partition-table", 0x20000, 0x02000},
+ {"default-mac", 0x30000, 0x00020},
+ {"product-info", 0x31100, 0x00100},
+ {"device-info", 0x31400, 0x00400},
+ {"signature", 0x32000, 0x00400},
+ {"device-id", 0x33000, 0x00100},
+ {"os-image", 0x40000, 0x1c0000},
+ {"file-system", 0x200000, 0x5b0000},
+ {"soft-version", 0x7b0000, 0x00100},
+ {"support-list", 0x7b1000, 0x01000},
+ {"user-config", 0x7c0000, 0x10000},
+ {"default-config", 0x7d0000, 0x10000},
+ {"log", 0x7e0000, 0x10000},
+ {"radio", 0x7f0000, 0x10000},
+ {NULL, 0, 0}
+ },
+
+ .first_sysupgrade_partition = "os-image",
+ .last_sysupgrade_partition = "support-list",
+ },
+
/** Firmware layout for the CPE510/520 */
{
.id = "CPE510",