From patchwork Thu Nov 17 00:13:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Nelson X-Patchwork-Id: 695935 X-Patchwork-Delegate: sbabic@denx.de 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 3tK1qv69dpz9ryT for ; Thu, 17 Nov 2016 11:15:55 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AD667B3830; Thu, 17 Nov 2016 01:15:53 +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 UMlK6SShjCLl; Thu, 17 Nov 2016 01:15:53 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 30197B3825; Thu, 17 Nov 2016 01:15:53 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B5906B3825 for ; Thu, 17 Nov 2016 01:15:50 +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 9yLjrkUise_A for ; Thu, 17 Nov 2016 01:15:50 +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 fed1rmfepo203.cox.net (fed1rmfepo203.cox.net [68.230.241.148]) by theia.denx.de (Postfix) with ESMTP id 155A9A754A for ; Thu, 17 Nov 2016 01:15:45 +0100 (CET) Received: from fed1rmimpo306.cox.net ([68.230.241.174]) by fed1rmfepo203.cox.net (InterMail vM.8.01.05.28 201-2260-151-171-20160122) with ESMTP id <20161117001544.ICUF4109.fed1rmfepo203.cox.net@fed1rmimpo306.cox.net> for ; Wed, 16 Nov 2016 19:15:44 -0500 Received: from localhost.localdomain ([98.165.102.90]) by fed1rmimpo306.cox.net with cox id 8oFj1u0051x1f0q01oFjlx; Wed, 16 Nov 2016 19:15:44 -0500 X-CT-Class: Clean X-CT-Score: 0.00 X-CT-RefID: str=0001.0A090206.582CF6B0.010A, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CT-Spam: 0 X-Authority-Analysis: v=2.1 cv=Bu09udj5 c=1 sm=1 tr=0 a=i7nT0dqFxmwB8XGI+JTv/g==:117 a=i7nT0dqFxmwB8XGI+JTv/g==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=NEAV23lmAAAA:8 a=R_N1NMmAAAAA:8 a=9_1hYV8uAAAA:8 a=huo0RqNuSXVsE7xu2G4A:9 a=j1caeuGUnzyJjx7C:21 a=qSuCNg6HkwHAP371:21 a=Bn2pgwyD2vrAyMmN8A2t:22 a=Wvp8Paq2gr8k52V1JQjE:22 a=FKwbt-OhbrkoYuZlCyy7:22 X-CM-Score: 0.00 Authentication-Results: cox.net; auth=pass (CRAM-MD5) smtp.auth=eric.a.nelson@cox.net From: Eric Nelson To: u-boot@lists.denx.de Date: Wed, 16 Nov 2016 17:13:41 -0700 Message-Id: <1479341621-30021-1-git-send-email-eric@nelint.com> X-Mailer: git-send-email 2.7.4 Cc: gary.bisson@boundarydevices.com, adrian.alonso@nxp.com Subject: [U-Boot] [PATCH] tools: imximage: display DCD block offset, length 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" These values can be used to sign a U-Boot image for use when loading an image through the Serial Download Protocol (SDP). Note that the address of 0x910000 is usable with the stock configuration of imx_usb_loader on i.MX6 and i.MX7 SOCs: https://github.com/boundarydevices/imx_usb_loader/blob/master/mx6_usb_work.conf#L3 Refer to the section on imx_usb_loader in this post for more details: https://boundarydevices.com/high-assurance-boot-hab-dummies/ Signed-off-by: Eric Nelson --- tools/imximage.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/imximage.c b/tools/imximage.c index c9e42ec..2cd8d88 100644 --- a/tools/imximage.c +++ b/tools/imximage.c @@ -281,7 +281,6 @@ static void set_dcd_rst_v2(struct imx_header *imxhdr, uint32_t dcd_len, d = (struct dcd_v2_cmd *)(((char *)d) + len); len = (char *)d - (char *)&dcd_v2->header; - dcd_v2->header.tag = DCD_HEADER_TAG; dcd_v2->header.length = cpu_to_be16(len); dcd_v2->header.version = DCD_VERSION; @@ -501,10 +500,19 @@ static void print_hdr_v2(struct imx_header *imx_hdr) printf("Entry Point: %08x\n", (uint32_t)fhdr_v2->entry); if (fhdr_v2->csf && (imximage_ivt_offset != UNDEFINED) && (imximage_csf_size != UNDEFINED)) { + uint16_t dcdlen; + int offs; + + dcdlen = hdr_v2->data.dcd_table.header.length; + offs = (char *)&hdr_v2->data.dcd_table + - (char *)hdr_v2; + printf("HAB Blocks: %08x %08x %08x\n", (uint32_t)fhdr_v2->self, 0, hdr_v2->boot_data.size - imximage_ivt_offset - imximage_csf_size); + printf("DCD Blocks: 00910000 %08x %08x\n", + offs, be16_to_cpu(dcdlen)); } } else { imx_header_v2_t *next_hdr_v2;