From patchwork Fri Feb 3 16:09:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Heiko_St=C3=BCbner?= X-Patchwork-Id: 723805 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3vFMmw0fzLz9s7F for ; Sat, 4 Feb 2017 03:30:55 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CF94AA76E4; Fri, 3 Feb 2017 17:30:32 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wFdI89GExxvk; Fri, 3 Feb 2017 17:30:32 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 29036B38B6; Fri, 3 Feb 2017 17:30:29 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1B824B3897 for ; Fri, 3 Feb 2017 17:30:26 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gpVOjDmRTvVf for ; Fri, 3 Feb 2017 17:30:26 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from gloria.sntech.de (gloria.sntech.de [95.129.55.99]) by theia.denx.de (Postfix) with ESMTPS id 5BB7BB3898 for ; Fri, 3 Feb 2017 17:30:17 +0100 (CET) Received: from host-78-129-33-179.dynamic.voo.be ([78.129.33.179] helo=phil.sntech) by gloria.sntech.de with esmtpsa (TLS1.1:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1cZgRU-0002I2-RP; Fri, 03 Feb 2017 17:10:32 +0100 From: Heiko Stuebner To: sjg@chromium.org Date: Fri, 3 Feb 2017 17:09:39 +0100 Message-Id: <20170203160939.27594-17-heiko@sntech.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170203160939.27594-1-heiko@sntech.de> References: <20170203160939.27594-1-heiko@sntech.de> Cc: romain.perier@collabora.com, u-boot@lists.denx.de Subject: [U-Boot] [TEST-ONLY 16/16] Add a temporary script that can create a bootimage for rk3188 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Combines tpl, spl and uboot image in one flashable image. --- mkuboot | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 mkuboot 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}