xref: /rk3399_ARM-atf/include/drivers/st/stm32mp_clkfunc.h (revision 52a616b48c617fe8721106f29f2910ca4681afea)
1447b2b13SYann Gautier /*
2447b2b13SYann Gautier  * Copyright (c) 2017-2019, STMicroelectronics - All Rights Reserved
3447b2b13SYann Gautier  *
4447b2b13SYann Gautier  * SPDX-License-Identifier: BSD-3-Clause
5447b2b13SYann Gautier  */
6447b2b13SYann Gautier 
7447b2b13SYann Gautier #ifndef STM32MP_CLKFUNC_H
8447b2b13SYann Gautier #define STM32MP_CLKFUNC_H
9447b2b13SYann Gautier 
10447b2b13SYann Gautier #include <stdbool.h>
11447b2b13SYann Gautier 
12447b2b13SYann Gautier #include <libfdt.h>
13447b2b13SYann Gautier 
14f66358afSYann Gautier #include <platform_def.h>
15f66358afSYann Gautier 
16f66358afSYann Gautier int fdt_osc_read_freq(const char *name, uint32_t *freq);
17f66358afSYann Gautier bool fdt_osc_read_bool(enum stm32mp_osc_id osc_id, const char *prop_name);
18f66358afSYann Gautier uint32_t fdt_osc_read_uint32_default(enum stm32mp_osc_id osc_id,
19f66358afSYann Gautier 				     const char *prop_name,
20f66358afSYann Gautier 				     uint32_t dflt_value);
21f66358afSYann Gautier 
22447b2b13SYann Gautier int fdt_get_rcc_node(void *fdt);
23447b2b13SYann Gautier uint32_t fdt_rcc_read_addr(void);
24*52a616b4SAndre Przywara int fdt_rcc_read_uint32_array(const char *prop_name, uint32_t count,
25*52a616b4SAndre Przywara 			      uint32_t *array);
26447b2b13SYann Gautier int fdt_rcc_subnode_offset(const char *name);
27447b2b13SYann Gautier const fdt32_t *fdt_rcc_read_prop(const char *prop_name, int *lenp);
28447b2b13SYann Gautier bool fdt_get_rcc_secure_status(void);
29447b2b13SYann Gautier 
30447b2b13SYann Gautier uintptr_t fdt_get_stgen_base(void);
31447b2b13SYann Gautier int fdt_get_clock_id(int node);
32447b2b13SYann Gautier 
33447b2b13SYann Gautier #endif /* STM32MP_CLKFUNC_H */
34