X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=common%2Fimage-fit.c;h=f6e956ad963a0d2a390c64bed812b23de9d4dbbc;hb=4bc4f8a67a17ba339f3e1bf75147f68e66c4a104;hp=7f17fd1410ed8a3b37e48f33f7ddf14dd4b54f65;hpb=08cebeeaadd9192dd501308ac6a8b858ffa255c1;p=people%2Fms%2Fu-boot.git diff --git a/common/image-fit.c b/common/image-fit.c index 7f17fd1410..f6e956ad96 100644 --- a/common/image-fit.c +++ b/common/image-fit.c @@ -330,7 +330,7 @@ static void fit_image_print_verification_data(const void *fit, int noffset, /* * Check subnode name, must be equal to "hash" or "signature". * Multiple hash/signature nodes require unique unit node - * names, e.g. hash@1, hash@2, signature@1, signature@2, etc. + * names, e.g. hash-1, hash-2, signature-1, signature-2, etc. */ name = fit_get_name(fit, noffset, NULL); if (!strncmp(name, FIT_HASH_NODENAME, strlen(FIT_HASH_NODENAME))) { @@ -806,6 +806,31 @@ int fit_image_get_data_offset(const void *fit, int noffset, int *data_offset) return 0; } +/** + * Get 'data-position' property from a given image node. + * + * @fit: pointer to the FIT image header + * @noffset: component image node offset + * @data_position: holds the data-position property + * + * returns: + * 0, on success + * -ENOENT if the property could not be found + */ +int fit_image_get_data_position(const void *fit, int noffset, + int *data_position) +{ + const fdt32_t *val; + + val = fdt_getprop(fit, noffset, FIT_DATA_POSITION_PROP, NULL); + if (!val) + return -ENOENT; + + *data_position = fdt32_to_cpu(*val); + + return 0; +} + /** * Get 'data-size' property from a given image node. * @@ -1086,7 +1111,7 @@ int fit_image_verify(const void *fit, int image_noffset) /* * Check subnode name, must be equal to "hash". * Multiple hash nodes require unique unit node - * names, e.g. hash@1, hash@2, etc. + * names, e.g. hash-1, hash-2, etc. */ if (!strncmp(name, FIT_HASH_NODENAME, strlen(FIT_HASH_NODENAME))) { @@ -1323,15 +1348,15 @@ int fit_check_format(const void *fit) * * / o image-tree * |-o images - * | |-o fdt@1 - * | |-o fdt@2 + * | |-o fdt-1 + * | |-o fdt-2 * | * |-o configurations - * |-o config@1 - * | |-fdt = fdt@1 + * |-o config-1 + * | |-fdt = fdt-1 * | - * |-o config@2 - * |-fdt = fdt@2 + * |-o config-2 + * |-fdt = fdt-2 * * / o U-Boot fdt * |-compatible = "foo,bar", "bim,bam"