Commit graph

8 commits

Author SHA1 Message Date
Kevin ORourke 9bf0a24f2e drivers: clock_control: stm32: clock_control_on
Make clock_control_on for STM32 behave the same as the HAL,
delaying after enabling peripheral clocks. Otherwise it may return
before the clock is actually enabled, causing subsequent writes to
peripheral registers to be silently ignored.

Signed-off-by: Kevin ORourke <kevin.orourke@ferroamp.se>
2024-03-25 09:31:54 +01:00
Francois Ramu 29b0cd4278 drivers: clock_control: stm32h5 driver input vco range
Set the correct VCO input range for the PLL frequency
with each bit PLL1RGE of the PLL1CFGR register
This get_vco_input_range is similar to the stm32h7 one.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-01-26 15:55:42 +00:00
Kacper Dalach 305423ccb8 drivers: clock_control: stm32h5: Add MCO configuration
STM32H5 series lacked support for MCO configuration.
Added SOC_SERIES_STM32H5X to approperiate kconfig MCO source
configurations. Added new MCO sources from H5 series and
updated the clock_stm32_ll_h5.c with MCO configuration.

Signed-off-by: Kacper Dalach <dalachowsky@gmail.com>
2023-07-25 09:22:40 +00:00
Kacper Dalach f9773859c4 drivers: clock_control: stm32h5: boot_clock_assert_fix
When the image is chain-loaded, clocks may already by initialized.
The driver was lacking support for already configured HSE and
PLL sources. When CONFIG_ASSERT=y get_startup_frequency was
failing since it did not recognize these sources.

It's the same issue that was addressed in #58109 for stm32u5.

Signed-off-by: Kacper Dalach <dalachowsky@gmail.com>
2023-07-12 21:11:00 +02:00
Francois Ramu e802779d86 drivers: clock control: stm32h5 set the clock freq for voltage scaling
According to the stm32h5x product specifications, the values of the
voltage ragulator depends on the system clock as follows:
• VOS0 (Vcore = 1.35V) with CPU and peripherals running at up to 250 MHz
• VOS1 (Vcore = 1.2V) with CPU and peripherals running at up to 200 MHz
• VOS2 (Vcore = 1.1V) with CPU and peripherals running at up to 150 MHz
• VOS3 (Vcore = 1.0V) with CPU and peripherals running at up to 100 MHz

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-06-23 09:22:06 +02:00
Benjamin Bigler 1889af9d9c drivers: clock_control: stm32: Fix switching to HSI
If clock frequency was already high and a ahb prescaler greater than 1
was used frequency could temporary become higher than allowed.

Signed-off-by: Benjamin Bigler <benjamin.bigler@securiton.ch>
2023-05-11 10:05:47 +02:00
Wojciech Slenska 7271c3926f drivers: clock_control: stm32h5: Set HSI divider
By default HSIDIV is set to 0x01, so default frequency is 32 MHz.
This register should be always set based on dts value.

Signed-off-by: Wojciech Slenska <wsl@trackunit.com>
2023-04-27 09:51:00 +02:00
Francois Ramu 4a6a703f0f drivers: clock control for the new stm32h5 serie
Add the driver for the clock control of the new stm32h5.
See the corresponding Ref Man to get the clock scheme :
HSI, CSI, HSI48, HSE, LSE, and 2 or 3 PLLs

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-03-28 15:07:51 +02:00