1 /* 2 * Copyright (c) 2015-2024, Arm Limited and Contributors. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #ifndef STM32MP1_PRIVATE_H 8 #define STM32MP1_PRIVATE_H 9 10 #include <stdint.h> 11 12 void configure_mmu(void); 13 14 void stm32mp1_arch_security_setup(void); 15 void stm32mp1_security_setup(void); 16 17 void stm32mp_syscfg_init(void); 18 void stm32mp_syscfg_enable_io_compensation_start(void); 19 void stm32mp_syscfg_enable_io_compensation_finish(void); 20 void stm32mp_syscfg_disable_io_compensation(void); 21 uint32_t stm32mp_syscfg_get_chip_version(void); 22 uint32_t stm32mp_syscfg_get_chip_dev_id(void); 23 #if STM32MP13 24 void stm32mp_syscfg_boot_mode_enable(void); 25 void stm32mp_syscfg_boot_mode_disable(void); 26 #endif 27 #if STM32MP15 28 static inline void stm32mp_syscfg_boot_mode_enable(void){} 29 static inline void stm32mp_syscfg_boot_mode_disable(void){} 30 #endif 31 32 void stm32mp1_deconfigure_uart_pins(void); 33 34 void stm32mp1_init_scmi_server(void); 35 36 /* Wrappers for OTP / BSEC functions */ 37 static inline uint32_t stm32_otp_read(uint32_t *val, uint32_t otp) 38 { 39 return bsec_read_otp(val, otp); 40 } 41 42 static inline uint32_t stm32_otp_shadow_read(uint32_t *val, uint32_t otp) 43 { 44 return bsec_shadow_read_otp(val, otp); 45 } 46 47 static inline uint32_t stm32_otp_write(uint32_t val, uint32_t otp) 48 { 49 return bsec_write_otp(val, otp); 50 } 51 52 static inline uint32_t stm32_otp_set_sr_lock(uint32_t otp) 53 { 54 return bsec_set_sr_lock(otp); 55 } 56 57 static inline uint32_t stm32_otp_read_sw_lock(uint32_t otp, bool *value) 58 { 59 return bsec_read_sw_lock(otp, value); 60 } 61 62 #endif /* STM32MP1_PRIVATE_H */ 63