blob: c7e0b6e6fb7bfb758b63b720b2bb033edb6f092d [file] [log] [blame]
Yann Gautier4d429472019-02-14 11:15:20 +01001/*
Yann Gautiera18f61b2020-05-05 17:58:40 +02002 * Copyright (c) 2017-2020, STMicroelectronics - All Rights Reserved
Yann Gautier4d429472019-02-14 11:15:20 +01003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef STM32MP_CLKFUNC_H
8#define STM32MP_CLKFUNC_H
9
10#include <stdbool.h>
11
12#include <libfdt.h>
13
Yann Gautier5f2e8742019-05-17 15:57:56 +020014#include <platform_def.h>
15
16int fdt_osc_read_freq(const char *name, uint32_t *freq);
17bool fdt_osc_read_bool(enum stm32mp_osc_id osc_id, const char *prop_name);
18uint32_t fdt_osc_read_uint32_default(enum stm32mp_osc_id osc_id,
19 const char *prop_name,
20 uint32_t dflt_value);
21
Yann Gautier4d429472019-02-14 11:15:20 +010022int fdt_get_rcc_node(void *fdt);
Andre Przywaracc99f3f2020-03-26 12:51:21 +000023int fdt_rcc_read_uint32_array(const char *prop_name, uint32_t count,
24 uint32_t *array);
Yann Gautier4d429472019-02-14 11:15:20 +010025int fdt_rcc_subnode_offset(const char *name);
26const fdt32_t *fdt_rcc_read_prop(const char *prop_name, int *lenp);
27bool fdt_get_rcc_secure_status(void);
28
Yann Gautier4d429472019-02-14 11:15:20 +010029int fdt_get_clock_id(int node);
30
31#endif /* STM32MP_CLKFUNC_H */