Yann Gautier | 9aea69e | 2018-07-24 17:13:36 +0200 | [diff] [blame] | 1 | /* |
| 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 | |
| 12 | enum 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 | |
| 24 | extern const char *stm32mp_osc_node_label[NB_OSC]; |
| 25 | |
| 26 | int fdt_osc_read_freq(const char *name, uint32_t *freq); |
| 27 | bool fdt_osc_read_bool(enum stm32mp_osc_id osc_id, const char *prop_name); |
| 28 | uint32_t fdt_osc_read_uint32_default(enum stm32mp_osc_id osc_id, |
| 29 | const char *prop_name, |
| 30 | uint32_t dflt_value); |
| 31 | |
| 32 | uint32_t fdt_rcc_read_addr(void); |
| 33 | int fdt_rcc_read_uint32_array(const char *prop_name, |
| 34 | uint32_t *array, uint32_t count); |
| 35 | int fdt_rcc_subnode_offset(const char *name); |
| 36 | const uint32_t *fdt_rcc_read_prop(const char *prop_name, int *lenp); |
| 37 | bool fdt_get_rcc_secure_status(void); |
| 38 | |
| 39 | uintptr_t fdt_get_stgen_base(void); |
| 40 | int fdt_get_clock_id(int node); |
| 41 | |
| 42 | #endif /* __STM32MP1_CLKFUNC_H__ */ |