Skip to content

Commit 3c655d2

Browse files
boards: openhwgroup: add CV64A6 on GenesysII board
Adds support for the CVA6 CPU on a GenesysII FPGA board forked by CISPA with Xilinx AXI Ethernet (https://github.com/cispa/CVA6-Vivado-Project-with-Xilinx-AXI-Ethernet). 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 Xilinx AXI Ethernet subsystem. Signed-off-by: Eric Ackermann <[email protected]>
1 parent 874e4e2 commit 3c655d2

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_CISPA
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_cispa
5+
vendor: openhwgroup
6+
socs:
7+
- name: cv64a6
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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 = "CV64A6 on Genesys II (CISPA fork with Xilinx AXI Ethernet, https://github.com/cispa/CVA6-Vivado-Project-with-Xilinx-AXI-Ethernet/tree/main)";
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+
};
24+
25+
&spi0 {
26+
status = "okay";
27+
};
28+
29+
&clint{
30+
status = "okay";
31+
};
32+
33+
&dma0 {
34+
status = "okay";
35+
};
36+
37+
38+
39+
&mdio0{
40+
status = "okay";
41+
42+
phy0: phy@1 {
43+
#address-cells = <1>;
44+
#size-cells = <0>;
45+
compatible = "ethernet-phy";
46+
reg = <1 1>;
47+
status="okay";
48+
};
49+
};
50+
51+
&eth0 {
52+
status = "okay";
53+
phy-handle=<&phy0>;
54+
};
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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+
# Ethernet / Networking
30+
CONFIG_DMA=y
31+
CONFIG_DMA_64BIT=y
32+
CONFIG_DMA_XILINX_AXI_DMA=y
33+
CONFIG_ETH_DRIVER=y
34+
CONFIG_NET_L2_ETHERNET=y
35+
CONFIG_ETH_XILINX_AXIENET=y
36+
CONFIG_MDIO=y
37+
CONFIG_PHY_GENERIC_MII=y
38+
CONFIG_MDIO_XILINX_AXI_ENET=y
39+
CONFIG_NET_IPV4=y
40+
CONFIG_NET_TCP=y
41+
CONFIG_NETWORKING=y
42+
CONFIG_NET_PKT_RX_COUNT=64
43+
# other values not supported
44+
CONFIG_NET_TC_RX_COUNT=1
45+
CONFIG_NET_TC_TX_COUNT=1
46+
47+
# this is the choice that is safe in all scenarios
48+
# overwrite in project if you know a less restrictive choice works for your project
49+
CONFIG_DMA_XILINX_AXI_DMA_LOCK_ALL_IRQS=y
50+
CONFIG_DMA_XILINX_AXI_DMA_SG_DESCRIPTOR_NUM_RX=16
51+
CONFIG_DMA_XILINX_AXI_DMA_SG_DESCRIPTOR_NUM_TX=16
52+
CONFIG_DMA_LOG_LEVEL_INF=y
53+
54+
# required for the DMA, as no cache coherency in this configuration
55+
CONFIG_SOC_SERIES_CV64A6_PROVIDE_NONSTANDARD_CACHE_OPTIONS=y
56+
CONFIG_DMA_XILINX_AXI_DMA_DISABLE_CACHE_WHEN_ACCESSING_SG_DESCRIPTORS=y
57+
58+
# logging
59+
CONFIG_LOG=y
60+
CONFIG_LOG_DEFAULT_LEVEL=3
61+
CONFIG_THREAD_NAME=y
62+
63+
# increased stack sizes
64+
CONFIG_ISR_STACK_SIZE=524288
65+
CONFIG_MAIN_STACK_SIZE=524288
66+
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=524288
67+
CONFIG_IDLE_STACK_SIZE=524288
68+
CONFIG_NET_TCP_WORKQ_STACK_SIZE=524288
69+
CONFIG_NET_TX_STACK_SIZE=524288
70+
CONFIG_NET_RX_STACK_SIZE=524288
71+
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)