diff mbox

[U-Boot,v4] tools: omapimage: Fix size in header

Message ID 20170215131254.2379-1-lokeshvutla@ti.com
State Accepted
Commit 35d8265c64dee1bd3015883673960df32c4e9c1a
Delegated to: Tom Rini
Headers show

Commit Message

Lokesh Vutla Feb. 15, 2017, 1:12 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/omapimage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tom Rini March 16, 2017, 8:40 p.m. UTC | #1
On Wed, Feb 15, 2017 at 06:42:54PM +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>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/tools/omapimage.c b/tools/omapimage.c
index 7198b3330d..e31b94ae4f 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 + GPIMAGE_HDR_SIZE,
 		       params->addr, 0);
 
 	if (strncmp(params->imagename, "byteswap", 8) == 0) {