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