topic: add reset functions for SWD
Add swd_init_reset and swd_add_reset. Add adapter_assert_reset and adapter_deassert_reset, and call them instead of JTAG reset functions. Change-Id: Ib2551c6fbb45513e0ae0dc331cfe3ee3f922298a Signed-off-by: Simon Qian <simonqian.openocd@gmail.com> Reviewed-on: http://openocd.zylin.com/526 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
This commit is contained in:
committed by
Spencer Oliver
parent
a2935397b4
commit
7743e0fb43
@@ -33,6 +33,7 @@
|
||||
#endif
|
||||
|
||||
#include "jtag.h"
|
||||
#include "swd.h"
|
||||
#include "minidriver.h"
|
||||
#include "interface.h"
|
||||
#include "interfaces.h"
|
||||
@@ -672,6 +673,7 @@ static int jim_jtag_arp_init(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
|
||||
|
||||
static int jim_jtag_arp_init_reset(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
|
||||
{
|
||||
int e = ERROR_OK;
|
||||
Jim_GetOptInfo goi;
|
||||
Jim_GetOpt_Setup(&goi, interp, argc-1, argv + 1);
|
||||
if (goi.argc != 0) {
|
||||
@@ -679,7 +681,11 @@ static int jim_jtag_arp_init_reset(Jim_Interp *interp, int argc, Jim_Obj *const
|
||||
return JIM_ERR;
|
||||
}
|
||||
struct command_context *context = current_command_context(interp);
|
||||
int e = jtag_init_reset(context);
|
||||
if (transport_is_jtag())
|
||||
e = jtag_init_reset(context);
|
||||
else if (transport_is_swd())
|
||||
e = swd_init_reset(context);
|
||||
|
||||
if (e != ERROR_OK) {
|
||||
Jim_Obj *eObj = Jim_NewIntObj(goi.interp, e);
|
||||
Jim_SetResultFormatted(goi.interp, "error: %#s", eObj);
|
||||
|
||||
Reference in New Issue
Block a user