Hi Jonas,

On 2026-07-13T10:02:41, Alexey Charkov <[email protected]> wrote:
> rockchip: mkimage: Add option to change image offset alignment
>
> The vendor boot_merger tool support a ALIGN parameter that is used to
> define offset alignment of the embedded images.
>
> Vendor use this for RK3576 to change offset alignment from the common
> 2 KiB to 4 KiB, presumably it may have something to do with UFS.
> Testing with eMMC has shown that using a 512-byte alignment also work.
>
> Add support for overriding offset alignment in case this is needed for
> e.g. RK3576 in the future.
>
> Signed-off-by: Jonas Karlman <[email protected]>
> Signed-off-by: Alexey Charkov <[email protected]>
>
> tools/rkcommon.c | 75 ++++++++++++++++++++++++++++++++++++--------------------
>  tools/rkcommon.h |  2 --
>  2 files changed, 49 insertions(+), 28 deletions(-)

> diff --git a/tools/rkcommon.c b/tools/rkcommon.c
> @@ -140,6 +140,7 @@ struct spl_info {
>       const uint32_t spl_size;
>       const bool spl_rc4;
>       const uint32_t header_ver;
> +     const uint32_t align;
>  };

The struct comment above documents each member, so please can you add
an @align line too, mentioning the units (512-byte blocks, matching the
vendor ALIGN parameter) and that 0 means the default 2 KiB alignment?

> diff --git a/tools/rkcommon.c b/tools/rkcommon.c
> @@ -625,7 +647,7 @@ int rkcommon_vrec_header(struct image_tool_params *params,
>        * 4 bytes of these images can safely be overwritten using the
>        * boot magic.
>        */
> -     tparams->header_size = RK_SPL_HDR_START;
> +     tparams->header_size = rkcommon_get_header_size(params);

The comment above this line still says "The header is always at 0x800",
but that is exactly what this patch changes - with an align override
the payload moves to 0x1000, as happens for rk3576 later in the series.
Please can you update it to say the header size depends on the header
version and the per-SoC alignment?

Regards,
Simon

Reply via email to