soc/riscv: convert the QEMU virt RISCV-32 SoC to HWMv2
This commit converts the virt SoC (generic virt machine) to the Zephyr HWMv2. Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
This commit is contained in:
committed by
Carles Cufi
parent
6547845e9d
commit
5db061a4c6
@@ -1,5 +1,5 @@
|
||||
# Copyright (c) 2024 Antmicro <www.antmicro.com>
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
zephyr_sources(soc.c)
|
||||
|
||||
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/riscv/common/linker.ld CACHE INTERNAL "")
|
||||
add_subdirectory(common)
|
||||
@@ -1,8 +1,7 @@
|
||||
# Copyright (c) 2020 Cobham Gaisler AB
|
||||
# Copyright (c) 2024 Antmicro <www.antmicro.com>
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
config SOC_RISCV_VIRT
|
||||
bool "QEMU RISC-V VirtIO Board"
|
||||
config SOC_FAMILY_QEMU_VIRT_RISCV
|
||||
select ATOMIC_OPERATIONS_BUILTIN
|
||||
select INCLUDE_RESET_VECTOR
|
||||
select RISCV_ISA_EXT_M
|
||||
@@ -11,3 +10,9 @@ config SOC_RISCV_VIRT
|
||||
select RISCV
|
||||
select RISCV_PRIVILEGED
|
||||
select RISCV_HAS_PLIC
|
||||
|
||||
if SOC_FAMILY_QEMU_VIRT_RISCV
|
||||
|
||||
rsource "*/Kconfig"
|
||||
|
||||
endif # SOC_FAMILY_QEMU_VIRT_RISCV
|
||||
@@ -1,10 +1,8 @@
|
||||
# Copyright (c) 2020 Cobham Gaisler AB
|
||||
# Copyright (c) 2024 Antmicro <www.antmicro.com>
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if SOC_RISCV_VIRT
|
||||
|
||||
config SOC
|
||||
default "virt"
|
||||
if SOC_FAMILY_QEMU_VIRT_RISCV
|
||||
|
||||
config SYS_CLOCK_HW_CYCLES_PER_SEC
|
||||
default 10000000
|
||||
@@ -30,4 +28,4 @@ config NUM_IRQS
|
||||
config PMP_SLOTS
|
||||
default 16
|
||||
|
||||
endif
|
||||
endif # SOC_FAMILY_QEMU_VIRT_RISCV
|
||||
10
soc/riscv/qemu_virt_riscv/Kconfig.soc
Normal file
10
soc/riscv/qemu_virt_riscv/Kconfig.soc
Normal file
@@ -0,0 +1,10 @@
|
||||
# Copyright (c) 2024 Antmicro <www.antmicro.com>
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
config SOC_FAMILY_QEMU_VIRT_RISCV
|
||||
bool
|
||||
|
||||
config SOC_FAMILY
|
||||
default "qemu_virt_riscv" if SOC_FAMILY_QEMU_VIRT_RISCV
|
||||
|
||||
rsource "*/Kconfig.soc"
|
||||
4
soc/riscv/qemu_virt_riscv/common/CMakeLists.txt
Normal file
4
soc/riscv/qemu_virt_riscv/common/CMakeLists.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
# Copyright (c) 2024 Antmicro <www.antmicro.com>
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
zephyr_sources(soc.c)
|
||||
8
soc/riscv/qemu_virt_riscv/qemu_virt_riscv32/Kconfig
Normal file
8
soc/riscv/qemu_virt_riscv/qemu_virt_riscv32/Kconfig
Normal file
@@ -0,0 +1,8 @@
|
||||
# Copyright (c) 2024 Antmicro <www.antmicro.com>
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
config SOC_QEMU_VIRT_RISCV32
|
||||
select CPU_HAS_FPU
|
||||
select RISCV_ISA_RV32I
|
||||
select RISCV_ISA_EXT_ZICSR
|
||||
select RISCV_ISA_EXT_ZIFENCEI
|
||||
9
soc/riscv/qemu_virt_riscv/qemu_virt_riscv32/Kconfig.soc
Normal file
9
soc/riscv/qemu_virt_riscv/qemu_virt_riscv32/Kconfig.soc
Normal file
@@ -0,0 +1,9 @@
|
||||
# Copyright (c) 2024 Antmicro <www.antmicro.com>
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
config SOC_QEMU_VIRT_RISCV32
|
||||
bool
|
||||
select SOC_FAMILY_QEMU_VIRT_RISCV
|
||||
|
||||
config SOC
|
||||
default "qemu_virt_riscv32" if SOC_QEMU_VIRT_RISCV32
|
||||
8
soc/riscv/qemu_virt_riscv/qemu_virt_riscv32e/Kconfig
Normal file
8
soc/riscv/qemu_virt_riscv/qemu_virt_riscv32e/Kconfig
Normal file
@@ -0,0 +1,8 @@
|
||||
# Copyright (c) 2020 Cobham Gaisler AB
|
||||
# Copyright (c) 2024 Antmicro <www.antmicro.com>
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
config SOC_QEMU_VIRT_RISCV32E
|
||||
select RISCV_ISA_RV32E
|
||||
select RISCV_ISA_EXT_ZICSR
|
||||
select RISCV_ISA_EXT_ZIFENCEI
|
||||
9
soc/riscv/qemu_virt_riscv/qemu_virt_riscv32e/Kconfig.soc
Normal file
9
soc/riscv/qemu_virt_riscv/qemu_virt_riscv32e/Kconfig.soc
Normal file
@@ -0,0 +1,9 @@
|
||||
# Copyright (c) 2024 Antmicro <www.antmicro.com>
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
config SOC_QEMU_VIRT_RISCV32E
|
||||
bool
|
||||
select SOC_FAMILY_QEMU_VIRT_RISCV
|
||||
|
||||
config SOC
|
||||
default "qemu_virt_riscv32e" if SOC_QEMU_VIRT_RISCV32E
|
||||
9
soc/riscv/qemu_virt_riscv/qemu_virt_riscv64/Kconfig
Normal file
9
soc/riscv/qemu_virt_riscv/qemu_virt_riscv64/Kconfig
Normal file
@@ -0,0 +1,9 @@
|
||||
# Copyright (c) 2024 Antmicro <www.antmicro.com>
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
config SOC_QEMU_VIRT_RISCV64
|
||||
select 64BIT
|
||||
select CPU_HAS_FPU_DOUBLE_PRECISION
|
||||
select RISCV_ISA_RV64I
|
||||
select RISCV_ISA_EXT_ZICSR
|
||||
select RISCV_ISA_EXT_ZIFENCEI
|
||||
9
soc/riscv/qemu_virt_riscv/qemu_virt_riscv64/Kconfig.soc
Normal file
9
soc/riscv/qemu_virt_riscv/qemu_virt_riscv64/Kconfig.soc
Normal file
@@ -0,0 +1,9 @@
|
||||
# Copyright (c) 2024 Antmicro <www.antmicro.com>
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
config SOC_QEMU_VIRT_RISCV64
|
||||
bool
|
||||
select SOC_FAMILY_QEMU_VIRT_RISCV
|
||||
|
||||
config SOC
|
||||
default "qemu_virt_riscv64" if SOC_QEMU_VIRT_RISCV64
|
||||
6
soc/riscv/qemu_virt_riscv/soc.yml
Normal file
6
soc/riscv/qemu_virt_riscv/soc.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
family:
|
||||
- name: qemu_virt_riscv
|
||||
socs:
|
||||
- name: qemu_virt_riscv32
|
||||
- name: qemu_virt_riscv32e
|
||||
- name: qemu_virt_riscv64
|
||||
Reference in New Issue
Block a user