Skip to content

Commit 089b027

Browse files
boards: openhwgroup: add CVA6 on GenesysII board
Adds support for the CVA6 CPU on a GenesysII FPGA board (https://github.com/openhwgroup/cva6). The SoC currently contains the CVA6 CPU with the SV39 MMU, interrupt controllers (CLINT and PLIC), UART, a SPI for booting from SD, a boot ROM, and I2C controller for on-board audio, a GPIO and the lowRISC ethernet subsystem. Two slightly different versions of the board are added, with a 64-bit and a 64-bit configuration of CVA6, respectively. Signed-off-by: Eric Ackermann <[email protected]>
1 parent 494f880 commit 089b027

File tree

12 files changed

+334
-0
lines changed

12 files changed

+334
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright 2024 CISPA Helmholtz Center for Information Security gGmbH
2+
# SPDX-License-Identifier: Apache-2.0
3+
config BOARD_CV32A6_GENESYSII
4+
select SOC_CV32A6
5+
select SOC_FAMILY_CVA6_PROVIDE_FPGA_POWEROFF
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright 2024 CISPA Helmholtz Center for Information Security gGmbH
2+
# SPDX-License-Identifier: Apache-2.0
3+
board_runner_args(openocd "--config=${BOARD_DIR}/support/ariane.cfg")
4+
board_runner_args(openocd "--use-elf")
5+
board_runner_args(openocd "--verify")
6+
board_runner_args(openocd "--cmd-pre-init=riscv.cpu configure -work-area-phys 0x90000000 -work-area-size 16780000")
7+
8+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright 2024 CISPA Helmholtz Center for Information Security gGmbH
2+
# SPDX-License-Identifier: Apache-2.0
3+
board:
4+
name: cv32a6_genesysII
5+
vendor: openhwgroup
6+
socs:
7+
- name: cv32a6
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/*
2+
* Copyright (c) 2024 CISPA Helmholtz Center for Information Security gGmbH
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
/dts-v1/;
7+
8+
#include <openhwgroup/cv32a6.dtsi>
9+
10+
/ {
11+
model = "Openhardwaregroup CV32A6 on Genesys II";
12+
compatible = "ariane,cv32a6_genesysII";
13+
14+
chosen {
15+
zephyr,console = &uart0;
16+
zephyr,shell-uart = &uart0;
17+
zephyr,sram = &memory0;
18+
};
19+
};
20+
21+
&uart0 {
22+
status = "okay";
23+
// different interrupt than the CISPA version of the SoC
24+
interrupts = <1 4>;
25+
};
26+
27+
&spi0 {
28+
status = "okay";
29+
// different interrupt than the CISPA version of the SoC
30+
interrupts = <2 2>;
31+
};
32+
33+
&clint{
34+
status = "okay";
35+
};
36+
37+
&dma0 {
38+
status = "disabled";
39+
};
40+
41+
42+
&mdio0{
43+
status = "disabled";
44+
};
45+
46+
&eth0 {
47+
status = "disabled";
48+
};
49+
50+
&eth {
51+
status = "okay";
52+
};
53+
54+
&xlnx_gpio {
55+
status = "okay";
56+
};
57+
58+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Copyright 2024 CISPA Helmholtz Center for Information Security gGmbH
2+
# SPDX-License-Identifier: Apache-2.0
3+
CONFIG_BASE64=y
4+
CONFIG_INCLUDE_RESET_VECTOR=y
5+
CONFIG_CONSOLE=y
6+
CONFIG_SERIAL=y
7+
CONFIG_UART_CONSOLE=y
8+
CONFIG_UART_NS16550=y
9+
CONFIG_UART_NS16550_ACCESS_WORD_ONLY=y
10+
CONFIG_CONSOLE_HANDLER=y
11+
CONFIG_XIP=n
12+
CONFIG_INIT_STACKS=y
13+
CONFIG_SYS_CLOCK_TICKS_PER_SEC=25000000
14+
CONFIG_FPU=y
15+
CONFIG_POWEROFF=y
16+
17+
# RNG
18+
CONFIG_TIMER_RANDOM_GENERATOR=y
19+
CONFIG_TEST_RANDOM_GENERATOR=y
20+
21+
# IRQs
22+
CONFIG_MULTI_LEVEL_INTERRUPTS=y
23+
CONFIG_2ND_LEVEL_INTERRUPTS=y
24+
# 1 PLIC
25+
CONFIG_NUM_2ND_LEVEL_AGGREGATORS=1
26+
CONFIG_PLIC=y
27+
CONFIG_3RD_LEVEL_INTERRUPTS=n
28+
29+
# no networking support on this board
30+
31+
# logging
32+
CONFIG_LOG=y
33+
CONFIG_LOG_DEFAULT_LEVEL=3
34+
CONFIG_THREAD_NAME=y
35+
36+
# increased stack sizes
37+
CONFIG_ISR_STACK_SIZE=524288
38+
CONFIG_MAIN_STACK_SIZE=524288
39+
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=524288
40+
CONFIG_IDLE_STACK_SIZE=524288
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright 2024 CISPA Helmholtz Center for Information Security gGmbH
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# Based on the ariane.cfg from the cva6 project:
5+
# https://github.com/openhwgroup/cva6/blob/master/corev_apu/fpga/ariane.cfg
6+
adapter_khz 1000
7+
8+
interface ftdi
9+
ftdi_vid_pid 0x0403 0x6010
10+
11+
# Channel 1 is taken by Xilinx JTAG
12+
ftdi_channel 0
13+
14+
# links:
15+
# http://openocd.org/doc-release/html/Debug-Adapter-Configuration.html
16+
#
17+
# Bit MPSSE FT2232 JTAG Type Description
18+
# Bit0 TCK ADBUS0 TCK Out Clock Signal Output
19+
# Bit1 TDI ADBUS1 TDI Out Serial Data Out
20+
# Bit2 TDO ADBUS2 TDO In Serial Data In
21+
# Bit3 TMS ADBUS3 TMS Out Select Signal Out
22+
# Bit4 GPIOL0 ADBUS4 nTRST In/Out General Purpose I/O
23+
# this corresponds to the following in/out layout, with TMS initially set to 1
24+
ftdi_layout_init 0x0018 0x001b
25+
# we only have to specify nTRST, the others are assigned correctly by default
26+
ftdi_layout_signal nTRST -ndata 0x0010
27+
28+
set _CHIPNAME riscv
29+
jtag newtap $_CHIPNAME cpu -irlen 5
30+
31+
set _TARGETNAME $_CHIPNAME.cpu
32+
target create $_TARGETNAME riscv -chain-position $_TARGETNAME -coreid 0
33+
34+
gdb_report_data_abort enable
35+
gdb_report_register_access_error enable
36+
37+
riscv set_reset_timeout_sec 120
38+
riscv set_command_timeout_sec 120
39+
40+
# prefer to use sba for system bus access
41+
riscv set_prefer_sba off
42+
43+
# Try enabling address translation (only works for newer versions)
44+
if { [catch {riscv set_enable_virtual on} ] } {
45+
echo "Warning: This version of OpenOCD does not support address translation. To debug on virtual addresses, please update to the latest version." }
46+
47+
init
48+
halt
49+
echo "Ready for Remote Connections"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright 2024 CISPA Helmholtz Center for Information Security gGmbH
2+
# SPDX-License-Identifier: Apache-2.0
3+
config BOARD_CV64A6_GENESYSII
4+
select SOC_CV64A6_IMAFDC
5+
select SOC_FAMILY_CVA6_PROVIDE_FPGA_POWEROFF
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright 2024 CISPA Helmholtz Center for Information Security gGmbH
2+
# SPDX-License-Identifier: Apache-2.0
3+
board_runner_args(openocd "--config=${BOARD_DIR}/support/ariane.cfg")
4+
board_runner_args(openocd "--use-elf")
5+
board_runner_args(openocd "--verify")
6+
board_runner_args(openocd "--cmd-pre-init=riscv.cpu configure -work-area-phys 0x90000000 -work-area-size 16780000")
7+
8+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright 2024 CISPA Helmholtz Center for Information Security gGmbH
2+
# SPDX-License-Identifier: Apache-2.0
3+
board:
4+
name: cv64a6_genesysII
5+
vendor: openhwgroup
6+
socs:
7+
- name: cv64a6
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/*
2+
* Copyright (c) 2024 CISPA Helmholtz Center for Information Security gGmbH
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
/dts-v1/;
7+
8+
#include <openhwgroup/cv64a6.dtsi>
9+
10+
/ {
11+
model = "Openhardwaregroup CV64A6 on Genesys II";
12+
compatible = "ariane,cv64a6_genesysII";
13+
14+
chosen {
15+
zephyr,console = &uart0;
16+
zephyr,shell-uart = &uart0;
17+
zephyr,sram = &memory0;
18+
};
19+
};
20+
21+
&uart0 {
22+
status = "okay";
23+
// different interrupt than the CISPA version of the SoC
24+
interrupts = <1 4>;
25+
};
26+
27+
&spi0 {
28+
status = "okay";
29+
// different interrupt than the CISPA version of the SoC
30+
interrupts = <2 2>;
31+
};
32+
33+
&clint{
34+
status = "okay";
35+
};
36+
37+
&dma0 {
38+
status = "disabled";
39+
};
40+
41+
42+
&mdio0{
43+
status = "disabled";
44+
};
45+
46+
&eth0 {
47+
status = "disabled";
48+
};
49+
50+
&eth {
51+
status = "okay";
52+
};
53+
54+
&xlnx_gpio {
55+
status = "okay";
56+
};
57+
58+

0 commit comments

Comments
 (0)