adapter: add command "adapter [de]assert srst|trst [[de]assert srst|trst]"
Inspired from http://openocd.zylin.com/#/c/3720/1 Add commands to control the adapter's signals srst and trst. Add macros for the flag's values assert/deassert to make clear what they mean and to propose a uniform set of values across the code. Change-Id: Ia8b13f4ded892942916cad7bda49540a896e7218 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/5277 Tested-by: jenkins
This commit is contained in:
committed by
Tomas Vanek
parent
deff24afa1
commit
fafe6dfc9c
@@ -148,6 +148,21 @@ int hl_interface_init_reset(void)
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
/* FIXME: hla abuses of jtag_add_reset() to track srst status and for timings */
|
||||
int hl_interface_reset(int srst)
|
||||
{
|
||||
int result;
|
||||
|
||||
if (srst == 1) {
|
||||
jtag_add_reset(0, 1);
|
||||
result = hl_if.layout->api->assert_srst(hl_if.handle, 0);
|
||||
} else {
|
||||
result = hl_if.layout->api->assert_srst(hl_if.handle, 1);
|
||||
jtag_add_reset(0, 0);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static int hl_interface_khz(int khz, int *jtag_speed)
|
||||
{
|
||||
if (hl_if.layout->api->speed == NULL)
|
||||
|
||||
@@ -67,4 +67,13 @@ int hl_interface_init_target(struct target *t);
|
||||
int hl_interface_init_reset(void);
|
||||
int hl_interface_override_target(const char **targetname);
|
||||
|
||||
#if BUILD_HLADAPTER == 1
|
||||
int hl_interface_reset(int srst);
|
||||
#else
|
||||
static inline int hl_interface_reset(int srst)
|
||||
{
|
||||
return ERROR_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* OPENOCD_JTAG_HLA_HLA_INTERFACE_H */
|
||||
|
||||
Reference in New Issue
Block a user