1 /*
2 * Copyright (c) 2024, STMicroelectronics - All Rights Reserved
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7 #ifndef STM32MP2_PRIVATE_H
8 #define STM32MP2_PRIVATE_H
9
10 /* Wrappers for OTP / BSEC functions */
stm32_otp_probe(void)11 static inline uint32_t stm32_otp_probe(void)
12 {
13 return bsec_probe();
14 }
15
stm32_otp_read(uint32_t * val,uint32_t otp)16 static inline uint32_t stm32_otp_read(uint32_t *val, uint32_t otp)
17 {
18 return bsec_read_otp(val, otp);
19 }
20
stm32_otp_shadow_read(uint32_t * val,uint32_t otp)21 static inline uint32_t stm32_otp_shadow_read(uint32_t *val, uint32_t otp)
22 {
23 return bsec_shadow_read_otp(val, otp);
24 }
25
stm32_otp_write(uint32_t val,uint32_t otp)26 static inline uint32_t stm32_otp_write(uint32_t val, uint32_t otp)
27 {
28 return bsec_write_otp(val, otp);
29 }
30
stm32_otp_set_sr_lock(uint32_t otp)31 static inline uint32_t stm32_otp_set_sr_lock(uint32_t otp)
32 {
33 return bsec_set_sr_lock(otp);
34 }
35
stm32_otp_read_sw_lock(uint32_t otp,bool * value)36 static inline uint32_t stm32_otp_read_sw_lock(uint32_t otp, bool *value)
37 {
38 return bsec_read_sw_lock(otp, value);
39 }
40
stm32_otp_is_closed_device(void)41 static inline bool stm32_otp_is_closed_device(void)
42 {
43 return bsec_mode_is_closed_device();
44 }
45
46 #endif /* STM32MP2_PRIVATE_H */
47