* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
***************************************************************************/
#ifdef HAVE_CONFIG_H
#endif
#include "jtag.h"
+#include "swd.h"
#include "minidriver.h"
#include "interface.h"
#include "interfaces.h"
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) {
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);
for (ii = 1; ii < tap->expected_ids_cnt; ii++) {
snprintf(expected_id, sizeof expected_id, "0x%08x",
- (unsigned) tap->expected_ids[1]);
+ (unsigned) tap->expected_ids[ii]);
if (tap->ignore_version)
expected_id[2] = '*';
fields[i].num_bits = field_size;
fields[i].out_value = malloc(DIV_ROUND_UP(field_size, 8));
- uint32_t value;
- retval = parse_u32(CMD_ARGV[i * 2 + 1], &value);
+ uint64_t value;
+ retval = parse_u64(CMD_ARGV[i * 2 + 1], &value);
if (ERROR_OK != retval)
goto error_return;
void *v = (void *)fields[i].out_value;
- buf_set_u32(v, 0, field_size, value);
+ buf_set_u64(v, 0, field_size, value);
fields[i].in_value = NULL;
}