Browse Source

fix(stm32mp1_clk): correctly manage RTC clock source

The clksrc value contains the RCC register address and the clock
source number. When applying the clock source, we should filter out
the RCC register address from the given value.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: I4345b03de7b9afd1df78df4131431cf1eb43ec17
pull/1981/head
Yann Gautier 4 years ago
parent
commit
15509093f0
  1. 2
      drivers/st/clk/stm32mp1_clk.c

2
drivers/st/clk/stm32mp1_clk.c

@ -1652,7 +1652,7 @@ static void stm32mp1_set_rtcsrc(unsigned int clksrc, bool lse_css)
(clksrc != (uint32_t)CLK_RTC_DISABLED)) {
mmio_clrsetbits_32(address,
RCC_BDCR_RTCSRC_MASK,
clksrc << RCC_BDCR_RTCSRC_SHIFT);
(clksrc & RCC_SELR_SRC_MASK) << RCC_BDCR_RTCSRC_SHIFT);
mmio_setbits_32(address, RCC_BDCR_RTCCKEN);
}

Loading…
Cancel
Save