From 73223f0e1bd0e37925ae1b7f21b51733145571dc Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 22 Feb 2016 22:55:43 -0700 Subject: Kconfig: Move CONFIG_FIT and related options to Kconfig There are already two FIT options in Kconfig but the CONFIG options are still in the header files. We need to do a proper move to fix this. Move these options to Kconfig and tidy up board configuration: CONFIG_FIT CONFIG_OF_BOARD_SETUP CONFIG_OF_SYSTEM_SETUP CONFIG_FIT_SIGNATURE CONFIG_FIT_BEST_MATCH CONFIG_FIT_VERBOSE CONFIG_OF_STDOUT_VIA_ALIAS CONFIG_RSA Unfortunately the first one is a little complicated. We need to make sure this option is not enabled in SPL by this change. Also this option is enabled automatically in the host builds by defining CONFIG_FIT in the image.h file. To solve this, add a new IMAGE_USE_FIT #define which can be used in files that are built on the host but must also build for U-Boot and SPL. Note: Masahiro's moveconfig.py script is amazing. Signed-off-by: Simon Glass [trini: Add microblaze change, various configs/ re-applies] Signed-off-by: Tom Rini --- common/Makefile | 4 ++-- common/bootm.c | 10 +++++----- common/image-fdt.c | 8 ++++---- common/image-fit.c | 3 ++- common/image.c | 24 ++++++++++++------------ 5 files changed, 25 insertions(+), 24 deletions(-) (limited to 'common') diff --git a/common/Makefile b/common/Makefile index 84882d714b..87231c642e 100644 --- a/common/Makefile +++ b/common/Makefile @@ -132,8 +132,8 @@ endif obj-y += image.o obj-$(CONFIG_ANDROID_BOOT_IMAGE) += image-android.o obj-$(CONFIG_OF_LIBFDT) += image-fdt.o -obj-$(CONFIG_FIT) += image-fit.o -obj-$(CONFIG_FIT_SIGNATURE) += image-sig.o +obj-$(CONFIG_$(SPL_)FIT) += image-fit.o +obj-$(CONFIG_$(SPL_)FIT_SIGNATURE) += image-sig.o obj-$(CONFIG_IO_TRACE) += iotrace.o obj-y += memsize.o obj-y += stdio.o diff --git a/common/bootm.c b/common/bootm.c index df27089965..ff566819cb 100644 --- a/common/bootm.c +++ b/common/bootm.c @@ -108,7 +108,7 @@ static int bootm_find_os(cmd_tbl_t *cmdtp, int flag, int argc, images.os.arch = image_get_arch(os_hdr); break; #endif -#if defined(CONFIG_FIT) +#if IMAGE_ENABLE_FIT case IMAGE_FORMAT_FIT: if (fit_image_get_type(images.fit_hdr_os, images.fit_noffset_os, @@ -180,7 +180,7 @@ static int bootm_find_os(cmd_tbl_t *cmdtp, int flag, int argc, /* Kernel entry point is the setup.bin */ } else if (images.legacy_hdr_valid) { images.ep = image_get_ep(&images.legacy_hdr_os_copy); -#if defined(CONFIG_FIT) +#if IMAGE_ENABLE_FIT } else if (images.fit_uname_os) { int ret; @@ -245,7 +245,7 @@ int bootm_find_images(int flag, int argc, char * const argv[]) set_working_fdt_addr((ulong)images.ft_addr); #endif -#if defined(CONFIG_FIT) +#if IMAGE_ENABLE_FIT /* find all of the loadables */ ret = boot_get_loadable(argc, argv, &images, IH_ARCH_DEFAULT, NULL, NULL); @@ -788,7 +788,7 @@ static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc, const void *buf; const char *fit_uname_config = NULL; const char *fit_uname_kernel = NULL; -#if defined(CONFIG_FIT) +#if IMAGE_ENABLE_FIT int os_noffset; #endif @@ -849,7 +849,7 @@ static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc, bootstage_mark(BOOTSTAGE_ID_DECOMP_IMAGE); break; #endif -#if defined(CONFIG_FIT) +#if IMAGE_ENABLE_FIT case IMAGE_FORMAT_FIT: os_noffset = fit_image_load(images, img_addr, &fit_uname_kernel, &fit_uname_config, diff --git a/common/image-fdt.c b/common/image-fdt.c index 79fa65563f..8c3f3e6374 100644 --- a/common/image-fdt.c +++ b/common/image-fdt.c @@ -231,7 +231,7 @@ int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch, ulong fdt_addr; char *fdt_blob = NULL; void *buf; -#if defined(CONFIG_FIT) +#if CONFIG_IS_ENABLED(FIT) const char *fit_uname_config = images->fit_uname_cfg; const char *fit_uname_fdt = NULL; ulong default_addr; @@ -246,7 +246,7 @@ int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch, if (argc > 2) select = argv[2]; if (select || genimg_has_config(images)) { -#if defined(CONFIG_FIT) +#if CONFIG_IS_ENABLED(FIT) if (select) { /* * If the FDT blob comes from the FIT image and the @@ -276,7 +276,7 @@ int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch, debug("* fdt: cmdline image address = 0x%08lx\n", fdt_addr); } -#if defined(CONFIG_FIT) +#if CONFIG_IS_ENABLED(FIT) } else { /* use FIT configuration provided in first bootm * command argument @@ -351,7 +351,7 @@ int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch, * (libfdt based) and raw FDT blob (also libfdt * based). */ -#if defined(CONFIG_FIT) +#if CONFIG_IS_ENABLED(FIT) /* check FDT blob vs FIT blob */ if (fit_check_format(buf)) { ulong load, len; diff --git a/common/image-fit.c b/common/image-fit.c index fbd9e0d770..f3b8aacf39 100644 --- a/common/image-fit.c +++ b/common/image-fit.c @@ -1101,8 +1101,9 @@ int fit_all_image_verify(const void *fit) * Direct child node of the images parent node, * i.e. component image node. */ - printf(" Hash(es) for Image %u (%s): ", count++, + printf(" Hash(es) for Image %u (%s): ", count, fit_get_name(fit, noffset, NULL)); + count++; if (!fit_image_verify(fit, noffset)) return 0; diff --git a/common/image.c b/common/image.c index 1d7543dd18..12102ab768 100644 --- a/common/image.c +++ b/common/image.c @@ -29,7 +29,7 @@ #include #include -#if defined(CONFIG_FIT) || defined(CONFIG_OF_LIBFDT) +#if IMAGE_ENABLE_FIT || defined(CONFIG_OF_LIBFDT) #include #include #endif @@ -707,7 +707,7 @@ ulong genimg_get_kernel_addr_fit(char * const img_addr, kernel_addr = load_addr; debug("* kernel: default image load address = 0x%08lx\n", load_addr); -#if defined(CONFIG_FIT) +#if CONFIG_IS_ENABLED(FIT) } else if (fit_parse_conf(img_addr, load_addr, &kernel_addr, fit_uname_config)) { debug("* kernel: config '%s' from image at 0x%08lx\n", @@ -762,7 +762,7 @@ int genimg_get_format(const void *img_addr) if (image_check_magic(hdr)) return IMAGE_FORMAT_LEGACY; #endif -#if defined(CONFIG_FIT) || defined(CONFIG_OF_LIBFDT) +#if IMAGE_ENABLE_FIT || defined(CONFIG_OF_LIBFDT) if (fdt_check_header(img_addr) == 0) return IMAGE_FORMAT_FIT; #endif @@ -799,7 +799,7 @@ ulong genimg_get_image(ulong img_addr) /* get header size */ h_size = image_get_header_size(); -#if defined(CONFIG_FIT) +#if IMAGE_ENABLE_FIT if (sizeof(struct fdt_header) > h_size) h_size = sizeof(struct fdt_header); #endif @@ -821,7 +821,7 @@ ulong genimg_get_image(ulong img_addr) ram_addr, d_size); break; #endif -#if defined(CONFIG_FIT) +#if IMAGE_ENABLE_FIT case IMAGE_FORMAT_FIT: d_size = fit_get_size(buf) - h_size; debug(" FIT/FDT format image found at 0x%08lx, " @@ -862,7 +862,7 @@ ulong genimg_get_image(ulong img_addr) */ int genimg_has_config(bootm_headers_t *images) { -#if defined(CONFIG_FIT) +#if IMAGE_ENABLE_FIT if (images->fit_uname_cfg) return 1; #endif @@ -903,7 +903,7 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images, #ifdef CONFIG_SUPPORT_RAW_INITRD char *end; #endif -#if defined(CONFIG_FIT) +#if IMAGE_ENABLE_FIT const char *fit_uname_config = images->fit_uname_cfg; const char *fit_uname_ramdisk = NULL; ulong default_addr; @@ -934,7 +934,7 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images, debug("## Skipping init Ramdisk\n"); rd_len = rd_data = 0; } else if (select || genimg_has_config(images)) { -#if defined(CONFIG_FIT) +#if IMAGE_ENABLE_FIT if (select) { /* * If the init ramdisk comes from the FIT image and @@ -965,7 +965,7 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images, "0x%08lx\n", rd_addr); } -#if defined(CONFIG_FIT) +#if IMAGE_ENABLE_FIT } else { /* use FIT configuration provided in first bootm * command argument. If the property is not defined, @@ -1008,7 +1008,7 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images, rd_load = image_get_load(rd_hdr); break; #endif -#if defined(CONFIG_FIT) +#if IMAGE_ENABLE_FIT case IMAGE_FORMAT_FIT: rd_noffset = fit_image_load(images, rd_addr, &fit_uname_ramdisk, @@ -1184,14 +1184,14 @@ error: int boot_get_setup(bootm_headers_t *images, uint8_t arch, ulong *setup_start, ulong *setup_len) { -#if defined(CONFIG_FIT) +#if IMAGE_ENABLE_FIT return boot_get_setup_fit(images, arch, setup_start, setup_len); #else return -ENOENT; #endif } -#if defined(CONFIG_FIT) +#if IMAGE_ENABLE_FIT int boot_get_loadable(int argc, char * const argv[], bootm_headers_t *images, uint8_t arch, const ulong *ld_start, ulong * const ld_len) { -- cgit v1.2.1