Skip to content

Commit fbf4218

Browse files
committed
drivers: clock control: stm32H7RS has a PLL2 & 3 or HCLK5 output
Add the definitions of the PLL2 and PLL3 outputs for the stm32H7RS mcus and the HCLK5 which is clock source for the XSPI instance. Signed-off-by: Francois Ramu <[email protected]>
1 parent 2cd7b4e commit fbf4218

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

drivers/clock_control/clock_stm32_ll_h7.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,12 @@ int enabled_clock(uint32_t src_clk)
337337
((src_clk == STM32_SRC_PLL2_R) && IS_ENABLED(STM32_PLL2_R_ENABLED)) ||
338338
((src_clk == STM32_SRC_PLL3_P) && IS_ENABLED(STM32_PLL3_P_ENABLED)) ||
339339
((src_clk == STM32_SRC_PLL3_Q) && IS_ENABLED(STM32_PLL3_Q_ENABLED)) ||
340+
#if defined(CONFIG_SOC_SERIES_STM32H7RSX)
341+
(src_clk == STM32_SRC_HCLK5) ||
342+
((src_clk == STM32_SRC_PLL2_S) && IS_ENABLED(STM32_PLL2_S_ENABLED)) ||
343+
((src_clk == STM32_SRC_PLL2_T) && IS_ENABLED(STM32_PLL2_T_ENABLED)) ||
344+
((src_clk == STM32_SRC_PLL3_S) && IS_ENABLED(STM32_PLL3_S_ENABLED)) ||
345+
#endif
340346
((src_clk == STM32_SRC_PLL3_R) && IS_ENABLED(STM32_PLL3_R_ENABLED))) {
341347
return 0;
342348
}
@@ -460,6 +466,10 @@ static int stm32_clock_control_get_subsys_rate(const struct device *clock,
460466
case STM32_CLOCK_BUS_AHB2:
461467
case STM32_CLOCK_BUS_AHB3:
462468
case STM32_CLOCK_BUS_AHB4:
469+
#if defined(CONFIG_SOC_SERIES_STM32H7RSX)
470+
/* HCLK5 i a possible source clock for some peripherals */
471+
case STM32_SRC_HCLK5:
472+
#endif /* CONFIG_SOC_SERIES_STM32H7RSX */
463473
*rate = ahb_clock;
464474
break;
465475
case STM32_CLOCK_BUS_APB1:
@@ -544,7 +554,7 @@ static int stm32_clock_control_get_subsys_rate(const struct device *clock,
544554
STM32_PLL_N_MULTIPLIER,
545555
STM32_PLL_S_DIVISOR);
546556
break;
547-
/* PLL 1 has no T-divider */
557+
/* PLL 1 has no T-divider */
548558
#endif /* CONFIG_SOC_SERIES_STM32H7RSX */
549559
#endif /* STM32_PLL_ENABLED */
550560
#if defined(STM32_PLL2_ENABLED)

include/zephyr/dt-bindings/clock/stm32h7rs_clock.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@
3838

3939
/** Clock muxes */
4040
#define STM32_SRC_CKPER (STM32_SRC_PLL3_S + 1)
41+
#define STM32_SRC_HCLK1 (STM32_SRC_CKPER + 1)
42+
#define STM32_SRC_HCLK2 (STM32_SRC_HCLK1 + 1)
43+
#define STM32_SRC_HCLK3 (STM32_SRC_HCLK2 + 1)
44+
#define STM32_SRC_HCLK4 (STM32_SRC_HCLK3 + 1)
45+
#define STM32_SRC_HCLK5 (STM32_SRC_HCLK4 + 1)
4146
/** Others: Not yet supported */
4247

4348
/** Bus clocks */

0 commit comments

Comments
 (0)