diff --git a/soc/soc_legacy/arm/st_stm32/stm32c0/Kconfig.soc b/soc/soc_legacy/arm/st_stm32/stm32c0/Kconfig.soc deleted file mode 100644 index e54678aefff..00000000000 --- a/soc/soc_legacy/arm/st_stm32/stm32c0/Kconfig.soc +++ /dev/null @@ -1,13 +0,0 @@ -# STMicroelectronics STM32C0 MCU line - -# Copyright (c) 2023 Benjamin Björnsson -# SPDX-License-Identifier: Apache-2.0 - -choice - prompt "STM32C0x MCU Selection" - depends on SOC_SERIES_STM32C0X - -config SOC_STM32C031XX - bool "STM32C031XX" - -endchoice diff --git a/soc/st/stm32/soc.yml b/soc/st/stm32/soc.yml index 446aac35f45..3f698450bf7 100644 --- a/soc/st/stm32/soc.yml +++ b/soc/st/stm32/soc.yml @@ -1,6 +1,9 @@ family: - name: st_stm32 series: + - name: stm32c0x + socs: + - name: stm32c031xx - name: stm32f0x socs: - name: stm32f030x6 diff --git a/soc/soc_legacy/arm/st_stm32/stm32c0/CMakeLists.txt b/soc/st/stm32/stm32c0/CMakeLists.txt similarity index 87% rename from soc/soc_legacy/arm/st_stm32/stm32c0/CMakeLists.txt rename to soc/st/stm32/stm32c0/CMakeLists.txt index e02052e3946..eebd281cd96 100644 --- a/soc/soc_legacy/arm/st_stm32/stm32c0/CMakeLists.txt +++ b/soc/st/stm32/stm32c0/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/stm32c0/Kconfig.series b/soc/st/stm32/stm32c0/Kconfig similarity index 76% rename from soc/soc_legacy/arm/st_stm32/stm32c0/Kconfig.series rename to soc/st/stm32/stm32c0/Kconfig index cc69099a6c6..8d8c1b89d18 100644 --- a/soc/soc_legacy/arm/st_stm32/stm32c0/Kconfig.series +++ b/soc/st/stm32/stm32c0/Kconfig @@ -4,13 +4,9 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_SERIES_STM32C0X - bool "STM32C0x Series MCU" select ARM select CPU_CORTEX_M0PLUS select CPU_CORTEX_M_HAS_VTOR select CPU_HAS_ARM_MPU - select SOC_FAMILY_STM32 select HAS_STM32CUBE select CPU_CORTEX_M_HAS_SYSTICK - help - Enable support for STM32C0 MCU series diff --git a/soc/soc_legacy/arm/st_stm32/stm32c0/Kconfig.defconfig.series b/soc/st/stm32/stm32c0/Kconfig.defconfig similarity index 64% rename from soc/soc_legacy/arm/st_stm32/stm32c0/Kconfig.defconfig.series rename to soc/st/stm32/stm32c0/Kconfig.defconfig index b598cda5617..b960c560bc5 100644 --- a/soc/soc_legacy/arm/st_stm32/stm32c0/Kconfig.defconfig.series +++ b/soc/st/stm32/stm32c0/Kconfig.defconfig @@ -5,9 +5,6 @@ if SOC_SERIES_STM32C0X -source "soc/soc_legacy/arm/st_stm32/stm32c0/Kconfig.defconfig.stm32c0*" - -config SOC_SERIES - default "stm32c0" +rsource "Kconfig.defconfig.stm32c0*" endif # SOC_SERIES_STM32C0X diff --git a/soc/soc_legacy/arm/st_stm32/stm32c0/Kconfig.defconfig.stm32c031xx b/soc/st/stm32/stm32c0/Kconfig.defconfig.stm32c031xx similarity index 86% rename from soc/soc_legacy/arm/st_stm32/stm32c0/Kconfig.defconfig.stm32c031xx rename to soc/st/stm32/stm32c0/Kconfig.defconfig.stm32c031xx index 5a84b4ff31a..96f2cc8da2a 100644 --- a/soc/soc_legacy/arm/st_stm32/stm32c0/Kconfig.defconfig.stm32c031xx +++ b/soc/st/stm32/stm32c0/Kconfig.defconfig.stm32c031xx @@ -5,9 +5,6 @@ if SOC_STM32C031XX -config SOC - default "stm32c031xx" - config NUM_IRQS default 29 diff --git a/soc/st/stm32/stm32c0/Kconfig.soc b/soc/st/stm32/stm32c0/Kconfig.soc new file mode 100644 index 00000000000..078839f5fe3 --- /dev/null +++ b/soc/st/stm32/stm32c0/Kconfig.soc @@ -0,0 +1,18 @@ +# STMicroelectronics STM32C0 MCU line + +# Copyright (c) 2023 Benjamin Björnsson +# SPDX-License-Identifier: Apache-2.0 + +config SOC_SERIES_STM32C0X + bool + select SOC_FAMILY_STM32 + +config SOC_SERIES + default "stm32c0" if SOC_SERIES_STM32C0X + +config SOC_STM32C031XX + bool + select SOC_SERIES_STM32C0X + +config SOC + default "stm32c031xx" if SOC_STM32C031XX diff --git a/soc/soc_legacy/arm/st_stm32/stm32c0/soc.c b/soc/st/stm32/stm32c0/soc.c similarity index 100% rename from soc/soc_legacy/arm/st_stm32/stm32c0/soc.c rename to soc/st/stm32/stm32c0/soc.c diff --git a/soc/soc_legacy/arm/st_stm32/stm32c0/soc.h b/soc/st/stm32/stm32c0/soc.h similarity index 100% rename from soc/soc_legacy/arm/st_stm32/stm32c0/soc.h rename to soc/st/stm32/stm32c0/soc.h