aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorLeon M. George <leon@georgemail.eu>2019-07-25 11:59:56 +0200
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-06-28 00:26:39 +0200
commit9f261e36de799322512f36a54689260e617c4fba (patch)
tree979610247354a7539b38d6fff0cbf8514fa0d2af /target/linux
parente10dd48360721a13d9196f9c2c7d2b901dfcc455 (diff)
downloadupstream-9f261e36de799322512f36a54689260e617c4fba.tar.gz
upstream-9f261e36de799322512f36a54689260e617c4fba.tar.bz2
upstream-9f261e36de799322512f36a54689260e617c4fba.zip
ath79: build Compex WPJ531 cpximg files
Generate additional images that are compatible to the cpximg loader. The cpximg loader can be started either by holding the reset button during power up or by entering the u-boot prompt and entering 'cpximg'. Once it's running, a TFTP-server under 192.168.1.1 will accept the image appropriate for the board revision that is etched on the board. For example, if the board is labelled '7A04': tftp -v -m binary 192.168.1.1 -c put openwrt-ath79-generic-compex_wpj531-16m-squashfs-cpximg-7A04.bin These files can also be used with the sysupgrade utility in stock images (add SSH key in luci for root access). Signed-off-by: Leon M. George <leon@georgemail.eu> [fix sorting of definitions] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/ath79/image/generic.mk28
1 files changed, 28 insertions, 0 deletions
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index 35def34250..f99fcdeda2 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -50,6 +50,29 @@ define Build/cybertan-trx
-rm $@-empty.bin
endef
+define Build/mkmylofw_16m
+ $(eval device_id=$(word 1,$(1)))
+ $(eval revision=$(word 2,$(1)))
+
+ # On WPJ344, WPJ531, and WPJ563, the default boot command tries 0x9f680000
+ # first and fails if the remains of the stock image are sill there
+ # - resulting in an infinite boot loop.
+ # The size parameter is grown to have that block deleted if the firmware
+ # isn't big enough by itself.
+
+ let \
+ size="$$(stat -c%s $@)" \
+ pad="$(subst k,* 1024,$(BLOCKSIZE))" \
+ pad="(pad - (size % pad)) % pad" \
+ newsize='size + pad' ; \
+ [ $$newsize -lt $$((0x660000)) ] && newsize=0x660000 ; \
+ $(STAGING_DIR_HOST)/bin/mkmylofw \
+ -B WPE72 -i 0x11f6:$(device_id):0x11f6:$(device_id) -r $(revision) \
+ -s 0x1000000 -p0x30000:$$newsize:al:0x80060000:"OpenWRT":$@ \
+ $@.new
+ @mv $@.new $@
+endef
+
define Build/mkwrggimg
$(STAGING_DIR_HOST)/bin/mkwrggimg -b \
-i $@ -o $@.imghdr -d /dev/mtdblock/1 \
@@ -426,6 +449,11 @@ define Device/compex_wpj531-16m
DEVICE_MODEL := WPJ531
DEVICE_VARIANT := 16M
SUPPORTED_DEVICES += wpj531
+ IMAGES += cpximg-7a03.bin cpximg-7a04.bin cpximg-7a06.bin cpximg-7a07.bin
+ IMAGE/cpximg-7a03.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | mkmylofw_16m 0x68a 2
+ IMAGE/cpximg-7a04.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | mkmylofw_16m 0x693 3
+ IMAGE/cpximg-7a06.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | mkmylofw_16m 0x693 3
+ IMAGE/cpximg-7a07.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | mkmylofw_16m 0x693 3
endef
TARGET_DEVICES += compex_wpj531-16m