From edaeef1cea4e2b2f0899451dc21708dd2f51f3c9 Mon Sep 17 00:00:00 2001 From: Erwan Gouriou Date: Wed, 5 May 2021 09:28:35 +0200 Subject: [PATCH] drivers/clock_control: stm32h7_m4: Don't rely on rcc "clocks" property In prts of the code, we use rcc node "clocks" property to testify the use of device tree for clocks configuration. This doesn't work in case of stm32h7 m4 targets as for those, "upstream rcc" clock configuration, such as sysclk source selection, is done on m7 core and hence rcc node doesn't have a "clocks" property. To work around this, use alternate "d1cpre" property in case of stm32h7 targets. Signed-off-by: Erwan Gouriou --- drivers/clock_control/Kconfig.stm32 | 2 +- include/drivers/clock_control/stm32_clock_control.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clock_control/Kconfig.stm32 b/drivers/clock_control/Kconfig.stm32 index fbc1251f3a8..6ab508f9a2f 100644 --- a/drivers/clock_control/Kconfig.stm32 +++ b/drivers/clock_control/Kconfig.stm32 @@ -44,7 +44,7 @@ config CLOCK_STM32_HSE_CLOCK config CLOCK_CONTROL_STM32_HAS_DTS bool - default y if "$(dt_node_has_prop,rcc,clocks)" + default y if "$(dt_node_has_prop,rcc,clocks)" || "$(dt_node_has_prop,rcc,d1cpre)" help This symbol is added to prevent default use of CLOCK_CONTROL_STM32_* symbols when board make use of device tree to configure clocks. diff --git a/include/drivers/clock_control/stm32_clock_control.h b/include/drivers/clock_control/stm32_clock_control.h index b1ef0e58d5c..95760abda39 100644 --- a/include/drivers/clock_control/stm32_clock_control.h +++ b/include/drivers/clock_control/stm32_clock_control.h @@ -135,7 +135,7 @@ #endif #if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(rcc), st_stm32h7_rcc, okay) && \ - DT_NODE_HAS_PROP(DT_NODELABEL(rcc), clocks) + DT_NODE_HAS_PROP(DT_NODELABEL(rcc), d1cpre) #define STM32_D1CPRE DT_PROP(DT_NODELABEL(rcc), d1cpre) #define STM32_HPRE DT_PROP(DT_NODELABEL(rcc), hpre) #define STM32_D2PPRE1 DT_PROP(DT_NODELABEL(rcc), d2ppre1)