diff mbox

[U-Boot,1/6] tools: omapimage: Fix size in header

Message ID 20170208123337.27079-2-lokeshvutla@ti.com
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Lokesh Vutla Feb. 8, 2017, 12:33 p.m. UTC
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 <lokeshvutla@ti.com>
---
 tools/gpimage.c   | 2 +-
 tools/omapimage.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Tom Rini Feb. 8, 2017, 1:50 p.m. UTC | #1
On Wed, Feb 08, 2017 at 06:03:32PM +0530, Lokesh Vutla wrote:

> 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 <lokeshvutla@ti.com>

Reviewed-by: Tom Rini <trini@konsulko.com>
diff mbox

Patch

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) {