Hi!

IMHO, the best place to start is batch interface (target/riscv/batch.h). 
Currently all DMI operations go through here.
This will not be enough though, there is also `dtmcs_scan()`. It's use is 
pretty specific to JTAG DTM.
There is one use in `riscv.c` during examination to determine the version of 
the JTAG DTM and based on this figure out whether it's a RISC-V Debug Spec 0.11 
or RISC-V Debug Spec 0.13+ target.
It is also used twice in `riscv-013.c`. The first use is during examination to 
determine `abits` so that we can address the Debug Module on the DMI bus. The 
second one resets the DMI busy sticky error state.
It seems to me you can just drop these calls to `dtmcs_scan()` for the 
prototype implementation.

Please, consider sharing your efforts -- I would like to abstract the notion of 
RISC-V DTM into a separate object some time later. Looking at an alternative 
implementation will be of great help to figure out the interface to implement.

Best regards,
Evgeniy Naydanov
________________________________
From: Brandon Altieri <[email protected]>
Sent: Tuesday, November 25, 2025 7:56:40 PM
To: [email protected]
Cc: Nicholas Chin
Subject: Support for RISCV Target Without DTM

Hello,

I have a custom RISCV target that I need to enable OpenOCD (and more 
specifically, gdb) support for. The target does not implement/use the standard 
RISCV Debug Transport Module.

Wondering if I can get some guidance on where to start here - I'm not so sure 
if I'm able to simply override a couple functions (e.g. dmi_write/dmi_read, 
dtmcs_scan, etc.) to enable this? The target's JTAG interface does expose a 
mechanism for creating memory accesses where the DM is reachable.

Thanks in Advance,

Brandon Altieri


Reply via email to