[PATCH v4 1/5] spl: mmc: Support OP-TEE payloads in Falcon mode

Alex G. mr.nuke.me at gmail.com
Thu Jul 15 21:11:07 CEST 2021



On 7/15/21 1:27 PM, Patrick DELAUNAY wrote:
> Hi,

[snip]

> When I merge this patch on master branch, I get the error:
> 
> arm:  +   imx6dl_mamoj
> +spl/u-boot-spl.bin exceeds file size limit:
> +  limit:  0xefa0 bytes
> +  actual: 0xf41d bytes
> +  excess: 0x47d bytes
> +make[1]: *** [Makefile:1997: spl/u-boot-spl.bin] Error 1
> +make[1]: *** Deleting file 'spl/u-boot-spl.bin'
> +make: *** [Makefile:177: sub-make] Error 2

> This issue need to be solved before I accept and merge the serie.

Okay, I'll have to drop the call to genimg_get_os_name().


> But I think again about the title of this patch :
> 
> - spl: mmc: Support OP-TEE payloads in Falcon mode
> 
> 
> If I unterstood after the serie the sequence for MMC is:
> 
>       ROM code => SPL => TEE (as raw OS) => U-Boot
> 
> 
> but it is not really the Falcon mode and
> OP-TEE + falcon mode is not really supported...
> 
> 
> And the patch title is disturbing.
> 
> 
> For me the correct sequence is in Falcon mode is :
> 
>      ROM code => SPL => TEE (secure world) => kernel (normal world)
> 

This is exactly the use case that this patch intends to support.

> 
> With the TEE and the kernel loaded by the SPL......
> 
> 
> and without falcon mode :
> 
> (A)    ROM code => SPL => TEE (secure world) => U-Boot
> 
> or
> 
> (B)    ROM code => SPL (TZ) => U-Boot (TZ) execute bootm => TEE (secure 
> world) => kernel
> 
> 
> what it your expected sequence in spl_load_simple_fit in this serie / in 
> your defconfig ?
> 
> Today with the normal world address can be:
> 
> 1/ = spl_image->entry_point (bootm_os.c in U-Boot proprer)
> 
> 2/ = CONFIG_SYS_TEXT_BASE (hardcoded for SPL in spl_optee.S)
> 
> 
> for 2/ When U-Boot is not used after SPL =  in falcon mode,
> 
> the LR register shoud be set to kernel entry point.

How does SPL know where OP-TEE should jump to? One could parse the FIT 
image, and try to figure out which of the loadables is the kernel. But 
what if there's a linux and u-boot, with different "/configurations" 
nodes? Figuring out where OP-TEE wants to start the normal world is a 
hard problem that the u=boot infrastructure is not prepared for.

The solution I'm using is to build OP-TEE with
	CFG_NS_ENTRY_ADDR=[linux entry addr]

Then LR is irrelevant.

Alex


More information about the U-Boot mailing list