[PATCH 2/4] misc: k3_fuse: Check readback on fuse prog
Anshul Dalal
anshuld at ti.com
Thu Feb 26 06:48:13 CET 2026
From: Vignesh Raghavendra <vigneshr at ti.com>
Error out if readback value doesn't match the programmed value.
Signed-off-by: Vignesh Raghavendra <vigneshr at ti.com>
Signed-off-by: Anshul Dalal <anshuld at ti.com>
---
drivers/misc/k3_fuse.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/misc/k3_fuse.c b/drivers/misc/k3_fuse.c
index cefdedaf411..882fd431659 100644
--- a/drivers/misc/k3_fuse.c
+++ b/drivers/misc/k3_fuse.c
@@ -52,8 +52,15 @@ int fuse_prog(u32 bank, u32 word, u32 val)
arm_smccc_smc(K3_SIP_OTP_WRITE, word,
val, mask, 0, 0, 0, 0, &res);
- if (res.a0 != 0)
+ if (res.a0 != 0) {
printf("SMC call failed: Error code %ld\n", res.a0);
+ return res.a0;
+ }
+
+ if (res.a1 != val) {
+ printf("Readback failed, written 0x%x readback 0x%lx\n", val, res.a1);
+ return -EINVAL;
+ }
return res.a0;
}
--
2.52.0
More information about the U-Boot
mailing list