image: Drop IMAGE_ENABLE_FIT

Make use of the host Kconfig for FIT. With this we can use
CONFIG_IS_ENABLED(FIT) directly in the host build, so drop the unnecessary
indirection.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
This commit is contained in:
Simon Glass
2021-09-25 19:43:20 -06:00
committed by Tom Rini
parent d54f7e3f23
commit bf371b4cf5
5 changed files with 23 additions and 24 deletions

View File

@@ -591,7 +591,7 @@ static ulong get_image_ivt_offset(ulong img_addr)
return (image_get_image_size((image_header_t *)img_addr) return (image_get_image_size((image_header_t *)img_addr)
+ 0x1000 - 1) & ~(0x1000 - 1); + 0x1000 - 1) & ~(0x1000 - 1);
#endif #endif
#if IMAGE_ENABLE_FIT #if CONFIG_IS_ENABLED(FIT)
case IMAGE_FORMAT_FIT: case IMAGE_FORMAT_FIT:
return (fit_get_size(buf) + 0x1000 - 1) & ~(0x1000 - 1); return (fit_get_size(buf) + 0x1000 - 1) & ~(0x1000 - 1);
#endif #endif

View File

@@ -115,7 +115,7 @@ static int bootm_find_os(struct cmd_tbl *cmdtp, int flag, int argc,
images.os.arch = image_get_arch(os_hdr); images.os.arch = image_get_arch(os_hdr);
break; break;
#endif #endif
#if IMAGE_ENABLE_FIT #if CONFIG_IS_ENABLED(FIT)
case IMAGE_FORMAT_FIT: case IMAGE_FORMAT_FIT:
if (fit_image_get_type(images.fit_hdr_os, if (fit_image_get_type(images.fit_hdr_os,
images.fit_noffset_os, images.fit_noffset_os,
@@ -187,7 +187,7 @@ static int bootm_find_os(struct cmd_tbl *cmdtp, int flag, int argc,
/* Kernel entry point is the setup.bin */ /* Kernel entry point is the setup.bin */
} else if (images.legacy_hdr_valid) { } else if (images.legacy_hdr_valid) {
images.ep = image_get_ep(&images.legacy_hdr_os_copy); images.ep = image_get_ep(&images.legacy_hdr_os_copy);
#if IMAGE_ENABLE_FIT #if CONFIG_IS_ENABLED(FIT)
} else if (images.fit_uname_os) { } else if (images.fit_uname_os) {
int ret; int ret;
@@ -295,7 +295,7 @@ int bootm_find_images(int flag, int argc, char *const argv[], ulong start,
set_working_fdt_addr(map_to_sysmem(images.ft_addr)); set_working_fdt_addr(map_to_sysmem(images.ft_addr));
#endif #endif
#if IMAGE_ENABLE_FIT #if CONFIG_IS_ENABLED(FIT)
if (IS_ENABLED(CONFIG_FPGA)) { if (IS_ENABLED(CONFIG_FPGA)) {
/* find bitstreams */ /* find bitstreams */
ret = boot_get_fpga(argc, argv, &images, IH_ARCH_DEFAULT, ret = boot_get_fpga(argc, argv, &images, IH_ARCH_DEFAULT,
@@ -858,7 +858,7 @@ static const void *boot_get_kernel(struct cmd_tbl *cmdtp, int flag, int argc,
const void *buf; const void *buf;
const char *fit_uname_config = NULL; const char *fit_uname_config = NULL;
const char *fit_uname_kernel = NULL; const char *fit_uname_kernel = NULL;
#if IMAGE_ENABLE_FIT #if CONFIG_IS_ENABLED(FIT)
int os_noffset; int os_noffset;
#endif #endif
@@ -916,7 +916,7 @@ static const void *boot_get_kernel(struct cmd_tbl *cmdtp, int flag, int argc,
bootstage_mark(BOOTSTAGE_ID_DECOMP_IMAGE); bootstage_mark(BOOTSTAGE_ID_DECOMP_IMAGE);
break; break;
#endif #endif
#if IMAGE_ENABLE_FIT #if CONFIG_IS_ENABLED(FIT)
case IMAGE_FORMAT_FIT: case IMAGE_FORMAT_FIT:
os_noffset = fit_image_load(images, img_addr, os_noffset = fit_image_load(images, img_addr,
&fit_uname_kernel, &fit_uname_config, &fit_uname_kernel, &fit_uname_config,

View File

@@ -282,7 +282,7 @@ int genimg_get_format(const void *img_addr)
if (image_check_magic(hdr)) if (image_check_magic(hdr))
return IMAGE_FORMAT_LEGACY; return IMAGE_FORMAT_LEGACY;
#endif #endif
#if IMAGE_ENABLE_FIT || IMAGE_ENABLE_OF_LIBFDT #if CONFIG_IS_ENABLED(FIT) || IMAGE_ENABLE_OF_LIBFDT
if (fdt_check_header(img_addr) == 0) if (fdt_check_header(img_addr) == 0)
return IMAGE_FORMAT_FIT; return IMAGE_FORMAT_FIT;
#endif #endif
@@ -307,7 +307,7 @@ int genimg_get_format(const void *img_addr)
*/ */
int genimg_has_config(bootm_headers_t *images) int genimg_has_config(bootm_headers_t *images)
{ {
#if IMAGE_ENABLE_FIT #if CONFIG_IS_ENABLED(FIT)
if (images->fit_uname_cfg) if (images->fit_uname_cfg)
return 1; return 1;
#endif #endif
@@ -348,7 +348,7 @@ int boot_get_ramdisk(int argc, char *const argv[], bootm_headers_t *images,
#ifdef CONFIG_SUPPORT_RAW_INITRD #ifdef CONFIG_SUPPORT_RAW_INITRD
char *end; char *end;
#endif #endif
#if IMAGE_ENABLE_FIT #if CONFIG_IS_ENABLED(FIT)
const char *fit_uname_config = images->fit_uname_cfg; const char *fit_uname_config = images->fit_uname_cfg;
const char *fit_uname_ramdisk = NULL; const char *fit_uname_ramdisk = NULL;
ulong default_addr; ulong default_addr;
@@ -380,7 +380,7 @@ int boot_get_ramdisk(int argc, char *const argv[], bootm_headers_t *images,
rd_len = 0; rd_len = 0;
rd_data = 0; rd_data = 0;
} else if (select || genimg_has_config(images)) { } else if (select || genimg_has_config(images)) {
#if IMAGE_ENABLE_FIT #if CONFIG_IS_ENABLED(FIT)
if (select) { if (select) {
/* /*
* If the init ramdisk comes from the FIT image and * If the init ramdisk comes from the FIT image and
@@ -409,7 +409,7 @@ int boot_get_ramdisk(int argc, char *const argv[], bootm_headers_t *images,
debug("* ramdisk: cmdline image address = 0x%08lx\n", debug("* ramdisk: cmdline image address = 0x%08lx\n",
rd_addr); rd_addr);
} }
#if IMAGE_ENABLE_FIT #if CONFIG_IS_ENABLED(FIT)
} else { } else {
/* use FIT configuration provided in first bootm /* use FIT configuration provided in first bootm
* command argument. If the property is not defined, * command argument. If the property is not defined,
@@ -450,7 +450,7 @@ int boot_get_ramdisk(int argc, char *const argv[], bootm_headers_t *images,
rd_load = image_get_load(rd_hdr); rd_load = image_get_load(rd_hdr);
break; break;
#endif #endif
#if IMAGE_ENABLE_FIT #if CONFIG_IS_ENABLED(FIT)
case IMAGE_FORMAT_FIT: case IMAGE_FORMAT_FIT:
rd_noffset = fit_image_load(images, rd_noffset = fit_image_load(images,
rd_addr, &fit_uname_ramdisk, rd_addr, &fit_uname_ramdisk,
@@ -623,14 +623,14 @@ error:
int boot_get_setup(bootm_headers_t *images, u8 arch, int boot_get_setup(bootm_headers_t *images, u8 arch,
ulong *setup_start, ulong *setup_len) ulong *setup_start, ulong *setup_len)
{ {
#if IMAGE_ENABLE_FIT #if CONFIG_IS_ENABLED(FIT)
return boot_get_setup_fit(images, arch, setup_start, setup_len); return boot_get_setup_fit(images, arch, setup_start, setup_len);
#else #else
return -ENOENT; return -ENOENT;
#endif #endif
} }
#if IMAGE_ENABLE_FIT #if CONFIG_IS_ENABLED(FIT)
#if defined(CONFIG_FPGA) #if defined(CONFIG_FPGA)
int boot_get_fpga(int argc, char *const argv[], bootm_headers_t *images, int boot_get_fpga(int argc, char *const argv[], bootm_headers_t *images,
u8 arch, const ulong *ld_start, ulong * const ld_len) u8 arch, const ulong *ld_start, ulong * const ld_len)

View File

@@ -18,7 +18,7 @@
#include <status_led.h> #include <status_led.h>
#endif #endif
#if IMAGE_ENABLE_FIT || IMAGE_ENABLE_OF_LIBFDT #if CONFIG_IS_ENABLED(FIT) || IMAGE_ENABLE_OF_LIBFDT
#include <linux/libfdt.h> #include <linux/libfdt.h>
#include <fdt_support.h> #include <fdt_support.h>
#endif #endif

View File

@@ -25,9 +25,9 @@ struct fdt_region;
#ifdef USE_HOSTCC #ifdef USE_HOSTCC
#include <sys/types.h> #include <sys/types.h>
#include <linux/kconfig.h>
/* new uImage format support enabled on host */ /* new uImage format support enabled on host */
#define IMAGE_ENABLE_FIT 1
#define IMAGE_ENABLE_OF_LIBFDT 1 #define IMAGE_ENABLE_OF_LIBFDT 1
#define CONFIG_FIT_VERBOSE 1 /* enable fit_format_{error,warning}() */ #define CONFIG_FIT_VERBOSE 1 /* enable fit_format_{error,warning}() */
#define CONFIG_FIT_RSASSA_PSS 1 #define CONFIG_FIT_RSASSA_PSS 1
@@ -46,16 +46,15 @@ struct fdt_region;
#define IMAGE_ENABLE_IGNORE 1 #define IMAGE_ENABLE_IGNORE 1
#define IMAGE_INDENT_STRING " " #define IMAGE_INDENT_STRING " "
#define IMAGE_ENABLE_FIT CONFIG_IS_ENABLED(FIT)
#define IMAGE_ENABLE_OF_LIBFDT CONFIG_IS_ENABLED(OF_LIBFDT) #define IMAGE_ENABLE_OF_LIBFDT CONFIG_IS_ENABLED(OF_LIBFDT)
#endif /* USE_HOSTCC */ #endif /* USE_HOSTCC */
#if IMAGE_ENABLE_FIT #if CONFIG_IS_ENABLED(FIT)
#include <hash.h> #include <hash.h>
#include <linux/libfdt.h> #include <linux/libfdt.h>
#include <fdt_support.h> #include <fdt_support.h>
#endif /* IMAGE_ENABLE_FIT */ #endif /* FIT */
#ifdef CONFIG_SYS_BOOT_GET_CMDLINE #ifdef CONFIG_SYS_BOOT_GET_CMDLINE
# define IMAGE_BOOT_GET_CMDLINE 1 # define IMAGE_BOOT_GET_CMDLINE 1
@@ -328,7 +327,7 @@ typedef struct bootm_headers {
image_header_t legacy_hdr_os_copy; /* header copy */ image_header_t legacy_hdr_os_copy; /* header copy */
ulong legacy_hdr_valid; ulong legacy_hdr_valid;
#if IMAGE_ENABLE_FIT #if CONFIG_IS_ENABLED(FIT)
const char *fit_uname_cfg; /* configuration node unit name */ const char *fit_uname_cfg; /* configuration node unit name */
void *fit_hdr_os; /* os FIT image header */ void *fit_hdr_os; /* os FIT image header */
@@ -983,7 +982,7 @@ int booti_setup(ulong image, ulong *relocated_addr, ulong *size,
#define FIT_MAX_HASH_LEN HASH_MAX_DIGEST_SIZE #define FIT_MAX_HASH_LEN HASH_MAX_DIGEST_SIZE
#if IMAGE_ENABLE_FIT #if CONFIG_IS_ENABLED(FIT)
/* cmdline argument format parsing */ /* cmdline argument format parsing */
int fit_parse_conf(const char *spec, ulong addr_curr, int fit_parse_conf(const char *spec, ulong addr_curr,
ulong *addr, const char **conf_name); ulong *addr, const char **conf_name);
@@ -1157,7 +1156,7 @@ int fit_conf_get_prop_node(const void *fit, int noffset,
int fit_check_ramdisk(const void *fit, int os_noffset, int fit_check_ramdisk(const void *fit, int os_noffset,
uint8_t arch, int verify); uint8_t arch, int verify);
#endif /* IMAGE_ENABLE_FIT */ #endif /* FIT */
int calculate_hash(const void *data, int data_len, const char *algo, int calculate_hash(const void *data, int data_len, const char *algo,
uint8_t *value, int *value_len); uint8_t *value, int *value_len);
@@ -1180,7 +1179,7 @@ int calculate_hash(const void *data, int data_len, const char *algo,
# define FIT_IMAGE_ENABLE_VERIFY CONFIG_IS_ENABLED(FIT_SIGNATURE) # define FIT_IMAGE_ENABLE_VERIFY CONFIG_IS_ENABLED(FIT_SIGNATURE)
#endif #endif
#if IMAGE_ENABLE_FIT #if CONFIG_IS_ENABLED(FIT)
#ifdef USE_HOSTCC #ifdef USE_HOSTCC
void *image_get_host_blob(void); void *image_get_host_blob(void);
void image_set_host_blob(void *host_blob); void image_set_host_blob(void *host_blob);
@@ -1335,7 +1334,7 @@ struct crypto_algo *image_get_crypto_algo(const char *full_name);
*/ */
struct padding_algo *image_get_padding_algo(const char *name); struct padding_algo *image_get_padding_algo(const char *name);
#if IMAGE_ENABLE_FIT #if CONFIG_IS_ENABLED(FIT)
/** /**
* fit_image_verify_required_sigs() - Verify signatures marked as 'required' * fit_image_verify_required_sigs() - Verify signatures marked as 'required'