Yann Gautier | 4b0c72a | 2018-07-16 10:54:09 +0200 | [diff] [blame] | 1 | /* |
Yann Gautier | 06ae396 | 2023-09-19 18:26:16 +0200 | [diff] [blame] | 2 | * Copyright (c) 2015-2024, Arm Limited and Contributors. All rights reserved. |
Yann Gautier | 4b0c72a | 2018-07-16 10:54:09 +0200 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 7 | #ifndef STM32MP1_PRIVATE_H |
| 8 | #define STM32MP1_PRIVATE_H |
| 9 | |
| 10 | #include <stdint.h> |
Yann Gautier | 4b0c72a | 2018-07-16 10:54:09 +0200 | [diff] [blame] | 11 | |
Yann Gautier | 4b0c72a | 2018-07-16 10:54:09 +0200 | [diff] [blame] | 12 | void configure_mmu(void); |
| 13 | |
Yann Gautier | caf575b | 2018-07-24 17:18:19 +0200 | [diff] [blame] | 14 | void stm32mp1_arch_security_setup(void); |
Yann Gautier | 9d135e4 | 2018-07-16 19:36:06 +0200 | [diff] [blame] | 15 | void stm32mp1_security_setup(void); |
Yann Gautier | caf575b | 2018-07-24 17:18:19 +0200 | [diff] [blame] | 16 | |
Yann Gautier | 3edc7c3 | 2019-05-20 19:17:08 +0200 | [diff] [blame] | 17 | void stm32mp1_syscfg_init(void); |
Yann Gautier | b76c61a | 2020-12-16 10:17:35 +0100 | [diff] [blame] | 18 | void stm32mp1_syscfg_enable_io_compensation_start(void); |
| 19 | void stm32mp1_syscfg_enable_io_compensation_finish(void); |
Yann Gautier | 3edc7c3 | 2019-05-20 19:17:08 +0200 | [diff] [blame] | 20 | void stm32mp1_syscfg_disable_io_compensation(void); |
Yann Gautier | f36a1d3 | 2020-04-21 15:03:59 +0200 | [diff] [blame] | 21 | uint32_t stm32mp1_syscfg_get_chip_version(void); |
| 22 | uint32_t stm32mp1_syscfg_get_chip_dev_id(void); |
Nicolas Toromanoff | 1877b13 | 2021-02-03 16:52:03 +0100 | [diff] [blame] | 23 | #if STM32MP13 |
| 24 | void stm32mp1_syscfg_boot_mode_enable(void); |
| 25 | void stm32mp1_syscfg_boot_mode_disable(void); |
| 26 | #endif |
| 27 | #if STM32MP15 |
| 28 | static inline void stm32mp1_syscfg_boot_mode_enable(void){} |
| 29 | static inline void stm32mp1_syscfg_boot_mode_disable(void){} |
| 30 | #endif |
Yann Gautier | 3edc7c3 | 2019-05-20 19:17:08 +0200 | [diff] [blame] | 31 | |
Yann Gautier | cd16df3 | 2021-06-04 14:04:05 +0200 | [diff] [blame] | 32 | void stm32mp1_deconfigure_uart_pins(void); |
| 33 | |
Etienne Carriere | 34f0e93 | 2020-07-16 17:36:18 +0200 | [diff] [blame] | 34 | void stm32mp1_init_scmi_server(void); |
Yann Gautier | 06ae396 | 2023-09-19 18:26:16 +0200 | [diff] [blame] | 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 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 62 | #endif /* STM32MP1_PRIVATE_H */ |