1 /* 2 * Copyright (c) 2017-2020, STMicroelectronics - All Rights Reserved 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #ifndef STM32MP_SHARED_RESOURCES_H 8 #define STM32MP_SHARED_RESOURCES_H 9 10 #include <stdbool.h> 11 12 #ifdef STM32MP_SHARED_RESOURCES 13 enum stm32mp_shres; 14 15 /* Return true if @clock_id is shared by secure and non-secure worlds */ 16 bool stm32mp_nsec_can_access_clock(unsigned long clock_id); 17 18 /* Return true if and only if @reset_id relates to a non-secure peripheral */ 19 bool stm32mp_nsec_can_access_reset(unsigned int reset_id); 20 21 /* Register a shared resource assigned to the secure world */ 22 void stm32mp_register_secure_periph(enum stm32mp_shres id); 23 24 /* Register a shared resource assigned to the non-secure world */ 25 void stm32mp_register_non_secure_periph(enum stm32mp_shres id); 26 27 /* Consolidate peripheral states and lock against new peripheral registering */ 28 void stm32mp_lock_periph_registering(void); 29 #endif /* STM32MP_SHARED_RESOURCES */ 30 #endif /* STM32MP_SHARED_RESOURCES_H */ 31