aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips
diff options
context:
space:
mode:
authorThibaut VARÈNE <hacks@slashdirt.org>2017-10-03 12:46:09 +0200
committerMathias Kresin <dev@kresin.me>2017-10-06 08:28:41 +0200
commit254061ee97b9511f0d8981e3ea43406119e35ce4 (patch)
tree9b3755718b5269f2874362cde4ac0488f78e1e9b /target/linux/ramips
parent90805b16b6d17dff861d456edf829858386ec559 (diff)
downloadupstream-254061ee97b9511f0d8981e3ea43406119e35ce4.tar.gz
upstream-254061ee97b9511f0d8981e3ea43406119e35ce4.tar.bz2
upstream-254061ee97b9511f0d8981e3ea43406119e35ce4.zip
build: add mktplinkfw2 hardcoded values to makefile
This patch adds all the board-specific values currently hardcoded in mktplinkfw2.c back to the respective device declarations in the makefiles. The rationale is to avoid modifying the source code every time a new board or board variant is added. Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
Diffstat (limited to 'target/linux/ramips')
-rw-r--r--target/linux/ramips/image/mt7620.mk31
-rw-r--r--target/linux/ramips/image/mt76x8.mk16
2 files changed, 32 insertions, 15 deletions
diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index f964b3e082..8a7eaf4ae6 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -2,7 +2,7 @@
# MT7620A Profiles
#
-DEVICE_VARS += TPLINK_BOARD_ID
+DEVICE_VARS += TPLINK_FLASHLAYOUT TPLINK_HWID TPLINK_HWREV TPLINK_HWREVADD TPLINK_HVERSION
define Build/elecom-header
cp $@ $(KDIR)/v_0.0.0.bin
@@ -26,17 +26,22 @@ endef
TARGET_DEVICES += ai-br100
define Device/Archer
+ TPLINK_HWREVADD := 0
+ TPLINK_HVERSION := 3
KERNEL := $(KERNEL_DTB)
- KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-v2-header
- IMAGE/factory.bin := tplink-v2-image
- IMAGE/sysupgrade.bin := tplink-v2-image -s | append-metadata
+ KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-v2-header -e
+ IMAGE/factory.bin := tplink-v2-image -e
+ IMAGE/sysupgrade.bin := tplink-v2-image -s -e | append-metadata
endef
define Device/ArcherC20
$(Device/Archer)
DTS := ArcherC20
SUPPORTED_DEVICES := c20
- TPLINK_BOARD_ID := ArcherC20
+ TPLINK_FLASHLAYOUT := 8Mmtk
+ TPLINK_HWID := 0xc2000001
+ TPLINK_HWREV := 0x44
+ TPLINK_HWREVADD := 0x1
IMAGES += factory.bin
DEVICE_TITLE := TP-Link ArcherC20
DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
@@ -47,7 +52,9 @@ define Device/ArcherC20i
$(Device/Archer)
DTS := ArcherC20i
SUPPORTED_DEVICES := c20i
- TPLINK_BOARD_ID := ArcherC20i
+ TPLINK_FLASHLAYOUT := 8Mmtk
+ TPLINK_HWID := 0xc2000001
+ TPLINK_HWREV := 58
IMAGES += factory.bin
DEVICE_TITLE := TP-Link ArcherC20i
endef
@@ -57,10 +64,12 @@ define Device/ArcherC50v1
$(Device/Archer)
DTS := ArcherC50
SUPPORTED_DEVICES := c50
- TPLINK_BOARD_ID := ArcherC50
+ TPLINK_FLASHLAYOUT := 8Mmtk
+ TPLINK_HWID := 0xc7500001
+ TPLINK_HWREV := 69
IMAGES += factory-us.bin factory-eu.bin
- IMAGE/factory-us.bin := tplink-v2-image -w 0
- IMAGE/factory-eu.bin := tplink-v2-image -w 2
+ IMAGE/factory-us.bin := tplink-v2-image -e -w 0
+ IMAGE/factory-eu.bin := tplink-v2-image -e -w 2
DEVICE_TITLE := TP-Link ArcherC50v1
endef
TARGET_DEVICES += ArcherC50v1
@@ -69,7 +78,9 @@ define Device/ArcherMR200
$(Device/Archer)
DTS := ArcherMR200
SUPPORTED_DEVICES := mr200
- TPLINK_BOARD_ID := ArcherMR200
+ TPLINK_FLASHLAYOUT := 8MLmtk
+ TPLINK_HWID := 0xd7500001
+ TPLINK_HWREV := 0x4a
DEVICE_PACKAGES := kmod-usb2 kmod-usb-net kmod-usb-net-rndis kmod-usb-serial kmod-usb-serial-option adb-enablemodem
DEVICE_TITLE := TP-Link ArcherMR200
endef
diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk
index f4b3171a0b..db32684f7d 100644
--- a/target/linux/ramips/image/mt76x8.mk
+++ b/target/linux/ramips/image/mt76x8.mk
@@ -2,7 +2,7 @@
# MT76x8 Profiles
#
-DEVICE_VARS += TPLINK_BOARD_ID
+DEVICE_VARS += TPLINK_FLASHLAYOUT TPLINK_HWID TPLINK_HWREV TPLINK_HWREVADD TPLINK_HVERSION
define Device/duzun-dm06
DTS := DUZUN-DM06
@@ -85,12 +85,16 @@ define Device/tl-wr840n-v4
DTS := TL-WR840NV4
IMAGE_SIZE := 7808k
DEVICE_TITLE := TP-Link TL-WR840N v4
- TPLINK_BOARD_ID := TL-WR840NV4
+ TPLINK_FLASHLAYOUT := 8Mmtk
+ TPLINK_HWID := 0x08400004
+ TPLINK_HWREV := 0x1
+ TPLINK_HWREVADD := 0x4
+ TPLINK_HVERSION := 3
KERNEL := $(KERNEL_DTB)
IMAGES += tftp-recovery.bin
- IMAGE/factory.bin := tplink-v2-image
+ IMAGE/factory.bin := tplink-v2-image -e
IMAGE/tftp-recovery.bin := pad-extra 128k | $$(IMAGE/factory.bin)
- IMAGE/sysupgrade.bin := tplink-v2-image -s | append-metadata | \
+ IMAGE/sysupgrade.bin := tplink-v2-image -s -e | append-metadata | \
check-size $$$$(IMAGE_SIZE)
endef
@@ -98,7 +102,9 @@ define Device/tl-wr841n-v13
$(Device/tl-wr840n-v4)
DTS := TL-WR841NV13
DEVICE_TITLE := TP-Link TL-WR841N v13
- TPLINK_BOARD_ID := TL-WR841NV13
+ TPLINK_HWID := 0x08410013
+ TPLINK_HWREV := 0x268
+ TPLINK_HWREVADD := 0x13
endef
TARGET_DEVICES += tl-wr840n-v4 tl-wr841n-v13