board/csky: fixup gdb instructions in readme.txt
[buildroot-gz.git] / package / uboot-tools / 0003-Make-FIT-support-really-optional.patch
blob8853198b437ad71709e77bad45313e44c77fabe9
1 From d9d7d7cf8b27516d45c66daa1bf0a18c878c4e33 Mon Sep 17 00:00:00 2001
2 From: Carlos Santos <casantos@datacom.ind.br>
3 Date: Sun, 8 May 2016 11:11:39 -0300
4 Subject: [PATCH] Make FIT support really optional
6 Due to some mistakes in the source code, it was not possible to really
7 turn FIT support off. This commit fixes the problem by means of the
8 following changes:
10 - Enclose "bootm_host_load_image" and "bootm_host_load_images" between
11 checks for CONFIG_FIT_SIGNATURE, in common/bootm.c.
13 - Enclose the declaration of "bootm_host_load_images" between checks for
14 CONFIG_FIT_SIGNATURE, in common/bootm.h.
16 - Condition the compilation and linking of fit_common.o fit_image.o
17 image-host.o common/image-fit.o to CONFIG_FIT=y, in tools/Makefile.
19 Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
20 [fabio: adapt for 2016.07]
21 Signed-off-by: Fabio Estevam <festevam@gmail.com>
22 [Ricardo: fix conditional compilation and linking of the files mentioned above
23 for 2016.07]
24 Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
25 ---
26 common/bootm.c | 2 ++
27 include/bootm.h | 2 ++
28 tools/Makefile | 6 ++----
29 3 files changed, 6 insertions(+), 4 deletions(-)
31 diff --git a/common/bootm.c b/common/bootm.c
32 index 2431019..7e1adc8 100644
33 --- a/common/bootm.c
34 +++ b/common/bootm.c
35 @@ -901,6 +901,7 @@ void memmove_wd(void *to, void *from, size_t len, ulong chunksz)
36 memmove(to, from, len);
39 +#if defined(CONFIG_FIT_SIGNATURE)
40 static int bootm_host_load_image(const void *fit, int req_image_type)
42 const char *fit_uname_config = NULL;
43 @@ -965,5 +966,6 @@ int bootm_host_load_images(const void *fit, int cfg_noffset)
44 /* Return the first error we found */
45 return err;
47 +#endif
49 #endif /* ndef USE_HOSTCC */
50 diff --git a/include/bootm.h b/include/bootm.h
51 index 4981377..94d62a1 100644
52 --- a/include/bootm.h
53 +++ b/include/bootm.h
54 @@ -41,7 +41,9 @@ void lynxkdi_boot(image_header_t *hdr);
56 boot_os_fn *bootm_os_get_boot_func(int os);
58 +#if defined(CONFIG_FIT_SIGNATURE)
59 int bootm_host_load_images(const void *fit, int cfg_noffset);
60 +#endif
62 int boot_selected_os(int argc, char * const argv[], int state,
63 bootm_headers_t *images, boot_os_fn *boot_fn);
64 diff --git a/tools/Makefile b/tools/Makefile
65 index f72294a..ccf5120 100644
66 --- a/tools/Makefile
67 +++ b/tools/Makefile
68 @@ -54,6 +54,7 @@ mkenvimage-objs := mkenvimage.o os_support.o lib/crc32.o
69 hostprogs-y += dumpimage mkimage
70 hostprogs-$(CONFIG_FIT_SIGNATURE) += fit_info fit_check_sign
72 +FIT_OBJS-$(CONFIG_FIT) := fit_common.o fit_image.o image-host.o common/image-fit.o
73 FIT_SIG_OBJS-$(CONFIG_FIT_SIGNATURE) := common/image-sig.o
74 # Flattened device tree objects
75 LIBFDT_OBJS := $(addprefix lib/libfdt/, \
76 @@ -68,16 +69,13 @@ ROCKCHIP_OBS = lib/rc4.o rkcommon.o rkimage.o rksd.o rkspi.o
77 # common objs for dumpimage and mkimage
78 dumpimage-mkimage-objs := aisimage.o \
79 atmelimage.o \
80 + $(FIT_OBJS-y) \
81 $(FIT_SIG_OBJS-y) \
82 common/bootm.o \
83 lib/crc32.o \
84 default_image.o \
85 lib/fdtdec_common.o \
86 lib/fdtdec.o \
87 - fit_common.o \
88 - fit_image.o \
89 - common/image-fit.o \
90 - image-host.o \
91 common/image.o \
92 imagetool.o \
93 imximage.o \
94 --
95 2.9.1