blob: f3039373487f92fe43b2a6fdfd32ce94ef267e32 [file] [log] [blame]
Yann Gautier9aea69e2018-07-24 17:13:36 +02001/*
Yann Gautier4d429472019-02-14 11:15:20 +01002 * Copyright (c) 2017-2019, STMicroelectronics - All Rights Reserved
Yann Gautier9aea69e2018-07-24 17:13:36 +02003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +00007#ifndef STM32MP1_CLKFUNC_H
8#define STM32MP1_CLKFUNC_H
Yann Gautier9aea69e2018-07-24 17:13:36 +02009
10#include <stdbool.h>
11
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000012#include <libfdt.h>
13
Yann Gautier9aea69e2018-07-24 17:13:36 +020014enum stm32mp_osc_id {
15 _HSI,
16 _HSE,
17 _CSI,
18 _LSI,
19 _LSE,
20 _I2S_CKIN,
Yann Gautier9aea69e2018-07-24 17:13:36 +020021 NB_OSC,
22 _UNKNOWN_OSC_ID = 0xFF
23};
24
25extern const char *stm32mp_osc_node_label[NB_OSC];
26
27int fdt_osc_read_freq(const char *name, uint32_t *freq);
28bool fdt_osc_read_bool(enum stm32mp_osc_id osc_id, const char *prop_name);
29uint32_t fdt_osc_read_uint32_default(enum stm32mp_osc_id osc_id,
30 const char *prop_name,
31 uint32_t dflt_value);
32
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +000033#endif /* STM32MP1_CLKFUNC_H */