aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mediatek/image
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/mediatek/image')
-rw-r--r--target/linux/mediatek/image/mt7622.mk64
1 files changed, 64 insertions, 0 deletions
diff --git a/target/linux/mediatek/image/mt7622.mk b/target/linux/mediatek/image/mt7622.mk
index 6824d4a8ee..e31baf2275 100644
--- a/target/linux/mediatek/image/mt7622.mk
+++ b/target/linux/mediatek/image/mt7622.mk
@@ -6,6 +6,28 @@ else
KERNEL_LOADADDR := 0x44000000
endif
+define Image/Prepare
+ # For UBI we want only one extra block
+ rm -f $(KDIR)/ubi_mark
+ echo -ne '\xde\xad\xc0\xde' > $(KDIR)/ubi_mark
+endef
+
+define Build/buffalo-kernel-trx
+ $(eval magic=$(word 1,$(1)))
+ $(eval dummy=$(word 2,$(1)))
+ $(eval kern_size=$(if $(KERNEL_SIZE),$(KERNEL_SIZE),0x400000))
+
+ $(if $(dummy),touch $(dummy))
+ $(STAGING_DIR_HOST)/bin/otrx create $@.new \
+ $(if $(magic),-M $(magic),) \
+ -f $@ \
+ $(if $(dummy),\
+ -a 0x20000 \
+ -b $$(( $(subst k, * 1024,$(kern_size)) )) \
+ -f $(dummy),)
+ mv $@.new $@
+endef
+
define Build/bl2
cat $(STAGING_DIR_IMAGE)/mt7622-$1-bl2.img >> $@
endef
@@ -34,6 +56,19 @@ define Build/mt7622-gpt
rm $@.tmp
endef
+define Build/trx-nand
+ # kernel: always use 4 MiB (-28 B or TRX header) to allow upgrades even
+ # if it grows up between releases
+ # root: UBI with one extra block containing UBI mark to trigger erasing
+ # rest of partition
+ $(STAGING_DIR_HOST)/bin/otrx create $@.new \
+ -M 0x32504844 \
+ -f $(IMAGE_KERNEL) -a 0x20000 -b 0x400000 \
+ -f $@ \
+ -A $(KDIR)/ubi_mark -a 0x20000
+ mv $@.new $@
+endef
+
define Device/bananapi_bpi-r64
DEVICE_VENDOR := Bananapi
DEVICE_MODEL := BPi-R64
@@ -51,6 +86,35 @@ define Device/bananapi_bpi-r64
endef
TARGET_DEVICES += bananapi_bpi-r64
+define Device/buffalo_wsr-2533dhp2
+ DEVICE_VENDOR := Buffalo
+ DEVICE_MODEL := WSR-2533DHP2
+ DEVICE_DTS := mt7622-buffalo-wsr-2533dhp2
+ DEVICE_DTS_DIR := ../dts
+ IMAGE_SIZE := 59392k
+ KERNEL_SIZE := 4096k
+ BLOCKSIZE := 128k
+ PAGESIZE := 2048
+ SUBPAGESIZE := 512
+ UBINIZE_OPTS := -E 5
+ BUFFALO_TAG_PLATFORM := MTK
+ BUFFALO_TAG_VERSION := 9.99
+ BUFFALO_TAG_MINOR := 9.99
+ IMAGES += factory.bin factory-uboot.bin
+ KERNEL_INITRAMFS := kernel-bin | lzma | \
+ fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | \
+ buffalo-kernel-trx
+ IMAGE/factory.bin := append-ubi | trx-nand | \
+ buffalo-enc WSR-2533DHP2 $$(BUFFALO_TAG_VERSION) -l | \
+ buffalo-tag-dhp WSR-2533DHP2 JP JP | buffalo-enc-tag -l | buffalo-dhp-image
+ IMAGE/factory-uboot.bin := append-ubi | trx-nand
+ IMAGE/sysupgrade.bin := append-kernel | \
+ buffalo-kernel-trx 0x32504844 $(KDIR)/tmp/$$(DEVICE_NAME).null | \
+ sysupgrade-tar kernel=$$$$@ | append-metadata
+ DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware swconfig uboot-envtools
+endef
+TARGET_DEVICES += buffalo_wsr-2533dhp2
+
define Device/elecom_wrc-2533gent
DEVICE_VENDOR := Elecom
DEVICE_MODEL := WRC-2533GENT