aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/image/common-tp-link.mk
diff options
context:
space:
mode:
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-01-29 18:21:53 +0100
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-02-01 19:35:35 +0100
commit3227afbbabf06ac68a27bb5ad68c1928a06c4203 (patch)
tree7ea68d1ef941db82d3b85248349e99399e0a576c /target/linux/ramips/image/common-tp-link.mk
parentffbb8ed5a265930f9c20af826040f9d41e145c15 (diff)
downloadupstream-3227afbbabf06ac68a27bb5ad68c1928a06c4203.tar.gz
upstream-3227afbbabf06ac68a27bb5ad68c1928a06c4203.tar.bz2
upstream-3227afbbabf06ac68a27bb5ad68c1928a06c4203.zip
ramips: collect and harmonize TP-Link image variants in common file
This moves the various variants of common device definitions for TP-Link devices to a common Makefile common-tp-link.mk. This provides the opportunity to reorganize and move parameters between individual device definitions and the common ones. While at it, also use the common definitions for previously independent definitions where appropriate. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'target/linux/ramips/image/common-tp-link.mk')
-rw-r--r--target/linux/ramips/image/common-tp-link.mk44
1 files changed, 44 insertions, 0 deletions
diff --git a/target/linux/ramips/image/common-tp-link.mk b/target/linux/ramips/image/common-tp-link.mk
new file mode 100644
index 0000000000..587ef89fc1
--- /dev/null
+++ b/target/linux/ramips/image/common-tp-link.mk
@@ -0,0 +1,44 @@
+DEVICE_VARS += TPLINK_FLASHLAYOUT TPLINK_HWID TPLINK_HWREV TPLINK_HWREVADD
+DEVICE_VARS += TPLINK_HVERSION TPLINK_BOARD_ID TPLINK_HEADER_VERSION
+
+define Device/tplink-v1
+ DEVICE_VENDOR := TP-Link
+ TPLINK_FLASHLAYOUT :=
+ TPLINK_HWID :=
+ TPLINK_HWREV := 0x1
+ TPLINK_HEADER_VERSION := 1
+ KERNEL := $(KERNEL_DTB)
+ KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-v1-header -e -O
+ IMAGES += factory.bin
+ IMAGE/factory.bin := tplink-v1-image factory -e -O
+ IMAGE/sysupgrade.bin := tplink-v1-image sysupgrade -e -O | append-metadata | \
+ check-size $$$$(IMAGE_SIZE)
+endef
+
+define Device/tplink-v2
+ DEVICE_VENDOR := TP-Link
+ TPLINK_FLASHLAYOUT :=
+ TPLINK_HWID :=
+ TPLINK_HWREV := 0x1
+ TPLINK_HWREVADD := 0x0
+ TPLINK_HVERSION := 3
+ KERNEL := $(KERNEL_DTB)
+ KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-v2-header -e
+ IMAGES += factory.bin
+ IMAGE/factory.bin := tplink-v2-image -e
+ IMAGE/sysupgrade.bin := tplink-v2-image -s -e | append-metadata | \
+ check-size $$$$(IMAGE_SIZE)
+endef
+
+define Device/tplink-safeloader
+ DEVICE_VENDOR := TP-Link
+ TPLINK_BOARD_ID :=
+ TPLINK_HWID := 0x0
+ TPLINK_HWREV := 0x0
+ TPLINK_HEADER_VERSION := 1
+ KERNEL := $(KERNEL_DTB) | tplink-v1-header -e -O
+ IMAGES += factory.bin
+ IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | \
+ append-metadata | check-size $$$$(IMAGE_SIZE)
+ IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
+endef