[openocd] split configuration files

This commit is contained in:
stnolting 2025-02-02 18:52:05 +01:00
parent 31e4535dd0
commit 7e3583ed6c
2 changed files with 13 additions and 124 deletions

View file

@ -1,64 +1,10 @@
# The NEORV32 RISC-V Processor - https://github.com/stnolting/neorv32
# OpenOCD on-chip debugger configuration file for SINGLE-CORE configuration
echo "NEORV32 single-core openOCD configuration."
echo "*****************************************"
echo "NEORV32 single-core openOCD configuration"
echo "*****************************************"
# -------------------------------------------------------------------
# Physical interface configuration; ADJUST THIS FOR YOUR ADAPTER
# -------------------------------------------------------------------
adapter driver ftdi
ftdi vid_pid 0x0403 0x6010
ftdi channel 0
ftdi layout_init 0x0038 0x003b
adapter speed 4000
transport select jtag
# -------------------------------------------------------------------
# Target configuration
# -------------------------------------------------------------------
set _CHIPNAME neorv32
jtag newtap $_CHIPNAME cpu -irlen 5
set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME riscv -chain-position $_TARGETNAME
# expose NEORV32-specific CSRs
riscv expose_csrs 2048=cfureg0
riscv expose_csrs 2049=cfureg1
riscv expose_csrs 2050=cfureg2
riscv expose_csrs 2051=cfureg3
riscv expose_csrs 4032=mxisa
# -------------------------------------------------------------------
# Server configuration
# -------------------------------------------------------------------
gdb report_data_abort enable
# -------------------------------------------------------------------
# Initialize target
# -------------------------------------------------------------------
init
# -------------------------------------------------------------------
# Authenticate; ADJUST THIS FOR YOUR AUTHENTICATOR
# -------------------------------------------------------------------
set challenge [riscv authdata_read]
riscv authdata_write [expr {$challenge | 1}]
# -------------------------------------------------------------------
# Check if device is authenticated (bit 7 in dmstatus)
# -------------------------------------------------------------------
set dmstatus [riscv dmi_read 0x11]
if { [expr {$dmstatus & (1<<7)}] } {
echo "Authentication passed."
} else {
echo "AUTHENTICATION FAILED!"
exit
}
# -------------------------------------------------------------------
# Target should be halted and ready now
# -------------------------------------------------------------------
halt
echo "Target HALTED. Ready for remote connections."
set PATH [ file dirname [ file normalize [ info script ] ] ]
source [file join $PATH target.cfg]
target_setup 1

View file

@ -1,67 +1,10 @@
# The NEORV32 RISC-V Processor - https://github.com/stnolting/neorv32
# OpenOCD on-chip debugger configuration file for DUAL-CORE configuration
# OpenOCD on-chip debugger configuration file for DUAL-CORE SMP configuration
echo "NEORV32 dual-core openOCD configuration."
echo "*******************************************"
echo "NEORV32 SMP dual-core openOCD configuration"
echo "*******************************************"
# -------------------------------------------------------------------
# Physical interface configuration; ADJUST THIS FOR YOUR ADAPTER
# -------------------------------------------------------------------
adapter driver ftdi
ftdi vid_pid 0x0403 0x6010
ftdi channel 0
ftdi layout_init 0x0038 0x003b
adapter speed 4000
transport select jtag
# -------------------------------------------------------------------
# Target configuration
# -------------------------------------------------------------------
set _CHIPNAME neorv32
jtag newtap $_CHIPNAME cpu -irlen 5
set _TARGETNAME_0 $_CHIPNAME.cpu0
set _TARGETNAME_1 $_CHIPNAME.cpu1
target create $_TARGETNAME_0 riscv -chain-position $_CHIPNAME.cpu -rtos hwthread
target create $_TARGETNAME_1 riscv -chain-position $_CHIPNAME.cpu -coreid 1
target smp $_TARGETNAME_0 $_TARGETNAME_1
# expose NEORV32-specific CSRs to debugger
riscv expose_csrs 2048=cfureg0
riscv expose_csrs 2049=cfureg1
riscv expose_csrs 2050=cfureg2
riscv expose_csrs 2051=cfureg3
riscv expose_csrs 4032=mxisa
# -------------------------------------------------------------------
# Server configuration
# -------------------------------------------------------------------
gdb report_data_abort enable
# -------------------------------------------------------------------
# Initialize target
# -------------------------------------------------------------------
init
# -------------------------------------------------------------------
# Authenticate; ADJUST THIS FOR YOUR AUTHENTICATOR
# -------------------------------------------------------------------
set challenge [riscv authdata_read]
riscv authdata_write [expr {$challenge | 1}]
# -------------------------------------------------------------------
# Check if device is authenticated (bit 7 in dmstatus)
# -------------------------------------------------------------------
set dmstatus [riscv dmi_read 0x11]
if { [expr {$dmstatus & (1<<7)}] } {
echo "Authentication passed."
} else {
echo "AUTHENTICATION FAILED!"
exit
}
# -------------------------------------------------------------------
# Target should be halted and ready now
# -------------------------------------------------------------------
halt
echo "Target HALTED. Ready for remote connections."
set PATH [ file dirname [ file normalize [ info script ] ] ]
source [file join $PATH target.cfg]
target_setup 2