1447b2b13SYann Gautier /* 2*bfe8a12eSPascal Paillet * Copyright (c) 2017-2024, 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); 17b208e3daSGabriel Fernandez bool fdt_clk_read_bool(const char *node_label, const char *prop_name); 18b208e3daSGabriel Fernandez uint32_t fdt_clk_read_uint32_default(const char *node_label, 19f66358afSYann Gautier const char *prop_name, 20f66358afSYann Gautier uint32_t dflt_value); 21f66358afSYann Gautier 2252a616b4SAndre Przywara int fdt_rcc_read_uint32_array(const char *prop_name, uint32_t count, 2352a616b4SAndre Przywara uint32_t *array); 24447b2b13SYann Gautier int fdt_rcc_subnode_offset(const char *name); 25447b2b13SYann Gautier const fdt32_t *fdt_rcc_read_prop(const char *prop_name, int *lenp); 26812daf91SLionel Debieve bool fdt_get_rcc_secure_state(void); 27447b2b13SYann Gautier 28447b2b13SYann Gautier int fdt_get_clock_id(int node); 29165ad556SNicolas Le Bayon unsigned long fdt_get_uart_clock_freq(uintptr_t instance); 30447b2b13SYann Gautier 31591d80c8SLionel Debieve void stm32mp_stgen_config(unsigned long rate); 32*bfe8a12eSPascal Paillet void stm32mp_stgen_restore_rate(void); 33591d80c8SLionel Debieve 34447b2b13SYann Gautier #endif /* STM32MP_CLKFUNC_H */ 35