mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-08-20 05:51:01 +02:00
The clock driver is under dual license, BSD and GPLv2. The clock driver uses device tree, so a minimal support for this is added. The required files for driver and DTS files are in include/dt-bindings/. Signed-off-by: Yann Gautier <yann.gautier@st.com> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com> Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
31 lines
729 B
C
31 lines
729 B
C
/*
|
|
* Copyright (c) 2018, STMicroelectronics - All Rights Reserved
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#ifndef __STM32MP1_CLK_H__
|
|
#define __STM32MP1_CLK_H__
|
|
|
|
#include <arch_helpers.h>
|
|
#include <stdbool.h>
|
|
|
|
int stm32mp1_clk_probe(void);
|
|
int stm32mp1_clk_init(void);
|
|
bool stm32mp1_clk_is_enabled(unsigned long id);
|
|
int stm32mp1_clk_enable(unsigned long id);
|
|
int stm32mp1_clk_disable(unsigned long id);
|
|
unsigned long stm32mp1_clk_get_rate(unsigned long id);
|
|
void stm32mp1_stgen_increment(unsigned long long offset_in_ms);
|
|
|
|
static inline uint32_t get_timer(uint32_t base)
|
|
{
|
|
if (base == 0U) {
|
|
return (uint32_t)(~read_cntpct_el0());
|
|
}
|
|
|
|
return base - (uint32_t)(~read_cntpct_el0());
|
|
}
|
|
|
|
#endif /* __STM32MP1_CLK_H__ */
|