[PATCH 05/10] arm: stm32mp: bsec: Do not skip .probe() for SPL
Patrick DELAUNAY
patrick.delaunay at foss.st.com
Tue Aug 31 18:54:19 CEST 2021
Hi
On 8/26/21 11:42 PM, Alexandru Gagniuc wrote:
> stm32mp_bsec_probe() was skipped for TFABOOT and SPL_BUILD. The idea
> of skipping probe() is that we can't access BSEC from the normal
> world. This is true with TFABOOT. However, in SPL, we are in the
> secure world, so skipping probe is incorrect. In fact, SPL is not
> even built when TFABOOT is selected.
>
> Thus, only skip probe with TFABOOT, but not SPL_BUILD.
>
> Signed-off-by: Alexandru Gagniuc <mr.nuke.me at gmail.com>
> ---
> arch/arm/mach-stm32mp/bsec.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-stm32mp/bsec.c b/arch/arm/mach-stm32mp/bsec.c
> index fe39bd80cf..a02d19c1b9 100644
> --- a/arch/arm/mach-stm32mp/bsec.c
> +++ b/arch/arm/mach-stm32mp/bsec.c
> @@ -506,7 +506,7 @@ static int stm32mp_bsec_probe(struct udevice *dev)
> * only executed in U-Boot proper when TF-A is not used
> */
>
> - if (!IS_ENABLED(CONFIG_TFABOOT) && !IS_ENABLED(CONFIG_SPL_BUILD)) {
> + if (!IS_ENABLED(CONFIG_TFABOOT)) {
> plat = dev_get_plat(dev);
>
> for (otp = 57; otp <= BSEC_OTP_MAX_VALUE; otp++)
in this part the dirver don't skip the BSEC probe (still return 0)
BUT the BSEC driver skip only the shadow of the OTP
=> this initialisation is necessary only one time to save time
a/ for TF-A boot it is done in TF-A
b/ for basic boot (SPL + U-Boot) is only done in U-Boot proper (because
is not mandatory in SPL
and the U-Boot execution was faster - before the data cache activation
in SPL)
With this patch the copy of the OTP in shadow memory is done 2 times
1/ in SPL (BSEC probe) = with CONFIG_SPL_BUILD
2/ in U-Boot (BSEC probe)
see comment:
/*
* update unlocked shadow for OTP cleared by the rom code
* only executed in U-Boot proper when TF-A is not used
*/
but for falcon mode, as the Linux driver expected the OTP are shadowed,
the operation need to be done in SPL and in U-Boot proper
I propose
/*
* update unlocked shadow for OTP cleared by the rom code
- * only executed in U-Boot proper when TF-A is not used
+ * only executed in U-Boot SPL, it is done in TF-A when used
*/
- if (!IS_ENABLED(CONFIG_TFABOOT) && !IS_ENABLED(CONFIG_SPL_BUILD)) {
+ if (IS_ENABLED(CONFIG_SPL_BUILD)) {
Regards
Patrick
More information about the U-Boot
mailing list