diff options
author | Simon Glass <sjg@chromium.org> | 2013-05-08 08:05:59 +0000 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2013-05-14 15:37:25 -0400 |
commit | 87ebee39e9d02dba6d36d03d512e7d6e8a5a9abb (patch) | |
tree | 1c16027b1c940721a9dd7e532b7e3a334ba31ab4 /common | |
parent | 1fe7d93891905b9af1d81c9aef7b5646452ceb41 (diff) | |
download | u-boot-imx-87ebee39e9d02dba6d36d03d512e7d6e8a5a9abb.zip u-boot-imx-87ebee39e9d02dba6d36d03d512e7d6e8a5a9abb.tar.gz u-boot-imx-87ebee39e9d02dba6d36d03d512e7d6e8a5a9abb.tar.bz2 |
image: Add CONFIG_FIT_SPL_PRINT to control FIT image printing in SPL
This code is very large, and in SPL it isn't always useful to print
out image information (in fact there might not even be a console
active). So disable this feature unless this option is set.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/image-fit.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/common/image-fit.c b/common/image-fit.c index ec7b038..254feec 100644 --- a/common/image-fit.c +++ b/common/image-fit.c @@ -124,6 +124,7 @@ static void fit_get_debug(const void *fit, int noffset, fdt_strerror(err)); } +#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_FIT_SPL_PRINT) /** * fit_print_contents - prints out the contents of the FIT format image * @fit: pointer to the FIT format image header @@ -402,6 +403,7 @@ void fit_image_print(const void *fit, int image_noffset, const char *p) } } } +#endif /** * fit_get_desc - get node description property @@ -852,16 +854,16 @@ int fit_set_timestamp(void *fit, int noffset, time_t timestamp) int calculate_hash(const void *data, int data_len, const char *algo, uint8_t *value, int *value_len) { - if (strcmp(algo, "crc32") == 0) { + if (IMAGE_ENABLE_CRC32 && strcmp(algo, "crc32") == 0) { *((uint32_t *)value) = crc32_wd(0, data, data_len, CHUNKSZ_CRC32); *((uint32_t *)value) = cpu_to_uimage(*((uint32_t *)value)); *value_len = 4; - } else if (strcmp(algo, "sha1") == 0) { + } else if (IMAGE_ENABLE_SHA1 && strcmp(algo, "sha1") == 0) { sha1_csum_wd((unsigned char *)data, data_len, (unsigned char *)value, CHUNKSZ_SHA1); *value_len = 20; - } else if (strcmp(algo, "md5") == 0) { + } else if (IMAGE_ENABLE_MD5 && strcmp(algo, "md5") == 0) { md5_wd((unsigned char *)data, data_len, value, CHUNKSZ_MD5); *value_len = 16; } else { |