diff --git a/soc/soc_legacy/riscv/sifive_freedom/u700/CMakeLists.txt b/soc/sifive/sifive_freedom/fu700/CMakeLists.txt similarity index 84% rename from soc/soc_legacy/riscv/sifive_freedom/u700/CMakeLists.txt rename to soc/sifive/sifive_freedom/fu700/CMakeLists.txt index baf01a6b047..4c3ee8c2ad8 100644 --- a/soc/soc_legacy/riscv/sifive_freedom/u700/CMakeLists.txt +++ b/soc/sifive/sifive_freedom/fu700/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/sifive/sifive_freedom/fu700/Kconfig b/soc/sifive/sifive_freedom/fu700/Kconfig new file mode 100644 index 00000000000..11804e56b92 --- /dev/null +++ b/soc/sifive/sifive_freedom/fu700/Kconfig @@ -0,0 +1,19 @@ +# Copyright (c) 2024 Antmicro +# SPDX-License-Identifier: Apache-2.0 + +config SOC_SERIES_SIFIVE_FREEDOM_FU700 + bool + + # RISC-V options + select RISCV + select RISCV_PRIVILEGED + select RISCV_HAS_PLIC + select RISCV_ISA_RV64I + 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 INCLUDE_RESET_VECTOR + select 64BIT diff --git a/soc/soc_legacy/riscv/sifive_freedom/u700/Kconfig.defconfig.series b/soc/sifive/sifive_freedom/fu700/Kconfig.defconfig similarity index 68% rename from soc/soc_legacy/riscv/sifive_freedom/u700/Kconfig.defconfig.series rename to soc/sifive/sifive_freedom/fu700/Kconfig.defconfig index 6d5be6e3190..56aab7e3df8 100644 --- a/soc/soc_legacy/riscv/sifive_freedom/u700/Kconfig.defconfig.series +++ b/soc/sifive/sifive_freedom/fu700/Kconfig.defconfig @@ -1,10 +1,7 @@ # Copyright (c) 2017 Jean-Paul Etienne # SPDX-License-Identifier: Apache-2.0 -if SOC_SERIES_SIFIVE_FREEDOM_U700 - -config SOC_SERIES - default "u700" +if SOC_SERIES_SIFIVE_FREEDOM_FU700 config SYS_CLOCK_HW_CYCLES_PER_SEC default 32768 @@ -27,6 +24,4 @@ config MAX_IRQ_PER_AGGREGATOR config NUM_IRQS default 64 -source "soc/soc_legacy/riscv/sifive_freedom/u700/Kconfig.defconfig.u*" - -endif # SOC_SERIES_SIFIVE_FREEDOM_U700 +endif # SOC_SERIES_SIFIVE_FREEDOM_FU700 diff --git a/soc/sifive/sifive_freedom/fu700/Kconfig.soc b/soc/sifive/sifive_freedom/fu700/Kconfig.soc new file mode 100644 index 00000000000..db58d77a2c3 --- /dev/null +++ b/soc/sifive/sifive_freedom/fu700/Kconfig.soc @@ -0,0 +1,16 @@ +# Copyright (c) 2024 Antmicro +# SPDX-License-Identifier: Apache-2.0 + +config SOC_SERIES_SIFIVE_FREEDOM_FU700 + bool + select SOC_FAMILY_SIFIVE_FREEDOM + +config SOC_SERIES + default "fu700" if SOC_SERIES_SIFIVE_FREEDOM_FU700 + +config SOC_SIFIVE_FREEDOM_FU740 + bool + select SOC_SERIES_SIFIVE_FREEDOM_FU700 + +config SOC + default "fu740" if SOC_SIFIVE_FREEDOM_FU740 diff --git a/soc/soc_legacy/riscv/sifive_freedom/u700/clock.c b/soc/sifive/sifive_freedom/fu700/clock.c similarity index 100% rename from soc/soc_legacy/riscv/sifive_freedom/u700/clock.c rename to soc/sifive/sifive_freedom/fu700/clock.c diff --git a/soc/soc_legacy/riscv/sifive_freedom/u700/prci.h b/soc/sifive/sifive_freedom/fu700/prci.h similarity index 100% rename from soc/soc_legacy/riscv/sifive_freedom/u700/prci.h rename to soc/sifive/sifive_freedom/fu700/prci.h diff --git a/soc/soc_legacy/riscv/sifive_freedom/u700/soc.h b/soc/sifive/sifive_freedom/fu700/soc.h similarity index 100% rename from soc/soc_legacy/riscv/sifive_freedom/u700/soc.h rename to soc/sifive/sifive_freedom/fu700/soc.h diff --git a/soc/sifive/sifive_freedom/soc.yml b/soc/sifive/sifive_freedom/soc.yml index 61c02c1bc0d..1590d495d15 100644 --- a/soc/sifive/sifive_freedom/soc.yml +++ b/soc/sifive/sifive_freedom/soc.yml @@ -7,3 +7,6 @@ family: - name: fu500 socs: - name: fu540 + - name: fu700 + socs: + - name: fu740 diff --git a/soc/soc_legacy/riscv/sifive_freedom/Kconfig b/soc/soc_legacy/riscv/sifive_freedom/Kconfig deleted file mode 100644 index 17421c3fa0a..00000000000 --- a/soc/soc_legacy/riscv/sifive_freedom/Kconfig +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config SOC_FAMILY_SIFIVE_FREEDOM - bool - -if SOC_FAMILY_SIFIVE_FREEDOM - -config SOC_FAMILY - string - default "sifive_freedom" - -source "soc/soc_legacy/riscv/sifive_freedom/*/Kconfig.soc" - -endif # SOC_FAMILY_SIFIVE_FREEDOM diff --git a/soc/soc_legacy/riscv/sifive_freedom/Kconfig.defconfig b/soc/soc_legacy/riscv/sifive_freedom/Kconfig.defconfig deleted file mode 100644 index 0d72935578f..00000000000 --- a/soc/soc_legacy/riscv/sifive_freedom/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/sifive_freedom/*/Kconfig.defconfig.series" diff --git a/soc/soc_legacy/riscv/sifive_freedom/Kconfig.soc b/soc/soc_legacy/riscv/sifive_freedom/Kconfig.soc deleted file mode 100644 index b2dacb8d1b3..00000000000 --- a/soc/soc_legacy/riscv/sifive_freedom/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/sifive_freedom/*/Kconfig.series" diff --git a/soc/soc_legacy/riscv/sifive_freedom/u700/Kconfig.defconfig.u740 b/soc/soc_legacy/riscv/sifive_freedom/u700/Kconfig.defconfig.u740 deleted file mode 100644 index ca935f772eb..00000000000 --- a/soc/soc_legacy/riscv/sifive_freedom/u700/Kconfig.defconfig.u740 +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) 2017 Jean-Paul Etienne -# SPDX-License-Identifier: Apache-2.0 - -config SOC - default "u740" if SOC_SIFIVE_FREEDOM_U740 diff --git a/soc/soc_legacy/riscv/sifive_freedom/u700/Kconfig.series b/soc/soc_legacy/riscv/sifive_freedom/u700/Kconfig.series deleted file mode 100644 index 04bdc1fb9b2..00000000000 --- a/soc/soc_legacy/riscv/sifive_freedom/u700/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_U700 - bool "SiFive Freedom SOC U700 implementation" - select RISCV - select RISCV_PRIVILEGED - select RISCV_HAS_PLIC - select SOC_FAMILY_SIFIVE_FREEDOM - help - Enable support for SiFive Freedom U700 SOC diff --git a/soc/soc_legacy/riscv/sifive_freedom/u700/Kconfig.soc b/soc/soc_legacy/riscv/sifive_freedom/u700/Kconfig.soc deleted file mode 100644 index 1eec9b4bb17..00000000000 --- a/soc/soc_legacy/riscv/sifive_freedom/u700/Kconfig.soc +++ /dev/null @@ -1,22 +0,0 @@ -# RISCV_SIFIVE_FREEDOM SOC configuration options - -# Copyright (c) 2017 Jean-Paul Etienne -# SPDX-License-Identifier: Apache-2.0 - -choice - prompt "SiFive Freedom SOC implementation" - depends on SOC_SERIES_SIFIVE_FREEDOM_U700 - -config SOC_SIFIVE_FREEDOM_U740 - bool "SiFive Freedom U740 SOC implementation" - select ATOMIC_OPERATIONS_C - select INCLUDE_RESET_VECTOR - select 64BIT - select RISCV_ISA_RV64I - 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