diff --git a/target/linux/mediatek/image/gen_scatterfile.sh b/target/linux/mediatek/image/gen_scatterfile.sh new file mode 100755 index 0000000000..f23cf819b8 --- /dev/null +++ b/target/linux/mediatek/image/gen_scatterfile.sh @@ -0,0 +1,75 @@ +#!/bin/sh +# +# Copyright © 2020 David Woodhouse +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# Generate as "scatter file" for use with the MediaTek SP Flash tool for +# writing images to MediaTek boards. This can be used to write images +# even on a bricked board which has no preloader installed, or broken +# U-Boot. +# +# NOTE: At the time of writing (2020-07-20), the Linux tool linked from +# the front page of https://spflashtool.com/ is out of date and does not +# support MT7623. The newer v5.1916 found on the download page at +# https://spflashtool.com/download/ has been tested on UniElec U7623 and +# Banana Pi R2 from Linux, and does work. +# + +SOC=$1 +IMAGE=${2%.gz} +PROJECT=${3%-scatter.txt} +DEVICENAME="$4" + +cat < $@ +endef + define Device/bpi_bananapi-r2 DEVICE_VENDOR := Bpi DEVICE_MODEL := Banana Pi R2 @@ -34,6 +44,9 @@ define Device/bpi_bananapi-r2 UBOOT_TARGET := mt7623n_bpir2 IMAGES := img.gz IMAGE/img.gz := banana-pi-sdcard | gzip | append-metadata + ARTIFACT/preloader.bin := preloader $$(UBOOT_TARGET) + ARTIFACT/scatter.txt := scatterfile $$(firstword $$(FILESYSTEMS))-$$(firstword $$(IMAGES)) + ARTIFACTS = preloader.bin scatter.txt SUPPORTED_DEVICES := bananapi,bpi-r2 endef TARGET_DEVICES += bpi_bananapi-r2