[PATCH v3 07/13] arm: stm32mp: bsec: Update OTP shadow registers in SPL

Alexandru Gagniuc mr.nuke.me at gmail.com
Fri Oct 8 21:56:49 CEST 2021

For TFABOOT and SPL_BUILD, stm32mp_bsec_probe() skipped updating the
OTP shadow registers. The idea 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, do not skip this step for SPL_BUILD. Note that because SPL is
now doing this step, we no longer need to do it in u-boot. The new
logic is "let the FSBL do it", which is simpler.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me at gmail.com>
 arch/arm/mach-stm32mp/bsec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-stm32mp/bsec.c b/arch/arm/mach-stm32mp/bsec.c
index fe39bd80cf..41ed5f3cf5 100644
--- a/arch/arm/mach-stm32mp/bsec.c
+++ b/arch/arm/mach-stm32mp/bsec.c
@@ -503,10 +503,10 @@ static int stm32mp_bsec_probe(struct udevice *dev)
 	 * update unlocked shadow for OTP cleared by the rom code
-	 * only executed in U-Boot proper when TF-A is not used
+	 * Executed only by FSBL (SPL or TF-A)
 		plat = dev_get_plat(dev);
 		for (otp = 57; otp <= BSEC_OTP_MAX_VALUE; otp++)

More information about the U-Boot mailing list