mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-08-15 17:07:04 +02:00
Introduce stm32mp1_register_clock_parents_secure() in stm32mp1 clock driver to allow platform shared resources to register as secure the parent clocks of a clock registered as secure. Change-Id: I53a9ab6aa78ee840ededce67e7b12a84e08ee843 Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
66 lines
1.4 KiB
C
66 lines
1.4 KiB
C
/*
|
|
* Copyright (c) 2018-2019, STMicroelectronics - All Rights Reserved
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#ifndef STM32MP1_CLK_H
|
|
#define STM32MP1_CLK_H
|
|
|
|
#include <arch_helpers.h>
|
|
|
|
enum stm32mp_osc_id {
|
|
_HSI,
|
|
_HSE,
|
|
_CSI,
|
|
_LSI,
|
|
_LSE,
|
|
_I2S_CKIN,
|
|
NB_OSC,
|
|
_UNKNOWN_OSC_ID = 0xFF
|
|
};
|
|
|
|
extern const char *stm32mp_osc_node_label[NB_OSC];
|
|
|
|
int stm32mp1_clk_probe(void);
|
|
int stm32mp1_clk_init(void);
|
|
|
|
bool stm32mp1_rcc_is_secure(void);
|
|
bool stm32mp1_rcc_is_mckprot(void);
|
|
|
|
void __stm32mp1_clk_enable(unsigned long id, bool caller_is_secure);
|
|
void __stm32mp1_clk_disable(unsigned long id, bool caller_is_secure);
|
|
|
|
static inline void stm32mp1_clk_enable_non_secure(unsigned long id)
|
|
{
|
|
__stm32mp1_clk_enable(id, false);
|
|
}
|
|
|
|
static inline void stm32mp1_clk_enable_secure(unsigned long id)
|
|
{
|
|
__stm32mp1_clk_enable(id, true);
|
|
}
|
|
|
|
static inline void stm32mp1_clk_disable_non_secure(unsigned long id)
|
|
{
|
|
__stm32mp1_clk_disable(id, false);
|
|
}
|
|
|
|
static inline void stm32mp1_clk_disable_secure(unsigned long id)
|
|
{
|
|
__stm32mp1_clk_disable(id, true);
|
|
}
|
|
|
|
unsigned int stm32mp1_clk_get_refcount(unsigned long id);
|
|
|
|
/* SMP protection on RCC registers access */
|
|
void stm32mp1_clk_rcc_regs_lock(void);
|
|
void stm32mp1_clk_rcc_regs_unlock(void);
|
|
|
|
void stm32mp1_stgen_increment(unsigned long long offset_in_ms);
|
|
|
|
#ifdef STM32MP_SHARED_RESOURCES
|
|
void stm32mp1_register_clock_parents_secure(unsigned long id);
|
|
#endif
|
|
#endif /* STM32MP1_CLK_H */
|