Hi Jonas,

On 2026-07-13T10:02:41, Alexey Charkov <[email protected]> wrote:
> rockchip: mkimage: Print boot0 and boot1 parameters
>
> The v2 image format embeds boot0 and boot1 parameters, the vendor tool
> boot_merger may write these parameters based on the rkboot miniall.ini
> files.
>
> E.g. a RK3576 boot image may contain a boot1 parameter that signals
> BootROM or vendor blobs to use 1 GHz instead of the regular 24 MHz rate
> for the high precision timer.
>
> Add support for printing boot0 and boot1 parameters, e.g.:
>
>   > tools/mkimage -l rk3576_idblock_v1.09.107.img
>   Rockchip Boot Image (v2)
>   Boot1 2: 0x100
>   Image 1: 4096 @ 0x1000
>   - Load address: 0x3ffc0000
>   Image 2: 77824 @ 0x2000
>   - Load address: 0x3ff81000
>   Image 3: 262144 @ 0x15000
> [...]
>
> tools/rkcommon.c | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)

> diff --git a/tools/rkcommon.c b/tools/rkcommon.c
> @@ -62,6 +62,8 @@ struct image_entry {
>   * @boot_flag:       [3:0] hash type (0:none, 1:sha256, 2:sha512)
>   * @images:  images
>   * @hash:    hash or signature for header info
> + *
> + * Other fields are not used by U-Boot

This patch makes U-Boot read boot0_param and boot1_param, so they are
no longer covered by the 'Other fields' note. Please can you add
@boot0_param and @boot1_param lines to the comment, at least noting
that their meaning is defined by the vendor boot_merger tool?

> diff --git a/tools/rkcommon.c b/tools/rkcommon.c
> @@ -510,6 +514,18 @@ static void rkcommon_print_header_v2(const struct 
> header0_info_v2 *hdr)
> +     for (i = 0; i < ARRAY_SIZE(hdr->boot0_param); i++) {
> +             val = le32_to_cpu(hdr->boot0_param[i]);
> +             if (val)
> +                     printf("Boot0 %d: 0x%x\n", i, val);
> +     }

Just to check, the image lines added in patch 2 use the 1-based counter
value, while these use the 0-based array index, so 'Boot1 2' in the
example output is actually the third parameter word. Is that
intentional? Using the same base for both would avoid confusion when
comparing against the vendor ini files, which number things from 1.

Regards,
Simon

Reply via email to