]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - tools/kwbimage.h
cmd/bdinfo: extract print_bi_dram
[people/ms/u-boot.git] / tools / kwbimage.h
index 9d2585c0e727238689520cf92747d8da5bfa017c..e6e3d1d4f9addbaa8932b83e58665df54a1b7162 100644 (file)
@@ -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,