blob: e2395bc5cd159f0c5d104406191b382b46a4cc2d [file] [log] [blame]
Yann Gautier9aea69e2018-07-24 17:13:36 +02001/*
Yann Gautierad730b52022-01-19 13:57:49 +01002 * Copyright (c) 2018-2022, 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_CLK_H
8#define STM32MP1_CLK_H
Yann Gautier9aea69e2018-07-24 17:13:36 +02009
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000010#include <arch_helpers.h>
11
Yann Gautier5f2e8742019-05-17 15:57:56 +020012enum 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
23extern const char *stm32mp_osc_node_label[NB_OSC];
24
Yann Gautier9aea69e2018-07-24 17:13:36 +020025int stm32mp1_clk_probe(void);
26int stm32mp1_clk_init(void);
Yann Gautiere4a3c352019-02-14 10:53:33 +010027
28bool stm32mp1_rcc_is_secure(void);
Yann Gautiered342322019-02-15 17:33:27 +010029bool stm32mp1_rcc_is_mckprot(void);
Yann Gautiere4a3c352019-02-14 10:53:33 +010030
Yann Gautiere4a3c352019-02-14 10:53:33 +010031/* SMP protection on RCC registers access */
32void stm32mp1_clk_rcc_regs_lock(void);
33void stm32mp1_clk_rcc_regs_unlock(void);
34
Etienne Carriere1368ada2020-05-13 11:49:49 +020035#ifdef STM32MP_SHARED_RESOURCES
36void stm32mp1_register_clock_parents_secure(unsigned long id);
37#endif
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +000038#endif /* STM32MP1_CLK_H */