diff options
author | Reinhard Pfau <reinhard.pfau@gdsys.cc> | 2015-11-29 15:48:25 +0100 |
---|---|---|
committer | Luka Perkov <luka.perkov@sartura.hr> | 2015-11-29 16:02:44 +0100 |
commit | a8840dced0745165073b3d7163ee42404da09bdc (patch) | |
tree | 3974d2ee18388967b699b1616dc147581b6856f9 /tools/kwbimage.h | |
parent | 777208593012d03a8b839bd03f0e7f2129bf1b83 (diff) | |
download | u-boot-a8840dced0745165073b3d7163ee42404da09bdc.tar.gz |
tools/kwbimage: fix endianess issue
KWB image header values are in little endian (LE).
So adding appropriate cpu_to_leXX() calls to allow building those images
on BE hosts, too.
Signed-off-by: Reinhard Pfau <reinhard.pfau@gdsys.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'tools/kwbimage.h')
-rw-r--r-- | tools/kwbimage.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/kwbimage.h b/tools/kwbimage.h index 9d2585c0e7..e6e3d1d4f9 100644 --- a/tools/kwbimage.h +++ b/tools/kwbimage.h @@ -9,6 +9,7 @@ #ifndef _KWBIMAGE_H_ #define _KWBIMAGE_H_ +#include <compiler.h> #include <stdint.h> #define KWBIMAGE_MAX_CONFIG ((0x1dc - 0x20)/sizeof(struct reg_config)) @@ -115,7 +116,7 @@ struct opt_hdr_v1 { #define OPT_HDR_V1_REGISTER_TYPE 0x3 #define KWBHEADER_V1_SIZE(hdr) \ - (((hdr)->headersz_msb << 16) | (hdr)->headersz_lsb) + (((hdr)->headersz_msb << 16) | le16_to_cpu((hdr)->headersz_lsb)) enum kwbimage_cmd { CMD_INVALID, |