aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-stm32mp/bsec.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-06-20 08:09:24 -0400
committerTom Rini <trini@konsulko.com>2022-06-20 08:09:24 -0400
commit2f7821a9278e710b2e825018303c2942f920a77d (patch)
tree8e4d97bcd17960370457134c0770276e5fecc209 /arch/arm/mach-stm32mp/bsec.c
parenta9e90d357bbf539e07c1d971161e027eb335183e (diff)
parenteae488b77906692627622abc61f5b7160b6eb2a4 (diff)
downloadu-boot-2f7821a9278e710b2e825018303c2942f920a77d.zip
u-boot-2f7821a9278e710b2e825018303c2942f920a77d.tar.gz
u-boot-2f7821a9278e710b2e825018303c2942f920a77d.tar.bz2
Merge tag 'u-boot-stm32-20220620' of https://source.denx.de/u-boot/custodians/u-boot-stm into next
- Add STM32MP13 SoCs support with associated board STM32M135F-DK - Correct livetree support in stm32mp1 boards - Activate livetree for stm32mp15 DHSOM boards
Diffstat (limited to 'arch/arm/mach-stm32mp/bsec.c')
-rw-r--r--arch/arm/mach-stm32mp/bsec.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm/mach-stm32mp/bsec.c b/arch/arm/mach-stm32mp/bsec.c
index 506caa0..c00130b 100644
--- a/arch/arm/mach-stm32mp/bsec.c
+++ b/arch/arm/mach-stm32mp/bsec.c
@@ -632,3 +632,20 @@ bool bsec_dbgswenable(void)
return false;
}
+
+u32 get_otp(int index, int shift, int mask)
+{
+ int ret;
+ struct udevice *dev;
+ u32 otp = 0;
+
+ ret = uclass_get_device_by_driver(UCLASS_MISC,
+ DM_DRIVER_GET(stm32mp_bsec),
+ &dev);
+
+ if (!ret)
+ ret = misc_read(dev, STM32_BSEC_SHADOW(index),
+ &otp, sizeof(otp));
+
+ return (otp >> shift) & mask;
+}