From b987093a8026c3f36dd010b9075f3e7dd430608c Mon Sep 17 00:00:00 2001 From: Francois Ramu Date: Thu, 8 Feb 2024 11:02:18 +0100 Subject: [PATCH] soc: v2: stm32: Migrate STM32F2 series Port STM32F2 series to HW model V2 Signed-off-by: Francois Ramu --- .../arm/st_stm32/stm32f2/Kconfig.soc | 16 ------------- soc/st/stm32/soc.yml | 4 ++++ .../stm32}/stm32f2/CMakeLists.txt | 2 ++ .../stm32/stm32f2/Kconfig} | 6 +---- .../stm32/stm32f2/Kconfig.defconfig} | 7 ++---- .../stm32f2/Kconfig.defconfig.stm32f205xx | 5 +--- .../stm32f2/Kconfig.defconfig.stm32f207xx | 5 +--- soc/st/stm32/stm32f2/Kconfig.soc | 23 +++++++++++++++++++ .../arm/st_stm32 => st/stm32}/stm32f2/soc.c | 0 .../arm/st_stm32 => st/stm32}/stm32f2/soc.h | 0 10 files changed, 34 insertions(+), 34 deletions(-) delete mode 100644 soc/soc_legacy/arm/st_stm32/stm32f2/Kconfig.soc rename soc/{soc_legacy/arm/st_stm32 => st/stm32}/stm32f2/CMakeLists.txt (87%) rename soc/{soc_legacy/arm/st_stm32/stm32f2/Kconfig.series => st/stm32/stm32f2/Kconfig} (63%) rename soc/{soc_legacy/arm/st_stm32/stm32f2/Kconfig.defconfig.series => st/stm32/stm32f2/Kconfig.defconfig} (56%) rename soc/{soc_legacy/arm/st_stm32 => st/stm32}/stm32f2/Kconfig.defconfig.stm32f205xx (68%) rename soc/{soc_legacy/arm/st_stm32 => st/stm32}/stm32f2/Kconfig.defconfig.stm32f207xx (68%) create mode 100644 soc/st/stm32/stm32f2/Kconfig.soc rename soc/{soc_legacy/arm/st_stm32 => st/stm32}/stm32f2/soc.c (100%) rename soc/{soc_legacy/arm/st_stm32 => st/stm32}/stm32f2/soc.h (100%) diff --git a/soc/soc_legacy/arm/st_stm32/stm32f2/Kconfig.soc b/soc/soc_legacy/arm/st_stm32/stm32f2/Kconfig.soc deleted file mode 100644 index 5c6bd453731..00000000000 --- a/soc/soc_legacy/arm/st_stm32/stm32f2/Kconfig.soc +++ /dev/null @@ -1,16 +0,0 @@ -# ST Microelectronics stm32f2 MCU line - -# Copyright (c) 2018 qianfan Zhao -# SPDX-License-Identifier: Apache-2.0 - -choice - prompt "STM32F2X MCU Selection" - depends on SOC_SERIES_STM32F2X - -config SOC_STM32F207XX - bool "STM32F207XX" - -config SOC_STM32F205XX - bool "STM32F205XX" - -endchoice diff --git a/soc/st/stm32/soc.yml b/soc/st/stm32/soc.yml index 7a000301c3c..7442b37abcd 100644 --- a/soc/st/stm32/soc.yml +++ b/soc/st/stm32/soc.yml @@ -24,6 +24,10 @@ family: - name: stm32f103xe - name: stm32f105xc - name: stm32f107xc + - name: stm32f2x + socs: + - name: stm32f205xx + - name: stm32f207xx - name: stm32f3x socs: - name: stm32f302x8 diff --git a/soc/soc_legacy/arm/st_stm32/stm32f2/CMakeLists.txt b/soc/st/stm32/stm32f2/CMakeLists.txt similarity index 87% rename from soc/soc_legacy/arm/st_stm32/stm32f2/CMakeLists.txt rename to soc/st/stm32/stm32f2/CMakeLists.txt index e02052e3946..eebd281cd96 100644 --- a/soc/soc_legacy/arm/st_stm32/stm32f2/CMakeLists.txt +++ b/soc/st/stm32/stm32f2/CMakeLists.txt @@ -5,4 +5,6 @@ zephyr_sources( soc.c ) +zephyr_include_directories(.) + set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "") diff --git a/soc/soc_legacy/arm/st_stm32/stm32f2/Kconfig.series b/soc/st/stm32/stm32f2/Kconfig similarity index 63% rename from soc/soc_legacy/arm/st_stm32/stm32f2/Kconfig.series rename to soc/st/stm32/stm32f2/Kconfig index 8d2abe1bdfc..4821425c09c 100644 --- a/soc/soc_legacy/arm/st_stm32/stm32f2/Kconfig.series +++ b/soc/st/stm32/stm32f2/Kconfig @@ -1,16 +1,12 @@ -# ST Microelectronics STM32F2X MCU series +# STMicroelectronics STM32F2X MCU series # Copyright (c) 2018 qianfan Zhao # SPDX-License-Identifier: Apache-2.0 config SOC_SERIES_STM32F2X - bool "STM32F2x Series MCU" select ARM select CPU_CORTEX_M3 select CPU_CORTEX_M_HAS_DWT - select SOC_FAMILY_STM32 select HAS_STM32CUBE select HAS_SWO select CPU_HAS_ARM_MPU - help - Enable support for stm32f2 MCU series diff --git a/soc/soc_legacy/arm/st_stm32/stm32f2/Kconfig.defconfig.series b/soc/st/stm32/stm32f2/Kconfig.defconfig similarity index 56% rename from soc/soc_legacy/arm/st_stm32/stm32f2/Kconfig.defconfig.series rename to soc/st/stm32/stm32f2/Kconfig.defconfig index d7a8d30176f..eff10490e63 100644 --- a/soc/soc_legacy/arm/st_stm32/stm32f2/Kconfig.defconfig.series +++ b/soc/st/stm32/stm32f2/Kconfig.defconfig @@ -1,4 +1,4 @@ -# ST Microelectronics STM32F2 MCU line +# STMicroelectronics STM32F2 MCU line # Copyright (c) 2018 qianfan Zhao # SPDX-License-Identifier: Apache-2.0 @@ -7,9 +7,6 @@ if SOC_SERIES_STM32F2X -source "soc/soc_legacy/arm/st_stm32/stm32f2/Kconfig.defconfig.stm32f2*" - -config SOC_SERIES - default "stm32f2" +rsource "Kconfig.defconfig.stm32f2*" endif # SOC_SERIES_STM32F2X diff --git a/soc/soc_legacy/arm/st_stm32/stm32f2/Kconfig.defconfig.stm32f205xx b/soc/st/stm32/stm32f2/Kconfig.defconfig.stm32f205xx similarity index 68% rename from soc/soc_legacy/arm/st_stm32/stm32f2/Kconfig.defconfig.stm32f205xx rename to soc/st/stm32/stm32f2/Kconfig.defconfig.stm32f205xx index 46b8acb5286..d045e6d4560 100644 --- a/soc/soc_legacy/arm/st_stm32/stm32f2/Kconfig.defconfig.stm32f205xx +++ b/soc/st/stm32/stm32f2/Kconfig.defconfig.stm32f205xx @@ -1,13 +1,10 @@ -# ST Microelectronics stm32f205 MCU +# STMicroelectronics stm32f205 MCU # Copyright (c) 2021 Manuel Forcen # SPDX-License-Identifier: Apache-2.0 if SOC_STM32F207XX -config SOC - default "STM32F207xx" - config NUM_IRQS default 81 diff --git a/soc/st/stm32/stm32f2/Kconfig.soc b/soc/st/stm32/stm32f2/Kconfig.soc new file mode 100644 index 00000000000..d59e5a7384f --- /dev/null +++ b/soc/st/stm32/stm32f2/Kconfig.soc @@ -0,0 +1,23 @@ +# STMicroelectronics stm32f2 MCU line + +# Copyright (c) 2018 qianfan Zhao +# SPDX-License-Identifier: Apache-2.0 + +config SOC_SERIES_STM32F2X + bool + select SOC_FAMILY_STM32 + +config SOC_SERIES + default "stm32f2" if SOC_SERIES_STM32F2X + +config SOC_STM32F205XX + bool + select SOC_SERIES_STM32F2X + +config SOC_STM32F207XX + bool + select SOC_SERIES_STM32F2X + +config SOC + default "stm32f205xx" if SOC_STM32F205XX + default "stm32f207xx" if SOC_STM32F207XX diff --git a/soc/soc_legacy/arm/st_stm32/stm32f2/soc.c b/soc/st/stm32/stm32f2/soc.c similarity index 100% rename from soc/soc_legacy/arm/st_stm32/stm32f2/soc.c rename to soc/st/stm32/stm32f2/soc.c diff --git a/soc/soc_legacy/arm/st_stm32/stm32f2/soc.h b/soc/st/stm32/stm32f2/soc.h similarity index 100% rename from soc/soc_legacy/arm/st_stm32/stm32f2/soc.h rename to soc/st/stm32/stm32f2/soc.h