Skip to content

Commit 68fa8f0

Browse files
boards: openhwgroup: add CV64A6 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 in 64-bit configuration 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. Signed-off-by: Eric Ackermann <[email protected]>
1 parent 494f880 commit 68fa8f0

File tree

6 files changed

+194
-0
lines changed

6 files changed

+194
-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_CV64A6_GENESYSII
4+
select SOC_CV64A6
5+
select SOC_SERIES_CV64A6_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: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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+
// these devices are missing in the Northcape board
21+
eth: lowrisc-eth@30000000 {
22+
compatible = "lowrisc-eth";
23+
device_type = "network";
24+
interrupt-parent = <&PLIC0>;
25+
interrupts = <3 0>;
26+
local-mac-address = [00 18 3e 02 e3 7f];
27+
reg = <0x0 0x30000000 0x0 0x8000>;
28+
};
29+
xlnx_gpio: gpio@40000000 {
30+
#gpio-cells = <2>;
31+
compatible = "xlnx,xps-gpio-1.00.a";
32+
gpio-controller ;
33+
reg = <0x0 0x40000000 0x0 0x10000 >;
34+
xlnx,all-inputs = <0x0>;
35+
xlnx,all-inputs-2 = <0x0>;
36+
xlnx,dout-default = <0x0>;
37+
xlnx,dout-default-2 = <0x0>;
38+
xlnx,gpio-width = <0x8>;
39+
xlnx,gpio2-width = <0x8>;
40+
xlnx,interrupt-present = <0x0>;
41+
xlnx,is-dual = <0x1>;
42+
xlnx,tri-default = <0xffffffff>;
43+
xlnx,tri-default-2 = <0xffffffff>;
44+
};
45+
};
46+
47+
&uart0 {
48+
status = "okay";
49+
// different interrupt than the CISPA version of the SoC
50+
interrupts = <1>;
51+
};
52+
53+
&spi0 {
54+
status = "okay";
55+
// different interrupt than the CISPA version of the SoC
56+
interrupts = <2 2>;
57+
};
58+
59+
&clint{
60+
status = "okay";
61+
};
62+
63+
&dma0 {
64+
status = "disabled";
65+
};
66+
67+
68+
&mdio0{
69+
status = "disabled";
70+
};
71+
72+
&eth0 {
73+
status = "disabled";
74+
};
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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_1ST_LEVEL_INTERRUPT_BITS=7
27+
CONFIG_2ND_LEVEL_INTERRUPT_BITS=23
28+
CONFIG_PLIC=y
29+
CONFIG_3RD_LEVEL_INTERRUPTS=n
30+
CONFIG_3RD_LEVEL_INTERRUPT_BITS=0
31+
32+
# no networking support on this board
33+
34+
# required for the DMA, as no cache coherency in this configuration
35+
CONFIG_SOC_SERIES_CV64A6_PROVIDE_NONSTANDARD_CACHE_OPTIONS=y
36+
CONFIG_DMA_XILINX_AXI_DMA_DISABLE_CACHE_WHEN_ACCESSING_SG_DESCRIPTORS=y
37+
38+
# logging
39+
CONFIG_LOG=y
40+
CONFIG_LOG_DEFAULT_LEVEL=3
41+
CONFIG_THREAD_NAME=y
42+
43+
# increased stack sizes
44+
CONFIG_ISR_STACK_SIZE=524288
45+
CONFIG_MAIN_STACK_SIZE=524288
46+
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=524288
47+
CONFIG_IDLE_STACK_SIZE=524288
48+
CONFIG_NET_TCP_WORKQ_STACK_SIZE=524288
49+
CONFIG_NET_TX_STACK_SIZE=524288
50+
CONFIG_NET_RX_STACK_SIZE=524288
51+
CONFIG_NET_MGMT_EVENT_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"

0 commit comments

Comments
 (0)