From a25d6b65c21b1298712c75604ff606025cb40267 Mon Sep 17 00:00:00 2001 From: Alexandru Gagniuc Date: Thu, 15 Jul 2021 14:19:24 -0500 Subject: spl: Introduce spl_board_prepare_for_optee() hook OP-TEE requires some particular setup, which is not needed for linux or other payloads. Add a hook for platform-specific code to perform any OP-TEE related configuration and initialization. A weak function is used because it is symmetrical to other spl_board_prepare_for_*() implementations. A solution to avoid the use of weak functions would trivially apply to all these implementations. However, re-designing this is beyond the scope of this patch. Signed-off-by: Alexandru Gagniuc Reviewed-by: Tom Rini Reviewed-by: Simon Glass Reviewed-by: Patrick Delaunay --- common/spl/spl.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'common') diff --git a/common/spl/spl.c b/common/spl/spl.c index 3ec16d0de6..d1b072d82c 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -167,6 +167,10 @@ __weak void spl_board_prepare_for_linux(void) /* Nothing to do! */ } +__weak void spl_board_prepare_for_optee(void *fdt) +{ +} + __weak void spl_board_prepare_for_boot(void) { /* Nothing to do! */ @@ -763,6 +767,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2) #if CONFIG_IS_ENABLED(OPTEE) case IH_OS_TEE: debug("Jumping to U-Boot via OP-TEE\n"); + spl_board_prepare_for_optee(spl_image.fdt_addr); spl_optee_entry(NULL, NULL, spl_image.fdt_addr, (void *)spl_image.entry_point); break; -- cgit v1.2.1