adi_v5_dapdirect: add support for adapter drivers that provide DAP API
Some high level adapters, like STLINK-V3 and new firmware for ST-Link/V2, provide API to directly access the DAP registers hiding the details of the physical transport JTAG or SWD. OpenOCD has already the intermediate API in struct dap_ops that are suitable for such adapters, but are not exposed to the adapter drivers. Add in struct adapter_driver two independent struct dap_ops for the cases of physical JTAG and SWD transport. Add new transport names "dapdirect_jtag" and "dapdirect_swd", to be used by the drivers that provide one or both DAP API. Add the necessarily glue in target/adi_v5_dapdirect.c Change-Id: I2bb8e3a80fba750f2c218d877cfa5888428e3c28 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/4903 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
committed by
Tomas Vanek
parent
c6b6fdeb2c
commit
a61ec3c1d7
@@ -2052,7 +2052,8 @@ int adapter_assert_reset(void)
|
||||
else
|
||||
jtag_add_reset(0, 1);
|
||||
return ERROR_OK;
|
||||
} else if (transport_is_swd() || transport_is_hla())
|
||||
} else if (transport_is_swd() || transport_is_hla() ||
|
||||
transport_is_dapdirect_jtag() || transport_is_dapdirect_swd())
|
||||
return adapter_system_reset(1);
|
||||
else if (get_current_transport() != NULL)
|
||||
LOG_ERROR("reset is not supported on %s",
|
||||
@@ -2067,7 +2068,8 @@ int adapter_deassert_reset(void)
|
||||
if (transport_is_jtag()) {
|
||||
jtag_add_reset(0, 0);
|
||||
return ERROR_OK;
|
||||
} else if (transport_is_swd() || transport_is_hla())
|
||||
} else if (transport_is_swd() || transport_is_hla() ||
|
||||
transport_is_dapdirect_jtag() || transport_is_dapdirect_swd())
|
||||
return adapter_system_reset(0);
|
||||
else if (get_current_transport() != NULL)
|
||||
LOG_ERROR("reset is not supported on %s",
|
||||
|
||||
@@ -351,6 +351,12 @@ struct adapter_driver {
|
||||
|
||||
/** Low-level SWD APIs */
|
||||
const struct swd_driver *swd_ops;
|
||||
|
||||
/* DAP APIs over JTAG transport */
|
||||
const struct dap_ops *dap_jtag_ops;
|
||||
|
||||
/* DAP APIs over SWD transport */
|
||||
const struct dap_ops *dap_swd_ops;
|
||||
};
|
||||
|
||||
extern const char * const jtag_only[];
|
||||
|
||||
Reference in New Issue
Block a user