Skip to content

Commit

Permalink
dt-bindings: clock: Add clock sources for stm32f1x/10x for MCO
Browse files Browse the repository at this point in the history
Add clock sources that can be output by the MCO on the stm32f1x and
stm32f10 connectivity line devices.

Signed-off-by: Joakim Andersson <[email protected]>
  • Loading branch information
joerchan authored and carlescufi committed Sep 16, 2024
1 parent 807ccf5 commit efe72a3
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
1 change: 1 addition & 0 deletions dts/arm/st/f1/stm32f105.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/clock/stm32f10x_clock.h>
#include <st/f1/stm32f1.dtsi>

/ {
Expand Down
4 changes: 4 additions & 0 deletions include/zephyr/drivers/clock_control/stm32_clock_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
#elif defined(CONFIG_SOC_SERIES_STM32F0X)
#include <zephyr/dt-bindings/clock/stm32f0_clock.h>
#elif defined(CONFIG_SOC_SERIES_STM32F1X)
#if defined(CONFIG_SOC_STM32F10X_CONNECTIVITY_LINE_DEVICE)
#include <zephyr/dt-bindings/clock/stm32f10x_clock.h>
#else
#include <zephyr/dt-bindings/clock/stm32f1_clock.h>
#endif
#elif defined(CONFIG_SOC_SERIES_STM32F3X)
#include <zephyr/dt-bindings/clock/stm32f3_clock.h>
#elif defined(CONFIG_SOC_SERIES_STM32F2X) || \
Expand Down
21 changes: 21 additions & 0 deletions include/zephyr/dt-bindings/clock/stm32f10x_clock.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright (C) 2024, Joakim Andersson
*/

#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_STM32F10X_CLOCK_H_
#define ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_STM32F10X_CLOCK_H_

#include "stm32_common_clocks.h"
/* Ensure correct order by including generic F1 definitions first. */
#include "stm32f1_clock.h"

/** Fixed clocks */
/* Low speed clocks defined in stm32_common_clocks.h */
/* Common clocks with stm32f1x defined in stm32f1_clock.h */
#define STM32_SRC_PLL2CLK (STM32_SRC_PLLCLK + 1)
#define STM32_SRC_PLL3CLK (STM32_SRC_PLL2CLK + 1)
#define STM32_SRC_EXT_HSE (STM32_SRC_PLL3CLK + 1)

#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_STM32F10X_CLOCK_H_ */
6 changes: 3 additions & 3 deletions include/zephyr/dt-bindings/clock/stm32f1_clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

/** Fixed clocks */
/* Low speed clocks defined in stm32_common_clocks.h */
#define STM32_SRC_HSI (STM32_SRC_LSI + 1)
#define STM32_SRC_HSE (STM32_SRC_HSI + 1)

#define STM32_SRC_HSI (STM32_SRC_LSI + 1)
#define STM32_SRC_HSE (STM32_SRC_HSI + 1)
#define STM32_SRC_PLLCLK (STM32_SRC_HSE + 1)

#define STM32_CLOCK_REG_MASK 0xFFU
#define STM32_CLOCK_REG_SHIFT 0U
Expand Down

0 comments on commit efe72a3

Please sign in to comment.