Yann Gautier | 06ae396 | 2023-09-19 18:26:16 +0200 | [diff] [blame] | 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 | |
Yann Gautier | 8053f2b | 2024-05-21 11:46:59 +0200 | [diff] [blame] | 10 | void configure_mmu(void); |
| 11 | |
Yann Gautier | d58a3d2 | 2024-05-21 12:05:43 +0200 | [diff] [blame] | 12 | uint32_t stm32mp_syscfg_get_chip_dev_id(void); |
| 13 | |
Nicolas Le Bayon | ead0b02 | 2021-09-21 23:18:24 +0200 | [diff] [blame^] | 14 | /* Get DDRDBG peripheral IO memory base address */ |
| 15 | uintptr_t stm32_ddrdbg_get_base(void); |
| 16 | |
Yann Gautier | 06ae396 | 2023-09-19 18:26:16 +0200 | [diff] [blame] | 17 | /* Wrappers for OTP / BSEC functions */ |
| 18 | static inline uint32_t stm32_otp_probe(void) |
| 19 | { |
| 20 | return bsec_probe(); |
| 21 | } |
| 22 | |
| 23 | static inline uint32_t stm32_otp_read(uint32_t *val, uint32_t otp) |
| 24 | { |
| 25 | return bsec_read_otp(val, otp); |
| 26 | } |
| 27 | |
| 28 | static inline uint32_t stm32_otp_shadow_read(uint32_t *val, uint32_t otp) |
| 29 | { |
| 30 | return bsec_shadow_read_otp(val, otp); |
| 31 | } |
| 32 | |
| 33 | static inline uint32_t stm32_otp_write(uint32_t val, uint32_t otp) |
| 34 | { |
| 35 | return bsec_write_otp(val, otp); |
| 36 | } |
| 37 | |
| 38 | static inline uint32_t stm32_otp_set_sr_lock(uint32_t otp) |
| 39 | { |
| 40 | return bsec_set_sr_lock(otp); |
| 41 | } |
| 42 | |
| 43 | static inline uint32_t stm32_otp_read_sw_lock(uint32_t otp, bool *value) |
| 44 | { |
| 45 | return bsec_read_sw_lock(otp, value); |
| 46 | } |
| 47 | |
| 48 | static inline bool stm32_otp_is_closed_device(void) |
| 49 | { |
| 50 | return bsec_mode_is_closed_device(); |
| 51 | } |
| 52 | |
| 53 | #endif /* STM32MP2_PRIVATE_H */ |