drivers: clock_control: stm32wb: Lock CLK48 hsem
On stm32wb, M0 core may enable and disable CLK48 when using RNG. Lock related hsem to prevent M0 to disable CLK48 when it doesn't need it anymore. Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
parent
c896b1e911
commit
bef7a89823
1 changed files with 7 additions and 0 deletions
|
@ -640,6 +640,13 @@ static void set_up_fixed_clock_sources(void)
|
|||
LL_SYSCFG_VREFINT_EnableHSI48();
|
||||
#endif /* CONFIG_SOC_SERIES_STM32L0X */
|
||||
|
||||
/*
|
||||
* STM32WB: Lock the CLK48 HSEM and do not release to prevent
|
||||
* M0 core to disable this clock (used for RNG on M0).
|
||||
* No-op on other series.
|
||||
*/
|
||||
z_stm32_hsem_lock(CFG_HW_CLK48_CONFIG_SEMID, HSEM_LOCK_DEFAULT_RETRY);
|
||||
|
||||
LL_RCC_HSI48_Enable();
|
||||
while (LL_RCC_HSI48_IsReady() != 1) {
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue