[PATCH v4 11/11] arm: mach-k3: r5: common: Invoke boot of HSM M4 core

Simon Glass sjg at chromium.org
Thu Apr 30 02:01:53 CEST 2026


Hi Beleswar,

On 2026-04-25T03:37:39, Padhi, Beleswar <b-padhi at ti.com> wrote:
> arm: mach-k3: r5: common: Invoke boot of HSM M4 core
>
> The tispl.bin fit image is packed with the HSM firmware image. Populate
> the 'os' info of the image so that it can be detected and used to load
> the HSM core. Further, invoke the load and boot of HSM core at R5 SPL
> stage using the remoteprocessor framework.
>
> Signed-off-by: Beleswar Padhi <b-padhi at ti.com>
>
> arch/arm/mach-k3/r5/common.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)

> diff --git a/arch/arm/mach-k3/r5/common.c b/arch/arm/mach-k3/r5/common.c
> @@ -158,6 +160,20 @@ void __noreturn jump_to_image(struct spl_image_info *spl_image)
> +     if (IS_ENABLED(CONFIG_REMOTEPROC_TI_K3_HSM_M4F)) {
> +             ret = rproc_load(2, fit_image_info[IMAGE_ID_HSM].load,
> +                              fit_image_info[IMAGE_ID_HSM].image_len);
> +             if (ret) {
> +                     panic("Error while loading HSM firmware, ret = %d\n", ret);
> +             } else {
> +                     ret = rproc_start(2);
> +                     if (ret)
> +                             panic("Error while starting HSM core\n");
> +                     else
> +                             printf("Successfully loaded and started HSM core\n");
> +             }
> +     }

panic() is __noreturn, so how about:

   ret = rproc_load(2, ...);
   if (ret)
           panic("Error while loading HSM firmware, ret = %d\n", ret);

   ret = rproc_start(2);
   if (ret)
           panic("Error while starting HSM core, ret = %d\n", ret);

   printf("Successfully loaded and started HSM core\n");

> diff --git a/arch/arm/mach-k3/r5/common.c b/arch/arm/mach-k3/r5/common.c
> @@ -158,6 +160,20 @@ void __noreturn jump_to_image(struct spl_image_info *spl_image)
> +             ret = rproc_load(2, fit_image_info[IMAGE_ID_HSM].load,
> +                              fit_image_info[IMAGE_ID_HSM].image_len);

The bare 2 here mirrors the bare 1 below, which at least has a comment
explaining the DT alias assumption ("It is assumed that remoteproc
device 1 is …"). Please add an equivalent comment for the HSM,
pointing at the 'remoteproc2 = &hsm' alias added in patch 9.

> diff --git a/arch/arm/mach-k3/r5/common.c b/arch/arm/mach-k3/r5/common.c
> @@ -158,6 +160,20 @@ void __noreturn jump_to_image(struct spl_image_info *spl_image)
> +             ret = rproc_load(2, fit_image_info[IMAGE_ID_HSM].load,
> +                              fit_image_info[IMAGE_ID_HSM].image_len);

Just to check: on HS-SE/HS-FS, board_fit_image_post_process() already
invokes ti_secure_image_post_process() on the HSM image (since
IMAGE_ID_HSM is not in the ATF/OPTEE skip list), and then
k3_hsm_load() in patch 10 calls ti_secure_image_post_process() a
second time on &addr. Is this intentional? It looks like the image is
post-processed twice on HS devices. If so, please mention it in the
commit message; otherwise one of the two calls should go.

Also, image_len recorded in fit_image_info[] is the pre-post-process
size (set before the HS-side post_process runs), but 'load' is the
original FIT data address - so on HS, the (load, image_len) pair you
pass to rproc_load() may not describe what is actually sitting at that
address after the first post_process. Worth checking on a HS-SE board.

Reviewed-by: Simon Glass <sjg at chromium.org>

Regards,
Simon


More information about the U-Boot mailing list