mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-16 09:34:18 +00:00
fix(st-clock): do not reconfigure LSE
If LSE oscillator is already ON, which is the case when returning from low-power state or if we are on VBAT, it mustn't be reconfigured. Signed-off-by: Yann Gautier <yann.gautier@foss.st.com> Change-Id: Ie75f2b0b42aeb3d95e2266e1fca811a2f2b3e29f
This commit is contained in:
parent
d594239d4e
commit
f4a2bb986b
2 changed files with 11 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2022-2023, STMicroelectronics - All Rights Reserved
|
||||
* Copyright (C) 2022-2024, STMicroelectronics - All Rights Reserved
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
*/
|
||||
|
@ -1007,6 +1007,11 @@ static void stm32_enable_oscillator_lse(struct stm32_clk_priv *priv)
|
|||
return;
|
||||
}
|
||||
|
||||
/* Do not reconfigure LSE if already enabled */
|
||||
if (_clk_stm32_gate_is_enabled(priv, osc_data->gate_id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
clk_oscillator_set_bypass(priv, _CK_LSE, digbyp, bypass);
|
||||
|
||||
clk_oscillator_set_drive(priv, _CK_LSE, drive);
|
||||
|
|
|
@ -1327,6 +1327,11 @@ static void stm32mp1_lse_enable(bool bypass, bool digbyp, uint32_t lsedrv)
|
|||
uint32_t value;
|
||||
uintptr_t rcc_base = stm32mp_rcc_base();
|
||||
|
||||
/* Do not reconfigure LSE if it is already ON */
|
||||
if ((mmio_read_32(rcc_base + RCC_BDCR) & RCC_BDCR_LSEON) == RCC_BDCR_LSEON) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (digbyp) {
|
||||
mmio_setbits_32(rcc_base + RCC_BDCR, RCC_BDCR_DIGBYP);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue