|
| 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