blob: 635a9cd4ce05d4014e0ec73c9840ff2ae3597c17 [file] [log] [blame]
Yann Gautier9aea69e2018-07-24 17:13:36 +02001/*
2 * Copyright (c) 2017-2018, STMicroelectronics - All Rights Reserved
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef __STM32MP1_CLKFUNC_H__
8#define __STM32MP1_CLKFUNC_H__
9
10#include <stdbool.h>
11
12enum stm32mp_osc_id {
13 _HSI,
14 _HSE,
15 _CSI,
16 _LSI,
17 _LSE,
18 _I2S_CKIN,
19 _USB_PHY_48,
20 NB_OSC,
21 _UNKNOWN_OSC_ID = 0xFF
22};
23
24extern const char *stm32mp_osc_node_label[NB_OSC];
25
26int fdt_osc_read_freq(const char *name, uint32_t *freq);
27bool fdt_osc_read_bool(enum stm32mp_osc_id osc_id, const char *prop_name);
28uint32_t fdt_osc_read_uint32_default(enum stm32mp_osc_id osc_id,
29 const char *prop_name,
30 uint32_t dflt_value);
31
32uint32_t fdt_rcc_read_addr(void);
33int fdt_rcc_read_uint32_array(const char *prop_name,
34 uint32_t *array, uint32_t count);
35int fdt_rcc_subnode_offset(const char *name);
36const uint32_t *fdt_rcc_read_prop(const char *prop_name, int *lenp);
37bool fdt_get_rcc_secure_status(void);
38
39uintptr_t fdt_get_stgen_base(void);
40int fdt_get_clock_id(int node);
41
42#endif /* __STM32MP1_CLKFUNC_H__ */