Skip to content

Commit a83ee5e

Browse files
boards: openhwgroup: add CVA6 on Genesys 2 board
Adds support for the CVA6 CPU on a Genesys 2 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 20be1b5 commit a83ee5e

18 files changed

+412
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright 2024 CISPA Helmholtz Center for Information Security gGmbH
2+
# SPDX-License-Identifier: Apache-2.0
3+
config BOARD_CV32A6_GENESYS_2
4+
select SOC_CV32A6
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)
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:
4+
name: cv32a6_genesys_2
5+
full_name: Genesys 2 with CV32A6 SoC
6+
vendor: openhwgroup
7+
socs:
8+
- name: cv32a6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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 2";
12+
compatible = "openhwgroup,cv32a6_genesys_2";
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+
};
24+
25+
&spi0 {
26+
status = "okay";
27+
};
28+
29+
&clint {
30+
status = "okay";
31+
};
32+
33+
&eth {
34+
local-mac-address = [00 18 3e 02 e3 7f];
35+
status = "okay";
36+
};
37+
38+
&xlnx_gpio {
39+
status = "okay";
40+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright 2024 CISPA Helmholtz Center for Information Security gGmbH
2+
# SPDX-License-Identifier: Apache-2.0
3+
CONFIG_INCLUDE_RESET_VECTOR=y
4+
CONFIG_CONSOLE=y
5+
CONFIG_SERIAL=y
6+
CONFIG_UART_CONSOLE=y
7+
CONFIG_UART_NS16550_ACCESS_WORD_ONLY=y
8+
CONFIG_CONSOLE_HANDLER=y
9+
CONFIG_XIP=n
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
.. zephyr:board:: cv32a6_genesys_2
2+
3+
Overview
4+
********
5+
6+
The Digilent Genesys 2 board features a Xilinx Kintex-7 FPGA which can run various softcore CPUs.
7+
In this configuration, the Genesys 2 is configured with a 32-bit version of the CVA6 RISC-V CPU.
8+
The SoC is configured with a memory controller interfacing with the Genesys' DRAM, PLIC and CLINT
9+
interrupt controllers, a UART device interfacing with the Genesys' USB UART, a RISC-V compatible
10+
debug module that interfaces with the Genesys' FTDI (USB JTAG) chip, a Xilinx SPI interface
11+
interfacing with the Genesys' SD card slot and a Xilinx GPIO interfacing with the Genesys' LEDs
12+
and switches.
13+
The complete hardware sources (see first reference) in conjunction with
14+
instructions for compiling and loading the configuration onto the Genesys 2 are available.
15+
16+
See the following references for more information:
17+
18+
- `CVA6 documentation`_
19+
- `Genesys 2 Reference Manual`_
20+
- `Genesys 2 Schematic`_
21+
22+
Hardware
23+
********
24+
25+
- CVA6 CPU with RV32imac instruction sets with PLIC, CLINT interrupt controllers.
26+
- 1 GB DDR3 DRAM
27+
- 10/100/1000 Ethernet with copper interface, lowRISC Ethernet MAC
28+
- ns16550a-compatible USB UART, 115200 baud
29+
- RISCV debug module, connected via on-board FTDI (USB JTAG)
30+
- Xilinx SPI controller, connected to microSD slot
31+
- Xilinx GPIO, connected to 7 switches and LEDs
32+
33+
Supported Features
34+
==================
35+
36+
.. zephyr:board-supported-hw::
37+
38+
Programming and Debugging
39+
*************************
40+
41+
Loading the FPGA configuration
42+
==============================
43+
44+
You need to build a bitstream with Xilinx Vivado and load it into the FPGA
45+
before you can load zephyr onto the board.
46+
Please refer to the CVA6 documentation for the required steps.
47+
This configuration is compatible with the following build targets:
48+
cv32a6_imac_sv0, cv32a6_imac_sv32, cv32a6_imafc_sv32, cv32a6_ima_sv32_fpga.
49+
50+
Flashing
51+
========
52+
west flash is supported via the openocd runner.
53+
Here is an example for the :zephyr:code-sample:`hello_world` application.
54+
55+
.. zephyr-app-commands::
56+
:zephyr-app: samples/hello_world
57+
:board: cv32a6_genesys_2
58+
:goals: build flash
59+
60+
Debugging
61+
=========
62+
63+
west debug, attach and debugserver commands are supported via the openocd runner.
64+
Here is an example for the :zephyr:code-sample:`hello_world` application.
65+
66+
.. zephyr-app-commands::
67+
:zephyr-app: samples/hello_world
68+
:board: cv32a6_genesys_2
69+
:goals: build debug
70+
71+
References
72+
**********
73+
74+
.. _CVA6 documentation:
75+
https://github.com/openhwgroup/cva6
76+
77+
.. _Genesys 2 Reference Manual:
78+
https://digilent.com/reference/programmable-logic/genesys-2/reference-manual
79+
80+
.. _Genesys 2 Schematic:
81+
https://digilent.com/reference/_media/reference/programmable-logic/genesys-2/genesys-2_sch.pdf
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"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright 2024 CISPA Helmholtz Center for Information Security gGmbH
2+
# SPDX-License-Identifier: Apache-2.0
3+
config BOARD_CV64A6_GENESYS_2
4+
select SOC_CV64A6_IMAFDC
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)
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:
4+
name: cv64a6_genesys_2
5+
full_name: Digilent Genesys 2 with CV64A6 SoC
6+
vendor: openhwgroup
7+
socs:
8+
- name: cv64a6_imafdc
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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 2";
12+
compatible = "openhwgroup,cv64a6_genesys_2";
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+
};
24+
25+
&spi0 {
26+
status = "okay";
27+
};
28+
29+
&clint{
30+
status = "okay";
31+
};
32+
33+
&dma0 {
34+
status = "disabled";
35+
};
36+
37+
&eth {
38+
local-mac-address = [00 18 3e 02 e3 7f];
39+
status = "okay";
40+
};
41+
42+
&xlnx_gpio {
43+
status = "okay";
44+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright 2024 CISPA Helmholtz Center for Information Security gGmbH
2+
# SPDX-License-Identifier: Apache-2.0
3+
CONFIG_INCLUDE_RESET_VECTOR=y
4+
CONFIG_CONSOLE=y
5+
CONFIG_SERIAL=y
6+
CONFIG_UART_CONSOLE=y
7+
CONFIG_UART_NS16550_ACCESS_WORD_ONLY=y
8+
CONFIG_CONSOLE_HANDLER=y
9+
CONFIG_XIP=n
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
.. zephyr:board:: cv64a6_genesys_2
2+
3+
Overview
4+
********
5+
6+
The Digilent Genesys 2 board features a Xilinx Kintex-7 FPGA which can run various softcore CPUs.
7+
In this configuration, the Genesys 2 is configured with a 64-bit version of the CVA6 RISC-V CPU.
8+
The SoC is configured with a memory controller interfacing with the Genesys' DRAM, PLIC and CLINT
9+
interrupt controllers, a UART device interfacing with the Genesys' USB UART, a RISC-V compatible
10+
debug module that interfaces with the Genesys' FTDI (USB JTAG) chip, a Xilinx SPI interface
11+
interfacing with the Genesys' SD card slot and a Xilinx GPIO interfacing with the Genesys' LEDs
12+
and switches.
13+
The complete hardware sources (see first reference) in conjunction with
14+
instructions for compiling and loading the configuration onto the Genesys 2 are available.
15+
16+
See the following references for more information:
17+
18+
- `CVA6 documentation`_
19+
- `Genesys 2 Reference Manual`_
20+
- `Genesys 2 Schematic`_
21+
22+
Hardware
23+
********
24+
25+
- CVA6 CPU with RV64imafdc instruction sets and an SV39 MMU
26+
- 1 GB DDR3 DRAM
27+
- 10/100/1000 Ethernet with copper interface, lowRISC Ethernet MAC
28+
- ns16550a-compatible USB UART, 115200 baud
29+
- RISCV debug module, connected via on-board FTDI (USB JTAG)
30+
- Xilinx SPI controller, connected to microSD slot
31+
- Xilinx GPIO, connected to 7 switches and LEDs
32+
33+
Supported Features
34+
==================
35+
36+
.. zephyr:board-supported-hw::
37+
38+
Programming and Debugging
39+
*************************
40+
41+
Loading the FPGA configuration
42+
==============================
43+
44+
You need to build a bitstream with Xilinx Vivado and load it into the FPGA
45+
before you can load zephyr onto the board.
46+
Please refer to the CVA6 documentation for the required steps.
47+
This configuration is compatible with the following build target: cv64a6_imafdc_sv39
48+
49+
Flashing
50+
========
51+
west flash is supported via the openocd runner.
52+
Here is an example for the :zephyr:code-sample:`hello_world` application.
53+
54+
.. zephyr-app-commands::
55+
:zephyr-app: samples/hello_world
56+
:board: cv64a6_genesys_2
57+
:goals: build flash
58+
59+
Debugging
60+
=========
61+
62+
west debug, attach and debugserver commands are supported via the openocd runner.
63+
Here is an example for the :zephyr:code-sample:`hello_world` application.
64+
65+
.. zephyr-app-commands::
66+
:zephyr-app: samples/hello_world
67+
:board: cv64a6_genesys_2
68+
:goals: build debug
69+
70+
References
71+
**********
72+
73+
.. _CVA6 documentation:
74+
https://github.com/openhwgroup/cva6
75+
76+
.. _Genesys 2 Reference Manual:
77+
https://digilent.com/reference/programmable-logic/genesys-2/reference-manual
78+
79+
.. _Genesys 2 Schematic:
80+
https://digilent.com/reference/_media/reference/programmable-logic/genesys-2/genesys-2_sch.pdf

0 commit comments

Comments
 (0)