interface: define TMS sequence command
For support of SWD we need to be able to clock out special bit sequences over TMS or SWDIO. Create this as a generic operation, not yet called by anything, which is split as usual into: - upper level abstraction ... here, jtag_add_tms_seq(); - midlayer implementation logic hooking that to the lowlevel code; - lowlevel minidriver operation ... here, interface_add_tms_seq(); - message type for request queue, here JTAG_TMS. This is done slightly differently than other operations: there's a flag saying whether the interface driver supports this request. (In fact a flag *word* so upper layers can learn about other capabilities too ... for example, supporting SWD operations.) That approach (flag) lets this method *eventually* be used to eliminate pathmove() and statemove() support from most adapter drivers, by moving all that logic into the mid-layer and increasing uniformity between the various drivers. (Which will in turn reduce subtle bugginess.) Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
This commit is contained in:
@@ -184,10 +184,28 @@ static inline tap_state_t jtag_debug_state_machine(const void *tms_buf,
|
||||
}
|
||||
#endif // _DEBUG_JTAG_IO_
|
||||
|
||||
/**
|
||||
* Represents a driver for a debugging interface.
|
||||
*
|
||||
* @todo Rename; perhaps "debug_driver". This isn't an interface,
|
||||
* it's a driver! Also, not all drivers support JTAG.
|
||||
*
|
||||
* @todo We need a per-instance structure too, and changes to pass
|
||||
* that structure to the driver. Instances can for example be in
|
||||
* either SWD or JTAG modes. This will help remove globals, and
|
||||
* eventually to cope with systems which have more than one such
|
||||
* debugging interface.
|
||||
*/
|
||||
struct jtag_interface {
|
||||
/// The name of the JTAG interface driver.
|
||||
char* name;
|
||||
|
||||
/**
|
||||
* Bit vector listing capabilities exposed by this driver.
|
||||
*/
|
||||
unsigned supported;
|
||||
#define DEBUG_CAP_TMS_SEQ (1 << 0)
|
||||
|
||||
/**
|
||||
* Execute queued commands.
|
||||
* @returns ERROR_OK on success, or an error code on failure.
|
||||
|
||||
Reference in New Issue
Block a user