[PATCH] mkimage: fit_image: Make fit header and data align to 512
Punit Agrawal
punit1.agrawal at toshiba.co.jp
Mon Mar 16 04:08:33 CET 2020
Hi Kever,
Kever Yang <kever.yang at rock-chips.com> writes:
> The image is usually stored in block device like emmc, SD card, make the
> offset of image data aligned to block(512 byte) can avoid data copy
> during boot process.
> eg. SPL boot from FIT image with external data:
> - SPL read the first block of FIT image, and then parse the header;
> - SPL read image data separately;
> - The first image offset is the base_offset which is the header size;
> - The second image offset is just after the first image;
> - If the offset of imge does not aligned, SPL will do memcpy;
> The header size is a ramdon number, which is very possible not aligned, so
> add align for FIT header and image data for better performance.
>
> SPI device do not need to enable this feature.
This seems like a nice improvement.
I had a few minor comments to help readability.
>
> Signed-off-by: Kever Yang <kever.yang at rock-chips.com>
> ---
>
> doc/uImage.FIT/source_file_format.txt | 5 +++++
> tools/fit_image.c | 16 +++++++++++-----
> tools/imagetool.h | 1 +
> tools/mkimage.c | 8 ++++++--
> 4 files changed, 23 insertions(+), 7 deletions(-)
>
[...]
> diff --git a/tools/imagetool.h b/tools/imagetool.h
> index e1c778b0df..e098cb41cc 100644
> --- a/tools/imagetool.h
> +++ b/tools/imagetool.h
> @@ -40,6 +40,7 @@ struct content_info {
> * type specific functions
> */
> struct image_tool_params {
> + int bflag;
To improve readability of code, please consider naming the newly added
flag to something more descriptive, e.g. "block_align_flag" or
"align_flag", in future versions of the patch.
> int dflag;
> int eflag;
> int fflag;
> diff --git a/tools/mkimage.c b/tools/mkimage.c
> index 5f51d2cc89..03b357f869 100644
> --- a/tools/mkimage.c
> +++ b/tools/mkimage.c
> @@ -97,8 +97,9 @@ static void usage(const char *msg)
> " -i => input filename for ramdisk file\n");
> #ifdef CONFIG_FIT_SIGNATURE
> fprintf(stderr,
> - "Signing / verified boot options: [-E] [-k keydir] [-K dtb] [ -c <comment>] [-p addr] [-r] [-N engine]\n"
> + "Signing / verified boot options: [-E] [-B] [-k keydir] [-K dtb] [ -c <comment>] [-p addr] [-r] [-N engine]\n"
> " -E => place data outside of the FIT structure\n"
> + " -B => truncate FIT structure and header to block\n"
"align"
> " -k => set directory containing private keys\n"
> " -K => write public keys to this .dtb file\n"
> " -c => add comment in signature node\n"
Thanks,
Punit
[...]
More information about the U-Boot
mailing list