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 <sjg@chromium.org>
[trini: Add microblaze change, various configs/ re-applies]
Signed-off-by: Tom Rini <trini@konsulko.com>
diff --git a/include/image.h b/include/image.h
index 83653a4..02ca43b 100644
--- a/include/image.h
+++ b/include/image.h
@@ -26,7 +26,7 @@
#include <sys/types.h>
/* new uImage format support enabled on host */
-#define CONFIG_FIT 1
+#define IMAGE_ENABLE_FIT 1
#define CONFIG_FIT_VERBOSE 1 /* enable fit_format_{error,warning}() */
#define IMAGE_ENABLE_IGNORE 0
@@ -42,9 +42,11 @@
#define IMAGE_ENABLE_IGNORE 1
#define IMAGE_INDENT_STRING " "
+#define IMAGE_ENABLE_FIT CONFIG_IS_ENABLED(FIT)
+
#endif /* USE_HOSTCC */
-#if defined(CONFIG_FIT)
+#if IMAGE_ENABLE_FIT
#include <hash.h>
#include <libfdt.h>
#include <fdt_support.h>
@@ -93,7 +95,7 @@
#define IMAGE_ENABLE_SHA256 0
#endif
-#endif /* CONFIG_FIT */
+#endif /* IMAGE_ENABLE_FIT */
#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
# define IMAGE_ENABLE_RAMDISK_HIGH 1
@@ -308,7 +310,7 @@
image_header_t legacy_hdr_os_copy; /* header copy */
ulong legacy_hdr_valid;
-#if defined(CONFIG_FIT)
+#if IMAGE_ENABLE_FIT
const char *fit_uname_cfg; /* configuration node unit name */
void *fit_hdr_os; /* os FIT image header */
@@ -755,7 +757,7 @@
/*******************************************************************/
/* New uImage format specific code (prefixed with fit_) */
/*******************************************************************/
-#if defined(CONFIG_FIT)
+#if IMAGE_ENABLE_FIT
#define FIT_IMAGES_PATH "/images"
#define FIT_CONFS_PATH "/configurations"
@@ -951,6 +953,7 @@
int required_keynode; /* Node offset of key to use: -1=any */
const char *require_keys; /* Value for 'required' property */
};
+#endif /* Allow struct image_region to always be defined for rsa.h */
/* A part of an image, used for hashing */
struct image_region {
@@ -958,6 +961,8 @@
int size;
};
+#if IMAGE_ENABLE_FIT
+
#if IMAGE_ENABLE_VERIFY
# include <u-boot/rsa-checksum.h>
#endif