From patchwork Fri Feb 10 15:07:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lokesh Vutla X-Patchwork-Id: 726576 X-Patchwork-Delegate: trini@ti.com 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 3vKdfS6nDxz9s7J for ; Sat, 11 Feb 2017 02:10:08 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BB731B387F; Fri, 10 Feb 2017 16:09: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 Uur1VpioxrAq; Fri, 10 Feb 2017 16:09:50 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 11BBCA7954; Fri, 10 Feb 2017 16:09:46 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 40B65A7940 for ; Fri, 10 Feb 2017 16:09:41 +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 hcuW4OMnyFMD for ; Fri, 10 Feb 2017 16:09:41 +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 fllnx209.ext.ti.com (fllnx209.ext.ti.com [198.47.19.16]) by theia.denx.de (Postfix) with ESMTPS id 181B94B64F for ; Fri, 10 Feb 2017 16:09:37 +0100 (CET) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id v1AF9Bex028141; Fri, 10 Feb 2017 09:09:11 -0600 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v1AF95o5003775; Fri, 10 Feb 2017 09:09:05 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.294.0; Fri, 10 Feb 2017 09:09:05 -0600 Received: from a0131933.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id v1AF8wcE029459; Fri, 10 Feb 2017 09:09:03 -0600 From: Lokesh Vutla To: Tom Rini , Date: Fri, 10 Feb 2017 20:37:16 +0530 Message-ID: <20170210150720.26759-2-lokeshvutla@ti.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170210150720.26759-1-lokeshvutla@ti.com> References: <20170210150720.26759-1-lokeshvutla@ti.com> MIME-Version: 1.0 Cc: Tero Kristo Subject: [U-Boot] [PATCH v3 1/5] tools: omapimage: Fix size in header 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The size field in GP header that is expected by ROM is size of the image + size of the header. But omapimage generates a gp header only with size of the image as size field. Fix it Reviewed-by: Tom Rini Signed-off-by: Lokesh Vutla --- tools/gpimage.c | 2 +- tools/omapimage.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/gpimage.c b/tools/gpimage.c index 1adc55c5fc..3ae511d33e 100644 --- a/tools/gpimage.c +++ b/tools/gpimage.c @@ -54,7 +54,7 @@ static void gpimage_set_header(void *ptr, struct stat *sbuf, int ifd, { struct gp_header *gph = (struct gp_header *)ptr; - gph_set_header(gph, sbuf->st_size - GPIMAGE_HDR_SIZE, params->addr, 1); + gph_set_header(gph, sbuf->st_size, params->addr, 1); } /* diff --git a/tools/omapimage.c b/tools/omapimage.c index 7198b3330d..4fe62c5b31 100644 --- a/tools/omapimage.c +++ b/tools/omapimage.c @@ -143,7 +143,7 @@ static void omapimage_set_header(void *ptr, struct stat *sbuf, int ifd, toc++; memset(toc, 0xff, sizeof(*toc)); - gph_set_header(gph, sbuf->st_size - OMAP_FILE_HDR_SIZE, + gph_set_header(gph, sbuf->st_size - OMAP_CH_HDR_SIZE, params->addr, 0); if (strncmp(params->imagename, "byteswap", 8) == 0) {