This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 4c358419f0b8f797c35ac421107cb952a276f22e Author: raiden00pl <raide...@railab.me> AuthorDate: Mon Aug 21 09:51:52 2023 +0200 arch/stm32h7: add an option to bypass clock configuration --- arch/arm/src/stm32h7/Kconfig | 9 +++++++++ arch/arm/src/stm32h7/stm32_rcc.c | 12 +++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/arch/arm/src/stm32h7/Kconfig b/arch/arm/src/stm32h7/Kconfig index f06746ab3f..9706d8ab4b 100644 --- a/arch/arm/src/stm32h7/Kconfig +++ b/arch/arm/src/stm32h7/Kconfig @@ -2090,6 +2090,15 @@ config STM32H7_QSPI_REGDEBUG endmenu +config STM32H7_BYPASS_CLOCKCONFIG + bool "Bypass clock configuration" + depends on ARCH_STM32H7_DUALCORE + default n if ARCH_CHIP_STM32H7_CORTEXM7 + default y if ARCH_CHIP_STM32H7_CORTEXM4 + ---help--- + Bypass clock configuration. For dual core chips only one core + should configure clocks + config STM32H7_CUSTOM_CLOCKCONFIG bool "Custom clock configuration" default n diff --git a/arch/arm/src/stm32h7/stm32_rcc.c b/arch/arm/src/stm32h7/stm32_rcc.c index 924d5a2999..e7b3f30080 100644 --- a/arch/arm/src/stm32h7/stm32_rcc.c +++ b/arch/arm/src/stm32h7/stm32_rcc.c @@ -93,24 +93,25 @@ void stm32_clockconfig(void) { +#ifndef CONFIG_STM32H7_BYPASS_CLOCKCONFIG /* Make sure that we are starting in the reset state */ rcc_reset(); -#if defined(CONFIG_STM32H7_PWR) +# if defined(CONFIG_STM32H7_PWR) /* Insure the bkp is initialized */ stm32_pwr_initbkp(false); -#endif +# endif -#if defined(CONFIG_STM32H7_CUSTOM_CLOCKCONFIG) +# if defined(CONFIG_STM32H7_CUSTOM_CLOCKCONFIG) /* Invoke Board Custom Clock Configuration */ stm32_board_clockconfig(); -#else +# else /* Invoke standard, fixed clock configuration based on definitions in * board.h @@ -118,7 +119,8 @@ void stm32_clockconfig(void) stm32_stdclockconfig(); -#endif +# endif +#endif /* !CONFIG_STM32H7_BYPASS_CLOCKCONFIG */ /* Enable peripheral clocking */