diff options
author | Pali Rohár <pali@kernel.org> | 2023-01-21 20:05:43 +0100 |
---|---|---|
committer | Stefan Roese <sr@denx.de> | 2023-03-01 06:39:17 +0100 |
commit | 27670acaac82f370b635f1af103594a335322bcf (patch) | |
tree | 22eba4a033749030b7c46e8fdb4e3c059d96962c /tools/mkimage.c | |
parent | 9b4531f685fafeb2bb0139e323f635d3cda150f7 (diff) | |
download | u-boot-27670acaac82f370b635f1af103594a335322bcf.zip u-boot-27670acaac82f370b635f1af103594a335322bcf.tar.gz u-boot-27670acaac82f370b635f1af103594a335322bcf.tar.bz2 |
tools: mkimage: Do not fill legacy_img_hdr for non-legacy XIP images
Skip filling legacy_img_hdr structure for XIP images which do not use
legacy_img_hdr structure header. Adding unwanted header to other image
formats, like kwbimage cause generation of broken image.
Signed-off-by: Pali Rohár <pali@kernel.org>
Diffstat (limited to 'tools/mkimage.c')
-rw-r--r-- | tools/mkimage.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/mkimage.c b/tools/mkimage.c index af7b0e0..0b34215 100644 --- a/tools/mkimage.c +++ b/tools/mkimage.c @@ -860,7 +860,9 @@ copy_file (int ifd, const char *datafile, int pad) exit (EXIT_FAILURE); } - if (params.xflag) { + if (params.xflag && + (((params.type > IH_TYPE_INVALID) && (params.type < IH_TYPE_FLATDT)) || + (params.type == IH_TYPE_KERNEL_NOLOAD) || (params.type == IH_TYPE_FIRMWARE_IVT))) { unsigned char *p = NULL; /* * XIP: do not append the struct legacy_img_hdr at the |