arm-trusted-firmware/plat/st/stm32mp2/include/stm32mp2_private.h
Yann Gautier 3007c72844 feat(st): do not directly call BSEC functions in common code
When STM32MP2 boots on Cortex-M33, the Cortex-A35 do no more have access
to BSEC peripheral. New static inline stm32_otp_* wrappers are added,
which just redirect to BSEC functions.

While at it remove a useless bsec.h include.

Change-Id: Ie0f917c02e48acf456634f455dae41805bf6adbf
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
2024-01-18 11:30:42 +01:00

46 lines
952 B
C

/*
* Copyright (c) 2024, STMicroelectronics - All Rights Reserved
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef STM32MP2_PRIVATE_H
#define STM32MP2_PRIVATE_H
/* Wrappers for OTP / BSEC functions */
static inline uint32_t stm32_otp_probe(void)
{
return bsec_probe();
}
static inline uint32_t stm32_otp_read(uint32_t *val, uint32_t otp)
{
return bsec_read_otp(val, otp);
}
static inline uint32_t stm32_otp_shadow_read(uint32_t *val, uint32_t otp)
{
return bsec_shadow_read_otp(val, otp);
}
static inline uint32_t stm32_otp_write(uint32_t val, uint32_t otp)
{
return bsec_write_otp(val, otp);
}
static inline uint32_t stm32_otp_set_sr_lock(uint32_t otp)
{
return bsec_set_sr_lock(otp);
}
static inline uint32_t stm32_otp_read_sw_lock(uint32_t otp, bool *value)
{
return bsec_read_sw_lock(otp, value);
}
static inline bool stm32_otp_is_closed_device(void)
{
return bsec_mode_is_closed_device();
}
#endif /* STM32MP2_PRIVATE_H */