soc: arm: Add CONFIG_STM32H7_BOOT_M4_AT_INIT

This new Kconfig option lets the developer configure if the Cortex M4
core should be force-booted during M7 init independent of the BCM4
option byte.

This allows to disable this default behaviour via Kconfig which was not
possible so far.

Signed-off-by: Jan Krautmacher <jan@krautmacher.org>
This commit is contained in:
Jan Krautmacher 2023-02-09 07:55:35 +01:00 committed by Carles Cufí
commit 759b572711
2 changed files with 5 additions and 1 deletions

View file

@ -78,3 +78,7 @@ config SOC_STM32H7B3XXQ
select CPU_HAS_FPU_DOUBLE_PRECISION select CPU_HAS_FPU_DOUBLE_PRECISION
endchoice endchoice
config STM32H7_BOOT_M4_AT_INIT
bool "Boot M4 core during M7 init independent of option byte BCM4."
default y

View file

@ -37,7 +37,7 @@ static int stm32h7_m4_wakeup(void)
* then Cortex-M7 takes HSEM so that CM4 can continue running. * then Cortex-M7 takes HSEM so that CM4 can continue running.
*/ */
LL_HSEM_1StepLock(HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID); LL_HSEM_1StepLock(HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID);
} else { } else if (IS_ENABLED(CONFIG_STM32H7_BOOT_M4_AT_INIT)) {
/* CM4 is not started at boot, start it now */ /* CM4 is not started at boot, start it now */
LL_RCC_ForceCM4Boot(); LL_RCC_ForceCM4Boot();
} }