xref: /optee_os/core/arch/arm/plat-stm32mp1/stm32_util.h (revision 336e32995d9c419d9fc2a6fd5974f99761285415)
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3  * Copyright (c) 2018, STMicroelectronics
4  */
5 
6 #ifndef __STM32_UTIL_H__
7 #define __STM32_UTIL_H__
8 
9 #include <stdint.h>
10 
11 /* Backup registers and RAM utils */
12 uintptr_t stm32mp_bkpreg(unsigned int idx);
13 
14 /* Platform util for the GIC */
15 uintptr_t get_gicc_base(void);
16 uintptr_t get_gicd_base(void);
17 
18 /* Power management service */
19 #ifdef CFG_PSCI_ARM32
20 void stm32mp_register_online_cpu(void);
21 #else
22 static inline void stm32mp_register_online_cpu(void)
23 {
24 }
25 #endif
26 
27 /*
28  * Generic spinlock function that bypass spinlock if MMU is disabled or
29  * lock is NULL.
30  */
31 uint32_t may_spin_lock(unsigned int *lock);
32 void may_spin_unlock(unsigned int *lock, uint32_t exceptions);
33 
34 #endif /*__STM32_UTIL_H__*/
35