blob: 2ab5001408166bcf20f5ea2927968aedb00dc6f6 [file] [log] [blame]
Yann Gautier06ae3962023-09-19 18:26:16 +02001/*
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
Yann Gautier8053f2b2024-05-21 11:46:59 +020010void configure_mmu(void);
11
Yann Gautierd58a3d22024-05-21 12:05:43 +020012uint32_t stm32mp_syscfg_get_chip_dev_id(void);
13
Yann Gautier06ae3962023-09-19 18:26:16 +020014/* Wrappers for OTP / BSEC functions */
15static inline uint32_t stm32_otp_probe(void)
16{
17 return bsec_probe();
18}
19
20static inline uint32_t stm32_otp_read(uint32_t *val, uint32_t otp)
21{
22 return bsec_read_otp(val, otp);
23}
24
25static inline uint32_t stm32_otp_shadow_read(uint32_t *val, uint32_t otp)
26{
27 return bsec_shadow_read_otp(val, otp);
28}
29
30static inline uint32_t stm32_otp_write(uint32_t val, uint32_t otp)
31{
32 return bsec_write_otp(val, otp);
33}
34
35static inline uint32_t stm32_otp_set_sr_lock(uint32_t otp)
36{
37 return bsec_set_sr_lock(otp);
38}
39
40static inline uint32_t stm32_otp_read_sw_lock(uint32_t otp, bool *value)
41{
42 return bsec_read_sw_lock(otp, value);
43}
44
45static inline bool stm32_otp_is_closed_device(void)
46{
47 return bsec_mode_is_closed_device();
48}
49
50#endif /* STM32MP2_PRIVATE_H */