From patchwork Wed Feb 8 12:33:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lokesh Vutla X-Patchwork-Id: 725618 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 3vJLL674J6z9s7C for ; Wed, 8 Feb 2017 23:36:30 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 59CEC4B6CF; Wed, 8 Feb 2017 13:36:02 +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 htZMmWq6jGVA; Wed, 8 Feb 2017 13:36:02 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8BF3F4B58A; Wed, 8 Feb 2017 13:36:01 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 80D05B3874 for ; Wed, 8 Feb 2017 13:35:58 +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 kE2L8WlbLG60 for ; Wed, 8 Feb 2017 13:35:58 +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 AC6464B63C for ; Wed, 8 Feb 2017 13:35:52 +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 v18CZP28013085; Wed, 8 Feb 2017 06:35:25 -0600 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v18CZKRk027274; Wed, 8 Feb 2017 06:35:20 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.294.0; Wed, 8 Feb 2017 06:35:20 -0600 Received: from a0131933.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v18CZE1d013445; Wed, 8 Feb 2017 06:35:18 -0600 From: Lokesh Vutla To: Tom Rini , Date: Wed, 8 Feb 2017 18:03:32 +0530 Message-ID: <20170208123337.27079-2-lokeshvutla@ti.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170208123337.27079-1-lokeshvutla@ti.com> References: <20170208123337.27079-1-lokeshvutla@ti.com> MIME-Version: 1.0 Cc: Tero Kristo Subject: [U-Boot] [PATCH 1/6] 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 Signed-off-by: Lokesh Vutla Reviewed-by: Tom Rini --- 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) {