stm32mp1_clk.h 1.11 KB
Newer Older
1
/*
2
 * Copyright (c) 2018-2019, STMicroelectronics - All Rights Reserved
3
4
5
6
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

7
8
#ifndef STM32MP1_CLK_H
#define STM32MP1_CLK_H
9

10
11
#include <arch_helpers.h>

12
13
int stm32mp1_clk_probe(void);
int stm32mp1_clk_init(void);
Yann Gautier's avatar
Yann Gautier committed
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

bool stm32mp1_rcc_is_secure(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);

46
47
void stm32mp1_stgen_increment(unsigned long long offset_in_ms);

48
#endif /* STM32MP1_CLK_H */