Please sign in to comment.
stm32: clock_control: Enforce HCLK prescaler value
STM32 clock control subsystem allows to configure a different frequency value for core clock (SYSCLK) and AHB clock (HCLK). Though, it is HCLK which is used to feed Cortex Systick timer which is used in zephyr as reference system clock. If HCLK frequency is configured to a different value from SYSCLK frequency, whole system is exposed to desynchro between zephyr clock subsytem and STM32 HW configuration. To prevent this, and until zephyr clock subsystem is changed to be aware of this potential configuration, enforce AHB prescaler value to 1 (which is current default value in use for all STM32 based boards). On STM32H7, enforce D1CPRE which fills the same role as ABH precaler. On STM32MP1, the equivalent setting is done on A7 core, so it is not exposed to the same issue as long as SYS_CLOCK_HW_CYCLES_PER_SEC is set with the 'mlhclk_ck' clock frequency value. Update matching boards documentation. Fixes #17188 Signed-off-by: Erwan Gouriou <firstname.lastname@example.org>
- Loading branch information...
Showing with 29 additions and 4 deletions.
- +1 −1 boards/arm/96b_avenger96/96b_avenger96_defconfig
- +2 −1 boards/arm/96b_avenger96/doc/index.rst
- +2 −1 boards/arm/stm32mp157c_dk2/doc/stm32mp157_dk2.rst
- +1 −1 boards/arm/stm32mp157c_dk2/stm32mp157c_dk2_defconfig
- +11 −0 drivers/clock_control/clock_stm32_ll_common.c
- +12 −0 drivers/clock_control/clock_stm32_ll_h7.c