[U-Boot,TEST-ONLY,16/16] Add a temporary script that can create a bootimage for rk3188
diff mbox

Message ID 20170203160939.27594-17-heiko@sntech.de
State RFC
Delegated to: Simon Glass
Headers show

Commit Message

Heiko Stuebner Feb. 3, 2017, 4:09 p.m. UTC
Combines tpl, spl and uboot image in one flashable image.
---
 mkuboot | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100755 mkuboot

Comments

Simon Glass Feb. 6, 2017, 3:35 p.m. UTC | #1
On 3 February 2017 at 08:09, Heiko Stuebner <heiko@sntech.de> wrote:
> Combines tpl, spl and uboot image in one flashable image.
> ---
>  mkuboot | 35 +++++++++++++++++++++++++++++++++++
>  1 file changed, 35 insertions(+)
>  create mode 100755 mkuboot

Could use binman?

Patch
diff mbox

diff --git a/mkuboot b/mkuboot
new file mode 100755
index 0000000000..42109b2b87
--- /dev/null
+++ b/mkuboot
@@ -0,0 +1,35 @@ 
+#!/bin/bash
+
+LOCALPATH=$(pwd)
+ROOTDIR=$(dirname $(dirname $(readlink -f $0)))
+OUT=${ROOTDIR}/out
+IMAGE=${ROOTDIR}/image
+BOARD=$1
+DEFCONFIG=""
+
+if [ $# != 1 ] ; then
+BOARD=rock
+fi
+OUTBIN=${BOARD}-uboot.bin
+
+
+# copy tpl and pad to 1020 byte
+cat tpl/u-boot-tpl.bin > tpl/u-boot-tplspl.bin
+truncate -s 1020 tpl/u-boot-tplspl.bin
+
+#append spl and encode the result using mkimage
+truncate -s %2048 spl/u-boot-spl.bin
+cat spl/u-boot-spl.bin >> tpl/u-boot-tplspl.bin
+tools/mkimage  -n rk3188 -T rksd -d tpl/u-boot-tplspl.bin ${OUTBIN}
+
+########
+# Need to remove the RK31 from the FlashBoot binary to create FlashSpl
+# This can be used instead of the open spl as first stage
+#tools/mkimage  -n rk3188 -T rksd -d FlashSpl ${OUTBIN}
+
+# bootrom reads and decodes 2kb blocks, so bring u-boot.bin in line
+truncate -s %2048 u-boot.bin
+
+# rk3188 needs an rc4-encoded uboot as well
+cat u-boot.bin | split -b 512 --filter='openssl rc4 -K 7C4E0304550509072D2C7B38170D1711' >> ${OUTBIN}
+echo U-boot image:${OUTBIN}