aboutsummaryrefslogtreecommitdiff
path: root/include/image.h
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-09-19 13:19:39 -0400
committerTom Rini <trini@konsulko.com>2022-09-19 16:07:12 -0400
commite9a1ff9724348408144c7f1c5b5cc26130ba46e5 (patch)
tree68b56f117206d121b4a7e567b0209c02283c98e6 /include/image.h
parentb6c50e5831f6ce3800d4b3cf3c7aa35dde8c48d9 (diff)
parentf76f3e3b44328fe6229650540109af93750fd5f0 (diff)
downloadu-boot-e9a1ff9724348408144c7f1c5b5cc26130ba46e5.zip
u-boot-e9a1ff9724348408144c7f1c5b5cc26130ba46e5.tar.gz
u-boot-e9a1ff9724348408144c7f1c5b5cc26130ba46e5.tar.bz2
Merge branch 'master' into next
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'include/image.h')
-rw-r--r--include/image.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/include/image.h b/include/image.h
index a148073..03424f0 100644
--- a/include/image.h
+++ b/include/image.h
@@ -1020,6 +1020,76 @@ int fit_image_get_data_size_unciphered(const void *fit, int noffset,
int fit_image_get_data_and_size(const void *fit, int noffset,
const void **data, size_t *size);
+/**
+ * fit_get_data_node() - Get verified image data for an image
+ * @fit: Pointer to the FIT format image header
+ * @image_uname: The name of the image node
+ * @data: A pointer which will be filled with the location of the image data
+ * @size: A pointer which will be filled with the size of the image data
+ *
+ * This function looks up the location and size of an image specified by its
+ * name. For example, if you had a FIT like::
+ *
+ * images {
+ * my-firmware {
+ * ...
+ * };
+ * };
+ *
+ * Then you could look up the data location and size of the my-firmware image
+ * by calling this function with @image_uname set to "my-firmware". This
+ * function also verifies the image data (if enabled) before returning. The
+ * image description is printed out on success. @data and @size will not be
+ * modified on faulure.
+ *
+ * Return:
+ * * 0 on success
+ * * -EINVAL if the image could not be verified
+ * * -ENOENT if there was a problem getting the data/size
+ * * Another negative error if there was a problem looking up the image node.
+ */
+int fit_get_data_node(const void *fit, const char *image_uname,
+ const void **data, size_t *size);
+
+/**
+ * fit_get_data_conf_prop() - Get verified image data for a property in /conf
+ * @fit: Pointer to the FIT format image header
+ * @prop_name: The name of the property in /conf referencing the image
+ * @data: A pointer which will be filled with the location of the image data
+ * @size: A pointer which will be filled with the size of the image data
+ *
+ * This function looks up the location and size of an image specified by a
+ * property in /conf. For example, if you had a FIT like::
+ *
+ * images {
+ * my-firmware {
+ * ...
+ * };
+ * };
+ *
+ * configurations {
+ * default = "conf-1";
+ * conf-1 {
+ * some-firmware = "my-firmware";
+ * };
+ * };
+ *
+ * Then you could look up the data location and size of the my-firmware image
+ * by calling this function with @prop_name set to "some-firmware". This
+ * function also verifies the image data (if enabled) before returning. The
+ * image description is printed out on success. @data and @size will not be
+ * modified on faulure.
+ *
+ * Return:
+ * * 0 on success
+ * * -EINVAL if the image could not be verified
+ * * -ENOENT if there was a problem getting the data/size
+ * * Another negative error if there was a problem looking up the configuration
+ * or image node.
+ */
+int fit_get_data_conf_prop(const void *fit, const char *prop_name,
+ const void **data, size_t *size);
+
int fit_image_hash_get_algo(const void *fit, int noffset, const char **algo);
int fit_image_hash_get_value(const void *fit, int noffset, uint8_t **value,
int *value_len);