ath79: Move TPLink WPA8630Pv2 to ath79-tiny target
authorJoe Mullally <jwmullally@gmail.com>
Mon, 30 Aug 2021 21:35:05 +0000 (22:35 +0100)
committerPetr Štetiar <ynezz@true.cz>
Sat, 16 Apr 2022 12:59:34 +0000 (14:59 +0200)
These devices only have 6MiB available for firmware, which is not
enough for recent release images, so move these to the tiny target.

Note for users sysupgrading from the previous ath79-generic snapshot
images:

The tiny target kernel has a 4Kb flash erase block size instead
of the generic target's 64kb. This means the JFFS2 overlay partition
containing settings must be reformatted with the new block size or else
there will be data corruption.

To do this, backup your settings before upgrading, then during the
sysupgrade, de-select "Keep Settings". On the CLI, use "sysupgrade -n".

If you forget to do this and your system becomes unstable after
upgrading, you can do this to format the partition and recover:

* Reboot
* Press RESET when Power LED blinks during boot to enter Failsafe mode
* SSH to 192.168.1.1
* Run "firstboot" and reboot

Signed-off-by: Joe Mullally <jwmullally@gmail.com>
Tested-by: Robert Högberg <robert.hogberg@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [commit message facelift]
(cherry picked from commit 44e1e5d)
Signed-off-by: Petr Štetiar <ynezz@true.cz>
target/linux/ath79/generic/base-files/etc/board.d/01_leds
target/linux/ath79/generic/base-files/etc/board.d/02_network
target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
target/linux/ath79/image/generic-tp-link.mk
target/linux/ath79/image/tiny-tp-link.mk
target/linux/ath79/tiny/base-files/etc/board.d/01_leds
target/linux/ath79/tiny/base-files/etc/board.d/02_network
target/linux/ath79/tiny/base-files/etc/board.d/05_compat-version [new file with mode: 0755]
target/linux/ath79/tiny/base-files/etc/hotplug.d/firmware/11-ath10k-caldata [new file with mode: 0644]

index b6c68db813df8f5d24d2720e9cbe180408f92c91..146470855d4ca04258d69e33933730f526e39e44 100755 (executable)
@@ -348,10 +348,7 @@ tplink,tl-mr6400-v1)
        ucidef_set_led_netdev "wan" "WAN" "white:wan" "eth1"
        ucidef_set_led_netdev "4g" "4G" "white:4g" "usb0"
        ;;
-tplink,tl-wpa8630-v1|\
-tplink,tl-wpa8630p-v2-int|\
-tplink,tl-wpa8630p-v2.0-eu|\
-tplink,tl-wpa8630p-v2.1-eu)
+tplink,tl-wpa8630-v1)
        ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x3c"
        ;;
 tplink,tl-wr842n-v2)
index 5bf78117e1c7148fb21ea8c06dcd2d14a156b7f0..b01dfa41d1d43e55abfb92ac84ffad01766460e2 100755 (executable)
@@ -382,10 +382,7 @@ ath79_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "0@eth0" "1:lan:1" "2:lan:3" "3:lan:2"
                ;;
-       tplink,tl-wpa8630-v1|\
-       tplink,tl-wpa8630p-v2-int|\
-       tplink,tl-wpa8630p-v2.0-eu|\
-       tplink,tl-wpa8630p-v2.1-eu)
+       tplink,tl-wpa8630-v1)
                # port 5 (internal) is the power-line port
                ucidef_add_switch "switch0" \
                        "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:lan:4"
index c562fa7c748ccb7c9cbb56969c74efa2107c08a7..c7dbaafac1056916db79322555c1d3bd63ee20b0 100644 (file)
@@ -228,10 +228,7 @@ case "$FIRMWARE" in
                ;;
        tplink,eap225-outdoor-v1|\
        tplink,eap225-v3|\
-       tplink,eap225-wall-v2|\
-       tplink,tl-wpa8630p-v2-int|\
-       tplink,tl-wpa8630p-v2.0-eu|\
-       tplink,tl-wpa8630p-v2.1-eu)
+       tplink,eap225-wall-v2)
                caldata_extract "art" 0x5000 0x2f20
                ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) +1)
                ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
index eeca02ce88810c6dcda8cf4779cb00b25e904c3f..fceebdaaf336f673a397eec7e79f6b479ca4092a 100644 (file)
@@ -587,36 +587,6 @@ define Device/tplink_tl-wpa8630-v1
 endef
 TARGET_DEVICES += tplink_tl-wpa8630-v1
 
-define Device/tplink_tl-wpa8630p-v2
-  $(Device/tplink-safeloader)
-  SOC := qca9563
-  DEVICE_MODEL := TL-WPA8630P
-  IMAGE_SIZE := 6016k
-  DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct
-endef
-
-define Device/tplink_tl-wpa8630p-v2-int
-  $(Device/tplink_tl-wpa8630p-v2)
-  DEVICE_VARIANT := v2 (Int.)
-  TPLINK_BOARD_ID := TL-WPA8630P-V2-INT
-endef
-TARGET_DEVICES += tplink_tl-wpa8630p-v2-int
-
-define Device/tplink_tl-wpa8630p-v2.0-eu
-  $(Device/tplink_tl-wpa8630p-v2)
-  DEVICE_VARIANT := v2.0 (EU)
-  TPLINK_BOARD_ID := TL-WPA8630P-V2.0-EU
-  SUPPORTED_DEVICES += tplink,tl-wpa8630p-v2-eu
-endef
-TARGET_DEVICES += tplink_tl-wpa8630p-v2.0-eu
-
-define Device/tplink_tl-wpa8630p-v2.1-eu
-  $(Device/tplink_tl-wpa8630p-v2)
-  DEVICE_VARIANT := v2.1 (EU)
-  TPLINK_BOARD_ID := TL-WPA8630P-V2.1-EU
-endef
-TARGET_DEVICES += tplink_tl-wpa8630p-v2.1-eu
-
 define Device/tplink_tl-wr1043nd-v1
   $(Device/tplink-8m)
   SOC := ar9132
index c918c6baa682e78b2b1c204fb9a55dc0a5aef1e7..2110f08b524822aa8ce507fa466032c4a7fc8a4c 100644 (file)
@@ -223,6 +223,41 @@ define Device/tplink_tl-wa901nd-v5
 endef
 TARGET_DEVICES += tplink_tl-wa901nd-v5
 
+define Device/tplink_tl-wpa8630p-v2
+  $(Device/tplink-safeloader)
+  SOC := qca9563
+  DEVICE_MODEL := TL-WPA8630P
+  IMAGE_SIZE := 6016k
+  DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct
+  DEVICE_COMPAT_VERSION := 2.0
+  DEVICE_COMPAT_MESSAGE := The flash erase blocksize has changed to 4k from the 64k in previous versions, \
+    so the JFFS2 settings partition MUST be reformatted to avoid data corruption. \
+    Backup your settings before upgrading, then during sysupgrade, \
+    de-select "Keep settings" and select "Force" to continue (equivilant to "sysupgrade -n -F").
+endef
+
+define Device/tplink_tl-wpa8630p-v2-int
+  $(Device/tplink_tl-wpa8630p-v2)
+  DEVICE_VARIANT := v2 (Int.)
+  TPLINK_BOARD_ID := TL-WPA8630P-V2-INT
+endef
+TARGET_DEVICES += tplink_tl-wpa8630p-v2-int
+
+define Device/tplink_tl-wpa8630p-v2.0-eu
+  $(Device/tplink_tl-wpa8630p-v2)
+  DEVICE_VARIANT := v2.0 (EU)
+  TPLINK_BOARD_ID := TL-WPA8630P-V2.0-EU
+  SUPPORTED_DEVICES += tplink,tl-wpa8630p-v2-eu
+endef
+TARGET_DEVICES += tplink_tl-wpa8630p-v2.0-eu
+
+define Device/tplink_tl-wpa8630p-v2.1-eu
+  $(Device/tplink_tl-wpa8630p-v2)
+  DEVICE_VARIANT := v2.1 (EU)
+  TPLINK_BOARD_ID := TL-WPA8630P-V2.1-EU
+endef
+TARGET_DEVICES += tplink_tl-wpa8630p-v2.1-eu
+
 define Device/tplink_tl-wr703n
   $(Device/tplink-4mlzma)
   SOC := ar9331
index f0b4acf0662ee0df824ca36f20fcfb889e730fef..aeac6e60e14a6348824054e61f799375ce93fed8 100755 (executable)
@@ -94,6 +94,11 @@ tplink,tl-wa850re-v2)
        ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "blue:signal4" "wlan0" "60" "100"
        ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "blue:signal5" "wlan0" "80" "100"
        ;;
+tplink,tl-wpa8630p-v2-int|\
+tplink,tl-wpa8630p-v2.0-eu|\
+tplink,tl-wpa8630p-v2.1-eu)
+       ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x3c"
+       ;;
 tplink,tl-wr940n-v3|\
 tplink,tl-wr940n-v4|\
 tplink,tl-wr941nd-v6)
index cca63520237ba21ef611b398fc983b361a2590e8..037c99deb27291f98762788fc0f2368faddad55c 100755 (executable)
@@ -83,6 +83,13 @@ ath79_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
                ;;
+       tplink,tl-wpa8630p-v2-int|\
+       tplink,tl-wpa8630p-v2.0-eu|\
+       tplink,tl-wpa8630p-v2.1-eu)
+               # port 5 (internal) is the power-line port
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:lan:4"
+               ;;
        tplink,tl-wr941-v2)
                ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
                ;;
diff --git a/target/linux/ath79/tiny/base-files/etc/board.d/05_compat-version b/target/linux/ath79/tiny/base-files/etc/board.d/05_compat-version
new file mode 100755 (executable)
index 0000000..b9ba3b9
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/sh
+#
+# Copyright (C) 2020 OpenWrt.org
+#
+
+. /lib/functions.sh
+. /lib/functions/uci-defaults.sh
+
+board_config_update
+
+case "$(board_name)" in
+       tplink,tl-wpa8630p-v2-int|\
+       tplink,tl-wpa8630p-v2.0-eu|\
+       tplink,tl-wpa8630p-v2.1-eu)
+               ucidef_set_compat_version "2.0"
+               ;;
+esac
+
+board_config_flush
+
+exit 0
diff --git a/target/linux/ath79/tiny/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/tiny/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
new file mode 100644 (file)
index 0000000..8e3e142
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+[ -e /lib/firmware/$FIRMWARE ] && exit 0
+
+. /lib/functions/caldata.sh
+
+board=$(board_name)
+
+case "$FIRMWARE" in
+"ath10k/pre-cal-pci-0000:00:00.0.bin")
+       case $board in
+       tplink,tl-wpa8630p-v2-int|\
+       tplink,tl-wpa8630p-v2.0-eu|\
+       tplink,tl-wpa8630p-v2.1-eu)
+               caldata_extract "art" 0x5000 0x2f20
+               ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) 1)
+               ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
+                       /lib/firmware/ath10k/QCA9888/hw2.0/board.bin
+               ;;
+       esac
+       ;;
+*)
+       exit 1
+       ;;
+esac