mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-05-03 09:29:57 +00:00

STM32MP1 chip embeds a dual Cortex-A7 and a Cortex-M4. The support for Cortex-M4 clocks is added when configuring the clock tree. Some minimal security features to allow communications between A7 and M4 are also added. Change-Id: I60417e244a476f60a2758f4969700b2684056665 Signed-off-by: Yann Gautier <yann.gautier@st.com>
49 lines
1.1 KiB
C
49 lines
1.1 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>
|
|
|
|
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);
|
|
|
|
#endif /* STM32MP1_CLK_H */
|