+// SPDX-License-Identifier: GPL-2.0-or-later
+
/***************************************************************************
* Copyright (C) 2005 by Dominic Rath *
* Dominic.Rath@gmx.de *
* *
* Copyright (C) 2009 Zachary T Welch *
* zw@superlucidity.net *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+#include "adapter.h"
#include "jtag.h"
#include "swd.h"
#include "minidriver.h"
{
const char *cp = Jim_GetString(o, NULL);
struct jtag_tap *t = cp ? jtag_tap_by_string(cp) : NULL;
- if (NULL == cp)
+ if (!cp)
cp = "(unknown)";
- if (NULL == t)
+ if (!t)
Jim_SetResultFormatted(interp, "Tap '%s' could not be found", cp);
return t;
}
/* get arg as a string. */
cp = Jim_GetString(args[i], NULL);
/* is it the magic? */
- if (0 == strcmp("-endstate", cp)) {
+ if (strcmp("-endstate", cp) == 0) {
/* is the statename valid? */
cp = Jim_GetString(args[i + 1], NULL);
assert(e == JIM_OK);
tap = jtag_tap_by_jim_obj(interp, args[1]);
- if (tap == NULL)
+ if (!tap)
return JIM_ERR;
num_fields = (argc-2)/2;
if (goi->isconfigure) {
if (!found)
jteap = calloc(1, sizeof(*jteap));
- else if (NULL != jteap->body)
+ else if (jteap->body)
Jim_DecrRefCount(goi->interp, jteap->body);
jteap->interp = goi->interp;
#define NTAP_OPT_DISABLED 4
#define NTAP_OPT_EXPECTED_ID 5
#define NTAP_OPT_VERSION 6
+#define NTAP_OPT_BYPASS 7
static int jim_newtap_ir_param(struct jim_nvp *n, struct jim_getopt_info *goi,
struct jtag_tap *tap)
{ .name = "-disable", .value = NTAP_OPT_DISABLED },
{ .name = "-expected-id", .value = NTAP_OPT_EXPECTED_ID },
{ .name = "-ignore-version", .value = NTAP_OPT_VERSION },
+ { .name = "-ignore-bypass", .value = NTAP_OPT_BYPASS },
{ .name = NULL, .value = -1 },
};
case NTAP_OPT_VERSION:
tap->ignore_version = true;
break;
+ case NTAP_OPT_BYPASS:
+ tap->ignore_bypass = true;
+ break;
} /* switch (n->value) */
} /* while (goi->argc) */
struct jtag_tap_event_action *jteap;
int retval;
- for (jteap = tap->event_action; jteap != NULL; jteap = jteap->next) {
+ for (jteap = tap->event_action; jteap; jteap = jteap->next) {
if (jteap->event != e)
continue;
struct jtag_tap *t;
t = jtag_tap_by_jim_obj(goi.interp, goi.argv[0]);
- if (t == NULL)
+ if (!t)
return JIM_ERR;
if (strcasecmp(cmd_name, "tapisenabled") == 0) {
Jim_Obj *o;
jim_getopt_obj(&goi, &o);
t = jtag_tap_by_jim_obj(goi.interp, o);
- if (t == NULL)
+ if (!t)
return JIM_ERR;
return jtag_tap_configure_cmd(&goi, t);
"['-enable'|'-disable'] "
"['-expected_id' number] "
"['-ignore-version'] "
+ "['-ignore-bypass'] "
"['-ircapture' number] "
"['-mask' number]",
},
unsigned khz = 0;
COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], khz);
- retval = jtag_config_rclk(khz);
+ retval = adapter_config_rclk(khz);
if (retval != ERROR_OK)
return retval;
}
- int cur_khz = jtag_get_speed_khz();
- retval = jtag_get_speed_readable(&cur_khz);
+ int cur_khz = adapter_get_speed_khz();
+ retval = adapter_get_speed_readable(&cur_khz);
if (retval != ERROR_OK)
return retval;
int retval;
for (i = 0; i < num_fields; i++) {
tap = jtag_tap_by_string(CMD_ARGV[i*2]);
- if (tap == NULL) {
+ if (!tap) {
free(fields);
command_print(CMD, "Tap: %s unknown", CMD_ARGV[i*2]);