From 52e025943a21f64f7534ec4c3670b5af2ed485dc Mon Sep 17 00:00:00 2001 From: Guillaume Gautier Date: Thu, 8 Feb 2024 11:33:36 +0100 Subject: [PATCH] soc: st: stm32: Migrate STM32G0 series Port STM32G0 series to HW model v2 Signed-off-by: Guillaume Gautier --- .../arm/st_stm32/stm32g0/Kconfig.soc | 48 ------------ soc/st/stm32/soc.yml | 14 ++++ .../stm32}/stm32g0/CMakeLists.txt | 2 + .../stm32/stm32g0/Kconfig} | 4 - .../stm32/stm32g0/Kconfig.defconfig} | 5 +- .../stm32g0/Kconfig.defconfig.stm32g030xx | 3 - .../stm32g0/Kconfig.defconfig.stm32g031xx | 3 - .../stm32g0/Kconfig.defconfig.stm32g041xx | 3 - .../stm32g0/Kconfig.defconfig.stm32g050xx | 3 - .../stm32g0/Kconfig.defconfig.stm32g051xx | 3 - .../stm32g0/Kconfig.defconfig.stm32g061xx | 3 - .../stm32g0/Kconfig.defconfig.stm32g070xx | 3 - .../stm32g0/Kconfig.defconfig.stm32g071xx | 3 - .../stm32g0/Kconfig.defconfig.stm32g081xx | 3 - .../stm32g0/Kconfig.defconfig.stm32g0b0xx | 3 - .../stm32g0/Kconfig.defconfig.stm32g0b1xx | 3 - .../stm32g0/Kconfig.defconfig.stm32g0c1xx | 3 - soc/st/stm32/stm32g0/Kconfig.soc | 75 +++++++++++++++++++ .../arm/st_stm32 => st/stm32}/stm32g0/power.c | 0 .../arm/st_stm32 => st/stm32}/stm32g0/soc.c | 0 .../arm/st_stm32 => st/stm32}/stm32g0/soc.h | 0 21 files changed, 92 insertions(+), 92 deletions(-) delete mode 100644 soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.soc rename soc/{soc_legacy/arm/st_stm32 => st/stm32}/stm32g0/CMakeLists.txt (91%) rename soc/{soc_legacy/arm/st_stm32/stm32g0/Kconfig.series => st/stm32/stm32g0/Kconfig} (78%) rename soc/{soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.series => st/stm32/stm32g0/Kconfig.defconfig} (71%) rename soc/{soc_legacy/arm/st_stm32 => st/stm32}/stm32g0/Kconfig.defconfig.stm32g030xx (84%) rename soc/{soc_legacy/arm/st_stm32 => st/stm32}/stm32g0/Kconfig.defconfig.stm32g031xx (83%) rename soc/{soc_legacy/arm/st_stm32 => st/stm32}/stm32g0/Kconfig.defconfig.stm32g041xx (84%) rename soc/{soc_legacy/arm/st_stm32 => st/stm32}/stm32g0/Kconfig.defconfig.stm32g050xx (84%) rename soc/{soc_legacy/arm/st_stm32 => st/stm32}/stm32g0/Kconfig.defconfig.stm32g051xx (84%) rename soc/{soc_legacy/arm/st_stm32 => st/stm32}/stm32g0/Kconfig.defconfig.stm32g061xx (84%) rename soc/{soc_legacy/arm/st_stm32 => st/stm32}/stm32g0/Kconfig.defconfig.stm32g070xx (84%) rename soc/{soc_legacy/arm/st_stm32 => st/stm32}/stm32g0/Kconfig.defconfig.stm32g071xx (87%) rename soc/{soc_legacy/arm/st_stm32 => st/stm32}/stm32g0/Kconfig.defconfig.stm32g081xx (86%) rename soc/{soc_legacy/arm/st_stm32 => st/stm32}/stm32g0/Kconfig.defconfig.stm32g0b0xx (84%) rename soc/{soc_legacy/arm/st_stm32 => st/stm32}/stm32g0/Kconfig.defconfig.stm32g0b1xx (90%) rename soc/{soc_legacy/arm/st_stm32 => st/stm32}/stm32g0/Kconfig.defconfig.stm32g0c1xx (84%) create mode 100644 soc/st/stm32/stm32g0/Kconfig.soc rename soc/{soc_legacy/arm/st_stm32 => st/stm32}/stm32g0/power.c (100%) rename soc/{soc_legacy/arm/st_stm32 => st/stm32}/stm32g0/soc.c (100%) rename soc/{soc_legacy/arm/st_stm32 => st/stm32}/stm32g0/soc.h (100%) diff --git a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.soc b/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.soc deleted file mode 100644 index 592290e2fb9..00000000000 --- a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.soc +++ /dev/null @@ -1,48 +0,0 @@ -# STMicroelectronics STM32G0 MCU line - -# Copyright (c) 2019 Philippe Retornaz -# Copyright (c) 2019 STMicroelectronics -# Copyright (c) 2020 Thomas Stranger -# SPDX-License-Identifier: Apache-2.0 - -choice - prompt "STM32G0x MCU Selection" - depends on SOC_SERIES_STM32G0X - -config SOC_STM32G030XX - bool "STM32G030XX" - -config SOC_STM32G031XX - bool "STM32G031XX" - -config SOC_STM32G041XX - bool "STM32G041XX" - -config SOC_STM32G050XX - bool "STM32G050XX" - -config SOC_STM32G051XX - bool "STM32G051XX" - -config SOC_STM32G061XX - bool "STM32G061XX" - -config SOC_STM32G070XX - bool "STM32G070XX" - -config SOC_STM32G071XX - bool "STM32G071XX" - -config SOC_STM32G081XX - bool "STM32G081XX" - -config SOC_STM32G0B0XX - bool "STM32G0B0XX" - -config SOC_STM32G0B1XX - bool "STM32G0B1XX" - -config SOC_STM32G0C1XX - bool "STM32G0C1XX" - -endchoice diff --git a/soc/st/stm32/soc.yml b/soc/st/stm32/soc.yml index c7851c3bf64..b9483d17af8 100644 --- a/soc/st/stm32/soc.yml +++ b/soc/st/stm32/soc.yml @@ -56,6 +56,20 @@ family: - name: stm32f765xx - name: stm32f767xx - name: stm32f769xx + - name: stm32g0x + socs: + - name: stm32g030xx + - name: stm32g031xx + - name: stm32g041xx + - name: stm32g050xx + - name: stm32g051xx + - name: stm32g061xx + - name: stm32g070xx + - name: stm32g071xx + - name: stm32g081xx + - name: stm32g0b0xx + - name: stm32g0b1xx + - name: stm32g0c1xx - name: stm32l1x socs: - name: stm32l151xb diff --git a/soc/soc_legacy/arm/st_stm32/stm32g0/CMakeLists.txt b/soc/st/stm32/stm32g0/CMakeLists.txt similarity index 91% rename from soc/soc_legacy/arm/st_stm32/stm32g0/CMakeLists.txt rename to soc/st/stm32/stm32g0/CMakeLists.txt index 85869a31ddf..65706e73bfa 100644 --- a/soc/soc_legacy/arm/st_stm32/stm32g0/CMakeLists.txt +++ b/soc/st/stm32/stm32g0/CMakeLists.txt @@ -10,4 +10,6 @@ zephyr_sources_ifdef(CONFIG_PM power.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/stm32g0/Kconfig.series b/soc/st/stm32/stm32g0/Kconfig similarity index 78% rename from soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.series rename to soc/st/stm32/stm32g0/Kconfig index acdb926ef61..8fac199d153 100644 --- a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.series +++ b/soc/st/stm32/stm32g0/Kconfig @@ -5,14 +5,10 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_SERIES_STM32G0X - bool "STM32G0x 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 select HAS_PM - help - Enable support for STM32G0 MCU series diff --git a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.series b/soc/st/stm32/stm32g0/Kconfig.defconfig similarity index 71% rename from soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.series rename to soc/st/stm32/stm32g0/Kconfig.defconfig index 0c5d11beef7..e4978d0cfe4 100644 --- a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.series +++ b/soc/st/stm32/stm32g0/Kconfig.defconfig @@ -7,9 +7,6 @@ if SOC_SERIES_STM32G0X -source "soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g0*" - -config SOC_SERIES - default "stm32g0" +rsource "Kconfig.defconfig.stm32g0*" endif # SOC_SERIES_STM32G0X diff --git a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g030xx b/soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g030xx similarity index 84% rename from soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g030xx rename to soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g030xx index c72bb705866..4800b2584f5 100644 --- a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g030xx +++ b/soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g030xx @@ -5,9 +5,6 @@ if SOC_STM32G030XX -config SOC - default "stm32g030xx" - config NUM_IRQS default 29 diff --git a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g031xx b/soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g031xx similarity index 83% rename from soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g031xx rename to soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g031xx index 9b7236b9853..d6890a5b372 100644 --- a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g031xx +++ b/soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g031xx @@ -5,9 +5,6 @@ if SOC_STM32G031XX -config SOC - default "stm32g031xx" - config NUM_IRQS default 30 diff --git a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g041xx b/soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g041xx similarity index 84% rename from soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g041xx rename to soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g041xx index dc63f9e2520..327f7a42261 100644 --- a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g041xx +++ b/soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g041xx @@ -5,9 +5,6 @@ if SOC_STM32G041XX -config SOC - default "stm32g041xx" - config NUM_IRQS default 32 diff --git a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g050xx b/soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g050xx similarity index 84% rename from soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g050xx rename to soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g050xx index f2e15925046..efaab9634cc 100644 --- a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g050xx +++ b/soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g050xx @@ -5,9 +5,6 @@ if SOC_STM32G050XX -config SOC - default "stm32g050xx" - config NUM_IRQS default 29 diff --git a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g051xx b/soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g051xx similarity index 84% rename from soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g051xx rename to soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g051xx index 67a06d1c139..88177fb506f 100644 --- a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g051xx +++ b/soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g051xx @@ -5,9 +5,6 @@ if SOC_STM32G051XX -config SOC - default "stm32g051xx" - config NUM_IRQS default 30 diff --git a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g061xx b/soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g061xx similarity index 84% rename from soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g061xx rename to soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g061xx index 4d052632eb6..b81c12efefa 100644 --- a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g061xx +++ b/soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g061xx @@ -5,9 +5,6 @@ if SOC_STM32G061XX -config SOC - default "stm32g061xx" - config NUM_IRQS default 32 diff --git a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g070xx b/soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g070xx similarity index 84% rename from soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g070xx rename to soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g070xx index d7eb915534f..502dfe952fb 100644 --- a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g070xx +++ b/soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g070xx @@ -5,9 +5,6 @@ if SOC_STM32G070XX -config SOC - default "stm32g070xx" - config NUM_IRQS default 30 diff --git a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g071xx b/soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g071xx similarity index 87% rename from soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g071xx rename to soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g071xx index a1814043d4d..3c953d99823 100644 --- a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g071xx +++ b/soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g071xx @@ -6,9 +6,6 @@ if SOC_STM32G071XX -config SOC - default "stm32g071xx" - config NUM_IRQS default 31 diff --git a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g081xx b/soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g081xx similarity index 86% rename from soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g081xx rename to soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g081xx index ab46bc38c9d..f308c47e668 100644 --- a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g081xx +++ b/soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g081xx @@ -6,9 +6,6 @@ if SOC_STM32G081XX -config SOC - default "stm32g081xx" - config NUM_IRQS default 32 diff --git a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g0b0xx b/soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g0b0xx similarity index 84% rename from soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g0b0xx rename to soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g0b0xx index 3be972e356a..02829267715 100644 --- a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g0b0xx +++ b/soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g0b0xx @@ -5,9 +5,6 @@ if SOC_STM32G0B0XX -config SOC - default "stm32g0b0xx" - config NUM_IRQS default 30 diff --git a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g0b1xx b/soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g0b1xx similarity index 90% rename from soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g0b1xx rename to soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g0b1xx index 767cea2556c..9a226fc0ad7 100644 --- a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g0b1xx +++ b/soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g0b1xx @@ -5,9 +5,6 @@ if SOC_STM32G0B1XX -config SOC - default "stm32g0b1xx" - config NUM_IRQS default 31 diff --git a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g0c1xx b/soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g0c1xx similarity index 84% rename from soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g0c1xx rename to soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g0c1xx index fed2a1f0932..0e1e696b72a 100644 --- a/soc/soc_legacy/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g0c1xx +++ b/soc/st/stm32/stm32g0/Kconfig.defconfig.stm32g0c1xx @@ -5,9 +5,6 @@ if SOC_STM32G0C1XX -config SOC - default "stm32g0c1xx" - config NUM_IRQS default 32 diff --git a/soc/st/stm32/stm32g0/Kconfig.soc b/soc/st/stm32/stm32g0/Kconfig.soc new file mode 100644 index 00000000000..88729eab261 --- /dev/null +++ b/soc/st/stm32/stm32g0/Kconfig.soc @@ -0,0 +1,75 @@ +# STMicroelectronics STM32G0 MCU line + +# Copyright (c) 2019 Philippe Retornaz +# Copyright (c) 2019 STMicroelectronics +# Copyright (c) 2020 Thomas Stranger +# SPDX-License-Identifier: Apache-2.0 + +config SOC_SERIES_STM32G0X + bool + select SOC_FAMILY_STM32 + +config SOC_SERIES + default "stm32g0" if SOC_SERIES_STM32G0X + +config SOC_STM32G030XX + bool + select SOC_SERIES_STM32G0X + +config SOC_STM32G031XX + bool + select SOC_SERIES_STM32G0X + +config SOC_STM32G041XX + bool + select SOC_SERIES_STM32G0X + +config SOC_STM32G050XX + bool + select SOC_SERIES_STM32G0X + +config SOC_STM32G051XX + bool + select SOC_SERIES_STM32G0X + +config SOC_STM32G061XX + bool + select SOC_SERIES_STM32G0X + +config SOC_STM32G070XX + bool + select SOC_SERIES_STM32G0X + +config SOC_STM32G071XX + bool + select SOC_SERIES_STM32G0X + +config SOC_STM32G081XX + bool + select SOC_SERIES_STM32G0X + +config SOC_STM32G0B0XX + bool + select SOC_SERIES_STM32G0X + +config SOC_STM32G0B1XX + bool + select SOC_SERIES_STM32G0X + +config SOC_STM32G0C1XX + bool + select SOC_SERIES_STM32G0X + +config SOC + default "stm32g030xx" if SOC_STM32G030XX + default "stm32g031xx" if SOC_STM32G031XX + default "stm32g041xx" if SOC_STM32G041XX + default "stm32g050xx" if SOC_STM32G050XX + default "stm32g051xx" if SOC_STM32G051XX + default "stm32g061xx" if SOC_STM32G061XX + default "stm32g070xx" if SOC_STM32G070XX + default "stm32g071xx" if SOC_STM32G071XX + default "stm32g081xx" if SOC_STM32G081XX + default "stm32g0b0xx" if SOC_STM32G0B0XX + default "stm32g0b1xx" if SOC_STM32G0B1XX + default "stm32g0c1xx" if SOC_STM32G0C1XX diff --git a/soc/soc_legacy/arm/st_stm32/stm32g0/power.c b/soc/st/stm32/stm32g0/power.c similarity index 100% rename from soc/soc_legacy/arm/st_stm32/stm32g0/power.c rename to soc/st/stm32/stm32g0/power.c diff --git a/soc/soc_legacy/arm/st_stm32/stm32g0/soc.c b/soc/st/stm32/stm32g0/soc.c similarity index 100% rename from soc/soc_legacy/arm/st_stm32/stm32g0/soc.c rename to soc/st/stm32/stm32g0/soc.c diff --git a/soc/soc_legacy/arm/st_stm32/stm32g0/soc.h b/soc/st/stm32/stm32g0/soc.h similarity index 100% rename from soc/soc_legacy/arm/st_stm32/stm32g0/soc.h rename to soc/st/stm32/stm32g0/soc.h