Yann Gautier | 9aea69e | 2018-07-24 17:13:36 +0200 | [diff] [blame] | 1 | /* |
Yann Gautier | ad730b5 | 2022-01-19 13:57:49 +0100 | [diff] [blame] | 2 | * Copyright (c) 2018-2022, STMicroelectronics - All Rights Reserved |
Yann Gautier | 9aea69e | 2018-07-24 17:13:36 +0200 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 7 | #ifndef STM32MP1_CLK_H |
| 8 | #define STM32MP1_CLK_H |
Yann Gautier | 9aea69e | 2018-07-24 17:13:36 +0200 | [diff] [blame] | 9 | |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 10 | #include <arch_helpers.h> |
| 11 | |
Yann Gautier | 5f2e874 | 2019-05-17 15:57:56 +0200 | [diff] [blame] | 12 | enum stm32mp_osc_id { |
| 13 | _HSI, |
| 14 | _HSE, |
| 15 | _CSI, |
| 16 | _LSI, |
| 17 | _LSE, |
| 18 | _I2S_CKIN, |
| 19 | NB_OSC, |
| 20 | _UNKNOWN_OSC_ID = 0xFF |
| 21 | }; |
| 22 | |
| 23 | extern const char *stm32mp_osc_node_label[NB_OSC]; |
| 24 | |
Yann Gautier | 9aea69e | 2018-07-24 17:13:36 +0200 | [diff] [blame] | 25 | int stm32mp1_clk_probe(void); |
| 26 | int stm32mp1_clk_init(void); |
Yann Gautier | e4a3c35 | 2019-02-14 10:53:33 +0100 | [diff] [blame] | 27 | |
| 28 | bool stm32mp1_rcc_is_secure(void); |
Yann Gautier | ed34232 | 2019-02-15 17:33:27 +0100 | [diff] [blame] | 29 | bool stm32mp1_rcc_is_mckprot(void); |
Yann Gautier | e4a3c35 | 2019-02-14 10:53:33 +0100 | [diff] [blame] | 30 | |
Yann Gautier | e4a3c35 | 2019-02-14 10:53:33 +0100 | [diff] [blame] | 31 | /* SMP protection on RCC registers access */ |
| 32 | void stm32mp1_clk_rcc_regs_lock(void); |
| 33 | void stm32mp1_clk_rcc_regs_unlock(void); |
| 34 | |
Etienne Carriere | 1368ada | 2020-05-13 11:49:49 +0200 | [diff] [blame] | 35 | #ifdef STM32MP_SHARED_RESOURCES |
| 36 | void stm32mp1_register_clock_parents_secure(unsigned long id); |
| 37 | #endif |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 38 | #endif /* STM32MP1_CLK_H */ |