summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-06-12 07:24:51 -0600
committerTom Rini <trini@ti.com>2014-06-19 11:19:01 -0400
commitea51a6282316f383fa04defa30ea15feb36d5d69 (patch)
treeebcc28e90b945cf9afd9515db0543b778e145076
parentaa69db1f7ab6876f4fe160c079d15845434681f1 (diff)
downloadu-boot-imx-ea51a6282316f383fa04defa30ea15feb36d5d69.zip
u-boot-imx-ea51a6282316f383fa04defa30ea15feb36d5d69.tar.gz
u-boot-imx-ea51a6282316f383fa04defa30ea15feb36d5d69.tar.bz2
Allow compiling common/bootm.c on with HOSTCC
We want to use some of the functionality in this file, so make it build on the host. Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r--common/bootm.c18
-rw-r--r--tools/Makefile1
2 files changed, 15 insertions, 4 deletions
diff --git a/common/bootm.c b/common/bootm.c
index 1e66929..d83dded 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -5,10 +5,10 @@
* SPDX-License-Identifier: GPL-2.0+
*/
+#ifndef USE_HOSTCC
#include <common.h>
-#include <bootm.h>
+#include <bootstage.h>
#include <bzlib.h>
-#include <image.h>
#include <fdt_support.h>
#include <lmb.h>
#include <malloc.h>
@@ -17,12 +17,16 @@
#include <lzma/LzmaTypes.h>
#include <lzma/LzmaDec.h>
#include <lzma/LzmaTools.h>
-
#if defined(CONFIG_CMD_USB)
#include <usb.h>
#endif
+#else
+#include "mkimage.h"
+#endif
-DECLARE_GLOBAL_DATA_PTR;
+#include <command.h>
+#include <bootm.h>
+#include <image.h>
#ifndef CONFIG_SYS_BOOTM_LEN
/* use 8MByte as default max gunzip size */
@@ -31,6 +35,10 @@ DECLARE_GLOBAL_DATA_PTR;
#define IH_INITRD_ARCH IH_ARCH_DEFAULT
+#ifndef USE_HOSTCC
+
+DECLARE_GLOBAL_DATA_PTR;
+
static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[], bootm_headers_t *images,
ulong *os_data, ulong *os_len);
@@ -809,3 +817,5 @@ static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
return buf;
}
+
+#endif /* ndef USE_HOSTCC */
diff --git a/tools/Makefile b/tools/Makefile
index 0088c1a..949b6c6 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -66,6 +66,7 @@ RSA_OBJS-$(CONFIG_FIT_SIGNATURE) := $(addprefix lib/rsa/, \
dumpimage-mkimage-objs := aisimage.o \
atmelimage.o \
$(FIT_SIG_OBJS-y) \
+ common/bootm.o \
lib/crc32.o \
default_image.o \
lib/fdtdec.o \