]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - include/image.h
Merge tag 'xilinx-for-v2017.07' of git://www.denx.de/git/u-boot-microblaze
[people/ms/u-boot.git] / include / image.h
index 6207d62d3c38da17b579ba8fef1ec036a0e85f3b..fcfe730204a63e54f9063ad270050e84a0d1d540 100644 (file)
@@ -29,6 +29,9 @@ struct lmb;
 #define IMAGE_ENABLE_FIT       1
 #define IMAGE_ENABLE_OF_LIBFDT 1
 #define CONFIG_FIT_VERBOSE     1 /* enable fit_format_{error,warning}() */
+#define CONFIG_FIT_ENABLE_SHA256_SUPPORT
+#define CONFIG_SHA1
+#define CONFIG_SHA256
 
 #define IMAGE_ENABLE_IGNORE    0
 #define IMAGE_INDENT_STRING    ""
@@ -62,25 +65,13 @@ struct lmb;
 #  ifdef CONFIG_SPL_SHA1_SUPPORT
 #   define IMAGE_ENABLE_SHA1   1
 #  endif
-#  ifdef CONFIG_SPL_SHA256_SUPPORT
-#   define IMAGE_ENABLE_SHA256 1
-#  endif
 # else
 #  define CONFIG_CRC32         /* FIT images need CRC32 support */
-#  define CONFIG_MD5           /* and MD5 */
-#  define CONFIG_SHA1          /* and SHA1 */
-#  define CONFIG_SHA256                /* and SHA256 */
 #  define IMAGE_ENABLE_CRC32   1
 #  define IMAGE_ENABLE_MD5     1
 #  define IMAGE_ENABLE_SHA1    1
-#  define IMAGE_ENABLE_SHA256  1
 # endif
 
-#ifdef CONFIG_FIT_DISABLE_SHA256
-#undef CONFIG_SHA256
-#undef IMAGE_ENABLE_SHA256
-#endif
-
 #ifndef IMAGE_ENABLE_CRC32
 #define IMAGE_ENABLE_CRC32     0
 #endif
@@ -93,18 +84,15 @@ struct lmb;
 #define IMAGE_ENABLE_SHA1      0
 #endif
 
-#ifndef IMAGE_ENABLE_SHA256
+#if defined(CONFIG_FIT_ENABLE_SHA256_SUPPORT) || \
+       defined(CONFIG_SPL_SHA256_SUPPORT)
+#define IMAGE_ENABLE_SHA256    1
+#else
 #define IMAGE_ENABLE_SHA256    0
 #endif
 
 #endif /* IMAGE_ENABLE_FIT */
 
-#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
-# define IMAGE_ENABLE_RAMDISK_HIGH     1
-#else
-# define IMAGE_ENABLE_RAMDISK_HIGH     0
-#endif
-
 #ifdef CONFIG_SYS_BOOT_GET_CMDLINE
 # define IMAGE_BOOT_GET_CMDLINE                1
 #else
@@ -797,7 +785,8 @@ static inline int image_check_type(const image_header_t *hdr, uint8_t type)
 }
 static inline int image_check_arch(const image_header_t *hdr, uint8_t arch)
 {
-       return (image_get_arch(hdr) == arch);
+       return (image_get_arch(hdr) == arch) ||
+               (image_get_arch(hdr) == IH_ARCH_ARM && arch == IH_ARCH_ARM64);
 }
 static inline int image_check_os(const image_header_t *hdr, uint8_t os)
 {
@@ -872,6 +861,8 @@ int bootz_setup(ulong image, ulong *start, ulong *end);
 
 /* image node */
 #define FIT_DATA_PROP          "data"
+#define FIT_DATA_OFFSET_PROP   "data-offset"
+#define FIT_DATA_SIZE_PROP     "data-size"
 #define FIT_TIMESTAMP_PROP     "timestamp"
 #define FIT_DESC_PROP          "description"
 #define FIT_ARCH_PROP          "arch"
@@ -950,6 +941,8 @@ int fit_image_get_load(const void *fit, int noffset, ulong *load);
 int fit_image_get_entry(const void *fit, int noffset, ulong *entry);
 int fit_image_get_data(const void *fit, int noffset,
                                const void **data, size_t *size);
+int fit_image_get_data_offset(const void *fit, int noffset, int *data_offset);
+int fit_image_get_data_size(const void *fit, int noffset, int *data_size);
 
 int fit_image_hash_get_algo(const void *fit, int noffset, char **algo);
 int fit_image_hash_get_value(const void *fit, int noffset, uint8_t **value,
@@ -1259,7 +1252,8 @@ void android_print_contents(const struct andr_img_hdr *hdr);
  */
 int board_fit_config_name_match(const char *name);
 
-#ifdef CONFIG_SPL_FIT_IMAGE_POST_PROCESS
+#if defined(CONFIG_SPL_FIT_IMAGE_POST_PROCESS) || \
+       defined(CONFIG_FIT_IMAGE_POST_PROCESS)
 /**
  * board_fit_image_post_process() - Do any post-process on FIT binary data
  *