From 466ca63c2be1799184d72fe14a34eb48c0534ead Mon Sep 17 00:00:00 2001 From: Fabio Baltieri Date: Mon, 16 Aug 2021 15:35:34 +0100 Subject: [PATCH] drivers: ipm: set IPM_STM32_HSEM default from the device tree Change IPM_STM32_HSEM Kconfig definition so that it picks the correct default automatically depending on which cpu node is enabled in the device tree, rather than relying on board specific Kconfig overrides. Signed-off-by: Fabio Baltieri --- boards/arm/stm32h747i_disco/Kconfig.defconfig | 8 -------- drivers/ipm/Kconfig | 3 ++- dts/arm/st/h7/stm32h7.dtsi | 2 +- dts/arm/st/h7/stm32h7_dualcore.dtsi | 2 +- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/boards/arm/stm32h747i_disco/Kconfig.defconfig b/boards/arm/stm32h747i_disco/Kconfig.defconfig index f87aa3dd9d0..c8fa55a2e37 100644 --- a/boards/arm/stm32h747i_disco/Kconfig.defconfig +++ b/boards/arm/stm32h747i_disco/Kconfig.defconfig @@ -12,14 +12,6 @@ config BOARD config STM32H7_DUAL_CORE default y -if IPM_STM32_HSEM - -config IPM_STM32_HSEM_CPU - default 1 if BOARD_STM32H747I_DISCO_M7 - default 2 if BOARD_STM32H747I_DISCO_M4 - -endif # IPM_STM32_HSEM - if NETWORKING config NET_L2_ETHERNET diff --git a/drivers/ipm/Kconfig b/drivers/ipm/Kconfig index dc4b619a53b..fe47738f7fe 100644 --- a/drivers/ipm/Kconfig +++ b/drivers/ipm/Kconfig @@ -120,7 +120,8 @@ config IPM_STM32_HSEM config IPM_STM32_HSEM_CPU int "HSEM CPU ID" - default 1 + default 1 if "$(dt_nodelabel_enabled,cpu0)" + default 2 if "$(dt_nodelabel_enabled,cpu1)" range 1 2 depends on IPM_STM32_HSEM help diff --git a/dts/arm/st/h7/stm32h7.dtsi b/dts/arm/st/h7/stm32h7.dtsi index 59023f2a51f..e09c32a6a08 100644 --- a/dts/arm/st/h7/stm32h7.dtsi +++ b/dts/arm/st/h7/stm32h7.dtsi @@ -24,7 +24,7 @@ #address-cells = <1>; #size-cells = <0>; - cpu@0 { + cpu0: cpu@0 { device_type = "cpu"; compatible = "arm,cortex-m7"; reg = <0>; diff --git a/dts/arm/st/h7/stm32h7_dualcore.dtsi b/dts/arm/st/h7/stm32h7_dualcore.dtsi index 3e52b93a806..941abf1fb13 100644 --- a/dts/arm/st/h7/stm32h7_dualcore.dtsi +++ b/dts/arm/st/h7/stm32h7_dualcore.dtsi @@ -8,7 +8,7 @@ / { cpus { - cpu@1 { + cpu1: cpu@1 { device_type = "cpu"; compatible = "arm,cortex-m4f"; reg = <1>;