diff --git a/soc/soc_legacy/riscv/gd_gd32/gd32vf103/CMakeLists.txt b/soc/gd_gd32/gd32vf103/CMakeLists.txt similarity index 90% rename from soc/soc_legacy/riscv/gd_gd32/gd32vf103/CMakeLists.txt rename to soc/gd_gd32/gd32vf103/CMakeLists.txt index 9fa5868a2a6..6778c0a4f1b 100644 --- a/soc/soc_legacy/riscv/gd_gd32/gd32vf103/CMakeLists.txt +++ b/soc/gd_gd32/gd32vf103/CMakeLists.txt @@ -4,6 +4,8 @@ zephyr_sources(entry.S) zephyr_sources(soc.c) +zephyr_include_directories(.) + zephyr_linker_sources(ROM_START SORT_KEY 0x0 init.ld) set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/riscv/common/linker.ld CACHE INTERNAL "") diff --git a/soc/soc_legacy/riscv/gd_gd32/gd32vf103/Kconfig.series b/soc/gd_gd32/gd32vf103/Kconfig similarity index 65% rename from soc/soc_legacy/riscv/gd_gd32/gd32vf103/Kconfig.series rename to soc/gd_gd32/gd32vf103/Kconfig index e50567e0798..d206100c53e 100644 --- a/soc/soc_legacy/riscv/gd_gd32/gd32vf103/Kconfig.series +++ b/soc/gd_gd32/gd32vf103/Kconfig @@ -4,17 +4,17 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_SERIES_GD32VF103 - bool "GigaDevice GD32VF103 series SoC implementation" select RISCV select RISCV_PRIVILEGED + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI + select RISCV_HAS_CLIC select ATOMIC_OPERATIONS_C select INCLUDE_RESET_VECTOR - select BUILD_OUTPUT_HEX - select XIP select GD32_HAS_AFIO_PINMUX select GD32_HAS_IRC_40K - select HAS_GD32_HAL - select RISCV_HAS_CLIC - select SOC_FAMILY_GD32 - help - Enable support for GigaDevice GD32VF1 series SoC + select XIP diff --git a/soc/soc_legacy/riscv/gd_gd32/gd32vf103/Kconfig.defconfig.gd32vf103 b/soc/gd_gd32/gd32vf103/Kconfig.defconfig.gd32vf103 similarity index 86% rename from soc/soc_legacy/riscv/gd_gd32/gd32vf103/Kconfig.defconfig.gd32vf103 rename to soc/gd_gd32/gd32vf103/Kconfig.defconfig.gd32vf103 index d37b27ffbf0..714741364bb 100644 --- a/soc/soc_legacy/riscv/gd_gd32/gd32vf103/Kconfig.defconfig.gd32vf103 +++ b/soc/gd_gd32/gd32vf103/Kconfig.defconfig.gd32vf103 @@ -3,9 +3,6 @@ if SOC_GD32VF103 -config SOC - default "gd32vf103" - config KERNEL_ENTRY default "__nuclei_start" @@ -30,15 +27,6 @@ config NUM_IRQS config 2ND_LEVEL_INTERRUPTS default y -config PINCTRL - default y - -config RESET - default y - -config CLOCK_CONTROL - default y - config ARCH_IRQ_VECTOR_TABLE_ALIGN default 512 if NUCLEI_ECLIC diff --git a/soc/soc_legacy/riscv/gd_gd32/gd32vf103/Kconfig.defconfig.series b/soc/gd_gd32/gd32vf103/Kconfig.defconfig.series similarity index 57% rename from soc/soc_legacy/riscv/gd_gd32/gd32vf103/Kconfig.defconfig.series rename to soc/gd_gd32/gd32vf103/Kconfig.defconfig.series index 788627e04b3..78a912701d9 100644 --- a/soc/soc_legacy/riscv/gd_gd32/gd32vf103/Kconfig.defconfig.series +++ b/soc/gd_gd32/gd32vf103/Kconfig.defconfig.series @@ -3,9 +3,6 @@ if SOC_SERIES_GD32VF103 -source "soc/soc_legacy/riscv/gd_gd32/gd32vf103/Kconfig.defconfig.gd32vf103*" - -config SOC_SERIES - default "gd32vf103" +rsource "Kconfig.defconfig.gd32*" endif # SOC_SERIES_GD32VF103 diff --git a/soc/gd_gd32/gd32vf103/Kconfig.soc b/soc/gd_gd32/gd32vf103/Kconfig.soc new file mode 100644 index 00000000000..c692e914ad1 --- /dev/null +++ b/soc/gd_gd32/gd32vf103/Kconfig.soc @@ -0,0 +1,20 @@ +# GD32VF103 SOC configuration options + +# Copyright (c) 2021 Tokita, Hiroshi +# SPDX-License-Identifier: Apache-2.0 + +config SOC_SERIES_GD32VF103 + bool + select SOC_FAMILY_GD_GD32 + help + Enable support for GigaDevice GD32VF103 MCU series + +config SOC_SERIES + default "gd32vf103" if SOC_SERIES_GD32VF103 + +config SOC_GD32VF103 + bool + select SOC_SERIES_GD32VF103 + +config SOC + default "gd32vf103" if SOC_GD32VF103 diff --git a/soc/soc_legacy/riscv/gd_gd32/gd32vf103/entry.S b/soc/gd_gd32/gd32vf103/entry.S similarity index 100% rename from soc/soc_legacy/riscv/gd_gd32/gd32vf103/entry.S rename to soc/gd_gd32/gd32vf103/entry.S diff --git a/soc/soc_legacy/riscv/gd_gd32/gd32vf103/gd32_regs.h b/soc/gd_gd32/gd32vf103/gd32_regs.h similarity index 100% rename from soc/soc_legacy/riscv/gd_gd32/gd32vf103/gd32_regs.h rename to soc/gd_gd32/gd32vf103/gd32_regs.h diff --git a/soc/soc_legacy/riscv/gd_gd32/gd32vf103/init.ld b/soc/gd_gd32/gd32vf103/init.ld similarity index 100% rename from soc/soc_legacy/riscv/gd_gd32/gd32vf103/init.ld rename to soc/gd_gd32/gd32vf103/init.ld diff --git a/soc/soc_legacy/riscv/gd_gd32/gd32vf103/nuclei_csr.h b/soc/gd_gd32/gd32vf103/nuclei_csr.h similarity index 100% rename from soc/soc_legacy/riscv/gd_gd32/gd32vf103/nuclei_csr.h rename to soc/gd_gd32/gd32vf103/nuclei_csr.h diff --git a/soc/soc_legacy/riscv/gd_gd32/gd32vf103/pinctrl_soc.h b/soc/gd_gd32/gd32vf103/pinctrl_soc.h similarity index 100% rename from soc/soc_legacy/riscv/gd_gd32/gd32vf103/pinctrl_soc.h rename to soc/gd_gd32/gd32vf103/pinctrl_soc.h diff --git a/soc/soc_legacy/riscv/gd_gd32/gd32vf103/soc.c b/soc/gd_gd32/gd32vf103/soc.c similarity index 100% rename from soc/soc_legacy/riscv/gd_gd32/gd32vf103/soc.c rename to soc/gd_gd32/gd32vf103/soc.c diff --git a/soc/gd_gd32/soc.yml b/soc/gd_gd32/soc.yml index 4e7de83750f..22339687e19 100644 --- a/soc/gd_gd32/soc.yml +++ b/soc/gd_gd32/soc.yml @@ -25,3 +25,6 @@ family: - name: gd32l23x socs: - name: gd32l233 + - name: gd32vf103 + socs: + - name: gd32vf103 diff --git a/soc/soc_legacy/riscv/gd_gd32/CMakeLists.txt b/soc/soc_legacy/riscv/gd_gd32/CMakeLists.txt deleted file mode 100644 index 69b2926358e..00000000000 --- a/soc/soc_legacy/riscv/gd_gd32/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor -# SPDX-License-Identifier: Apache-2.0 - -add_subdirectory(${SOC_SERIES}) diff --git a/soc/soc_legacy/riscv/gd_gd32/Kconfig b/soc/soc_legacy/riscv/gd_gd32/Kconfig deleted file mode 100644 index f537e170e73..00000000000 --- a/soc/soc_legacy/riscv/gd_gd32/Kconfig +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config SOC_FAMILY_GD32 - bool - -if SOC_FAMILY_GD32 - -config SOC_FAMILY - string - default "gd_gd32" - -source "soc/soc_legacy/riscv/gd_gd32/*/Kconfig.soc" - -endif # SOC_FAMILY_GIGADEVICE_GD32 diff --git a/soc/soc_legacy/riscv/gd_gd32/Kconfig.defconfig b/soc/soc_legacy/riscv/gd_gd32/Kconfig.defconfig deleted file mode 100644 index 52c75459556..00000000000 --- a/soc/soc_legacy/riscv/gd_gd32/Kconfig.defconfig +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -source "soc/soc_legacy/riscv/gd_gd32/*/Kconfig.defconfig.series" diff --git a/soc/soc_legacy/riscv/gd_gd32/Kconfig.soc b/soc/soc_legacy/riscv/gd_gd32/Kconfig.soc deleted file mode 100644 index c2f360ba734..00000000000 --- a/soc/soc_legacy/riscv/gd_gd32/Kconfig.soc +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -source "soc/soc_legacy/riscv/gd_gd32/*/Kconfig.series" diff --git a/soc/soc_legacy/riscv/gd_gd32/gd32vf103/Kconfig.soc b/soc/soc_legacy/riscv/gd_gd32/gd32vf103/Kconfig.soc deleted file mode 100644 index a2da5540e41..00000000000 --- a/soc/soc_legacy/riscv/gd_gd32/gd32vf103/Kconfig.soc +++ /dev/null @@ -1,19 +0,0 @@ -# GD32VF103 SOC configuration options - -# Copyright (c) 2021 Tokita, Hiroshi -# SPDX-License-Identifier: Apache-2.0 - -choice - prompt "GigaDevice GD32VF103 SOC implementation" - depends on SOC_SERIES_GD32VF103 - -config SOC_GD32VF103 - bool "GD32VF103" - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI - -endchoice