diff options
| author | Vignesh Raghavendra <[email protected]> | 2026-02-26 11:18:15 +0530 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-03-13 14:58:27 -0600 |
| commit | 34c7bcacfab4a7efe83e0bad259fadc145be0046 (patch) | |
| tree | 6e1bca0f7552c40812e66e9b093959af73c253c3 /drivers | |
| parent | b533d457aee435b4c19505617ce5a05be6e7255b (diff) | |
misc: k3_fuse: Limit writes to 25bit values
K3 OTP bits can only be programmed 25bits at a time. Limit the value
accordingly using a 25 bit mask.
Signed-off-by: Vignesh Raghavendra <[email protected]>
Signed-off-by: Anshul Dalal <[email protected]>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/misc/k3_fuse.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/misc/k3_fuse.c b/drivers/misc/k3_fuse.c index d738f75f272..faafaffe07e 100644 --- a/drivers/misc/k3_fuse.c +++ b/drivers/misc/k3_fuse.c @@ -7,6 +7,7 @@ #include <stdio.h> #include <fuse.h> #include <linux/arm-smccc.h> +#include <linux/bitops.h> #include <string.h> #define K3_SIP_OTP_WRITEBUFF 0xC2000000 @@ -41,7 +42,6 @@ int fuse_sense(u32 bank, u32 word, u32 *val) int fuse_prog(u32 bank, u32 word, u32 val) { struct arm_smccc_res res; - u32 mask = val; if (bank != 0U) { printf("Invalid bank argument, ONLY bank 0 is supported\n"); @@ -49,8 +49,8 @@ int fuse_prog(u32 bank, u32 word, u32 val) } /* Make SiP SMC call and send the word, val and mask in the parameter register */ - arm_smccc_smc(K3_SIP_OTP_WRITE, word, - val, mask, 0, 0, 0, 0, &res); + arm_smccc_smc(K3_SIP_OTP_WRITE, bank, word, + val, GENMASK(25, 0), 0, 0, 0, &res); if (res.a0 != 0) { printf("SMC call failed: Error code %ld\n", res.a0); |
