diff --git a/soc/soc_legacy/riscv/sifive_freedom/CMakeLists.txt b/soc/sifive/sifive_freedom/CMakeLists.txt similarity index 100% rename from soc/soc_legacy/riscv/sifive_freedom/CMakeLists.txt rename to soc/sifive/sifive_freedom/CMakeLists.txt diff --git a/soc/sifive/sifive_freedom/Kconfig b/soc/sifive/sifive_freedom/Kconfig new file mode 100644 index 00000000000..cee97a755b6 --- /dev/null +++ b/soc/sifive/sifive_freedom/Kconfig @@ -0,0 +1,9 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# Copyright (c) 2024 Antmicro +# SPDX-License-Identifier: Apache-2.0 + +if SOC_FAMILY_SIFIVE_FREEDOM + +rsource "*/Kconfig" + +endif # SOC_FAMILY_SIFIVE_FREEDOM diff --git a/soc/sifive/sifive_freedom/Kconfig.defconfig b/soc/sifive/sifive_freedom/Kconfig.defconfig new file mode 100644 index 00000000000..004ef668fcf --- /dev/null +++ b/soc/sifive/sifive_freedom/Kconfig.defconfig @@ -0,0 +1,9 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# Copyright (c) 2024 Antmicro +# SPDX-License-Identifier: Apache-2.0 + +if SOC_FAMILY_SIFIVE_FREEDOM + +rsource "*/Kconfig.defconfig" + +endif # SOC_FAMILY_SIFIVE_FREEDOM diff --git a/soc/sifive/sifive_freedom/Kconfig.soc b/soc/sifive/sifive_freedom/Kconfig.soc new file mode 100644 index 00000000000..e0bf27cb808 --- /dev/null +++ b/soc/sifive/sifive_freedom/Kconfig.soc @@ -0,0 +1,11 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# Copyright (c) 2024 Antmicro +# SPDX-License-Identifier: Apache-2.0 + +config SOC_FAMILY_SIFIVE_FREEDOM + bool + +config SOC_FAMILY + default "sifive_freedom" if SOC_FAMILY_SIFIVE_FREEDOM + +rsource "*/Kconfig.soc" diff --git a/soc/soc_legacy/riscv/sifive_freedom/common/CMakeLists.txt b/soc/sifive/sifive_freedom/common/CMakeLists.txt similarity index 100% rename from soc/soc_legacy/riscv/sifive_freedom/common/CMakeLists.txt rename to soc/sifive/sifive_freedom/common/CMakeLists.txt diff --git a/soc/soc_legacy/riscv/sifive_freedom/common/pinctrl_soc.h b/soc/sifive/sifive_freedom/common/pinctrl_soc.h similarity index 100% rename from soc/soc_legacy/riscv/sifive_freedom/common/pinctrl_soc.h rename to soc/sifive/sifive_freedom/common/pinctrl_soc.h diff --git a/soc/soc_legacy/riscv/sifive_freedom/e300/CMakeLists.txt b/soc/sifive/sifive_freedom/fe300/CMakeLists.txt similarity index 84% rename from soc/soc_legacy/riscv/sifive_freedom/e300/CMakeLists.txt rename to soc/sifive/sifive_freedom/fe300/CMakeLists.txt index baf01a6b047..4c3ee8c2ad8 100644 --- a/soc/soc_legacy/riscv/sifive_freedom/e300/CMakeLists.txt +++ b/soc/sifive/sifive_freedom/fe300/CMakeLists.txt @@ -1,5 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 zephyr_sources(clock.c) +zephyr_include_directories(.) set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/riscv/common/linker.ld CACHE INTERNAL "") diff --git a/soc/soc_legacy/riscv/sifive_freedom/e300/Kconfig.soc b/soc/sifive/sifive_freedom/fe300/Kconfig similarity index 56% rename from soc/soc_legacy/riscv/sifive_freedom/e300/Kconfig.soc rename to soc/sifive/sifive_freedom/fe300/Kconfig index e53b84c0890..e5796d7c9dc 100644 --- a/soc/soc_legacy/riscv/sifive_freedom/e300/Kconfig.soc +++ b/soc/sifive/sifive_freedom/fe300/Kconfig @@ -1,20 +1,19 @@ -# RISCV_SIFIVE_FREEDOM SOC configuration options - # Copyright (c) 2017 Jean-Paul Etienne +# Copyright (c) 2024 Antmicro # SPDX-License-Identifier: Apache-2.0 -choice - prompt "SiFive Freedom SOC implementation" - depends on SOC_SERIES_SIFIVE_FREEDOM_E300 +config SOC_SERIES_SIFIVE_FREEDOM_FE300 + bool -config SOC_SIFIVE_FREEDOM_E340 - bool "SiFive Freedom SOC implementation" - select ATOMIC_OPERATIONS_C - select INCLUDE_RESET_VECTOR + # RISC-V options + select RISCV + select RISCV_PRIVILEGED + select RISCV_HAS_PLIC select RISCV_ISA_RV32I select RISCV_ISA_EXT_M select RISCV_ISA_EXT_A select RISCV_ISA_EXT_ZICSR select RISCV_ISA_EXT_ZIFENCEI -endchoice + select ATOMIC_OPERATIONS_C + select INCLUDE_RESET_VECTOR diff --git a/soc/soc_legacy/riscv/sifive_freedom/e300/Kconfig.defconfig.series b/soc/sifive/sifive_freedom/fe300/Kconfig.defconfig similarity index 68% rename from soc/soc_legacy/riscv/sifive_freedom/e300/Kconfig.defconfig.series rename to soc/sifive/sifive_freedom/fe300/Kconfig.defconfig index 4eaaa9b59a9..c280c62ef43 100644 --- a/soc/soc_legacy/riscv/sifive_freedom/e300/Kconfig.defconfig.series +++ b/soc/sifive/sifive_freedom/fe300/Kconfig.defconfig @@ -1,10 +1,8 @@ # Copyright (c) 2017 Jean-Paul Etienne +# Copyright (c) 2024 Antmicro # SPDX-License-Identifier: Apache-2.0 -if SOC_SERIES_SIFIVE_FREEDOM_E300 - -config SOC_SERIES - default "e300" +if SOC_SERIES_SIFIVE_FREEDOM_FE300 config SYS_CLOCK_HW_CYCLES_PER_SEC default 32768 @@ -27,6 +25,4 @@ config MAX_IRQ_PER_AGGREGATOR config NUM_IRQS default 64 -source "soc/soc_legacy/riscv/sifive_freedom/e300/Kconfig.defconfig.e*" - -endif # SOC_SERIES_SIFIVE_FREEDOM_E300 +endif # SOC_SERIES_SIFIVE_FREEDOM_FE300 diff --git a/soc/sifive/sifive_freedom/fe300/Kconfig.soc b/soc/sifive/sifive_freedom/fe300/Kconfig.soc new file mode 100644 index 00000000000..e5229d16710 --- /dev/null +++ b/soc/sifive/sifive_freedom/fe300/Kconfig.soc @@ -0,0 +1,16 @@ +# Copyright (c) 2024 Antmicro +# SPDX-License-Identifier: Apache-2.0 + +config SOC_SERIES_SIFIVE_FREEDOM_FE300 + bool + select SOC_FAMILY_SIFIVE_FREEDOM + +config SOC_SERIES + default "fe300" if SOC_SERIES_SIFIVE_FREEDOM_FE300 + +config SOC_SIFIVE_FREEDOM_FE310 + bool + select SOC_SERIES_SIFIVE_FREEDOM_FE300 + +config SOC + default "fe310" if SOC_SIFIVE_FREEDOM_FE310 diff --git a/soc/soc_legacy/riscv/sifive_freedom/e300/clock.c b/soc/sifive/sifive_freedom/fe300/clock.c similarity index 100% rename from soc/soc_legacy/riscv/sifive_freedom/e300/clock.c rename to soc/sifive/sifive_freedom/fe300/clock.c diff --git a/soc/soc_legacy/riscv/sifive_freedom/e300/prci.h b/soc/sifive/sifive_freedom/fe300/prci.h similarity index 100% rename from soc/soc_legacy/riscv/sifive_freedom/e300/prci.h rename to soc/sifive/sifive_freedom/fe300/prci.h diff --git a/soc/soc_legacy/riscv/sifive_freedom/e300/soc.h b/soc/sifive/sifive_freedom/fe300/soc.h similarity index 100% rename from soc/soc_legacy/riscv/sifive_freedom/e300/soc.h rename to soc/sifive/sifive_freedom/fe300/soc.h diff --git a/soc/sifive/sifive_freedom/soc.yml b/soc/sifive/sifive_freedom/soc.yml new file mode 100644 index 00000000000..d87ecc9c6e3 --- /dev/null +++ b/soc/sifive/sifive_freedom/soc.yml @@ -0,0 +1,6 @@ +family: + - name: sifive_freedom + series: + - name: fe300 + socs: + - name: fe310 diff --git a/soc/soc_legacy/riscv/sifive_freedom/e300/Kconfig.defconfig.e340 b/soc/soc_legacy/riscv/sifive_freedom/e300/Kconfig.defconfig.e340 deleted file mode 100644 index cb0131f1427..00000000000 --- a/soc/soc_legacy/riscv/sifive_freedom/e300/Kconfig.defconfig.e340 +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) 2017 Jean-Paul Etienne -# SPDX-License-Identifier: Apache-2.0 - -config SOC - default "e340" if SOC_SIFIVE_FREEDOM_E340 diff --git a/soc/soc_legacy/riscv/sifive_freedom/e300/Kconfig.series b/soc/soc_legacy/riscv/sifive_freedom/e300/Kconfig.series deleted file mode 100644 index 81634da000d..00000000000 --- a/soc/soc_legacy/riscv/sifive_freedom/e300/Kconfig.series +++ /dev/null @@ -1,13 +0,0 @@ -# RISCV_SIFIVE_FREEDOM SOC implementation - -# Copyright (c) 2017 Jean-Paul Etienne -# SPDX-License-Identifier: Apache-2.0 - -config SOC_SERIES_SIFIVE_FREEDOM_E300 - bool "SiFive Freedom E300 SOC implementation" - select RISCV - select RISCV_PRIVILEGED - select RISCV_HAS_PLIC - select SOC_FAMILY_SIFIVE_FREEDOM - help - Enable support for SiFive Freedom FE300 SOC