diff mbox series

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

Message ID 20211008195655.46046-8-mr.nuke.me@gmail.com
State Deferred
Delegated to: Tom Rini
Headers show
Series stm32mp1: Support falcon mode with OP-TEE payloads | expand

Commit Message

Alex G. Oct. 8, 2021, 7:56 p.m. UTC
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@gmail.com>
---
 arch/arm/mach-stm32mp/bsec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

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)
 	 */
 
-	if (!IS_ENABLED(CONFIG_TFABOOT) && !IS_ENABLED(CONFIG_SPL_BUILD)) {
+	if (IS_ENABLED(CONFIG_SPL_BUILD)) {
 		plat = dev_get_plat(dev);
 
 		for (otp = 57; otp <= BSEC_OTP_MAX_VALUE; otp++)