aboutsummaryrefslogtreecommitdiff
path: root/src/target
diff options
context:
space:
mode:
authorAndreas Fritiofson <andreas.fritiofson@gmail.com>2014-09-08 22:11:02 +0200
committerSpencer Oliver <spen@spen-soft.co.uk>2014-09-22 19:39:24 +0000
commit1c021ed0afb5f9f7d9e8cbce53a4fe985a4c2235 (patch)
tree114d2eccadbc351e0df68199e21678f080c7368c /src/target
parentb2973be9cc3538026c837d1122ab344cebb40aa0 (diff)
downloadriscv-openocd-1c021ed0afb5f9f7d9e8cbce53a4fe985a4c2235.zip
riscv-openocd-1c021ed0afb5f9f7d9e8cbce53a4fe985a4c2235.tar.gz
riscv-openocd-1c021ed0afb5f9f7d9e8cbce53a4fe985a4c2235.tar.bz2
target: Remove "-variant" argument
Remove this underutilized feature. Despite the fact that a lot of configs specifies a arbitrary "variant", only the xscale target actually defines any. In the case of xscale, the use of -variant is dubious since 1) it's used as a redundant irlen specifier, 2) it carries a comment that it doesn't really need it and 3) only two xscale configs even specify it. If there's a future target that needs a variant set, a target specific option could be added when needed. Change-Id: I1ba25a946f0d80872cbd96ddcc48f92695c4ae20 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/2283 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'src/target')
-rw-r--r--src/target/target.c28
-rw-r--r--src/target/target.h1
-rw-r--r--src/target/xscale.c33
3 files changed, 3 insertions, 59 deletions
diff --git a/src/target/target.c b/src/target/target.c
index 8d84b84..d7a2c48 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -4115,7 +4115,6 @@ enum target_cfg_param {
TCFG_WORK_AREA_SIZE,
TCFG_WORK_AREA_BACKUP,
TCFG_ENDIAN,
- TCFG_VARIANT,
TCFG_COREID,
TCFG_CHAIN_POSITION,
TCFG_DBGBASE,
@@ -4130,7 +4129,6 @@ static Jim_Nvp nvp_config_opts[] = {
{ .name = "-work-area-size", .value = TCFG_WORK_AREA_SIZE },
{ .name = "-work-area-backup", .value = TCFG_WORK_AREA_BACKUP },
{ .name = "-endian" , .value = TCFG_ENDIAN },
- { .name = "-variant", .value = TCFG_VARIANT },
{ .name = "-coreid", .value = TCFG_COREID },
{ .name = "-chain-position", .value = TCFG_CHAIN_POSITION },
{ .name = "-dbgbase", .value = TCFG_DBGBASE },
@@ -4143,7 +4141,6 @@ static int target_configure(Jim_GetOptInfo *goi, struct target *target)
Jim_Nvp *n;
Jim_Obj *o;
jim_wide w;
- char *cp;
int e;
/* parse config or cget options ... */
@@ -4352,27 +4349,6 @@ no_params:
/* loop for more */
break;
- case TCFG_VARIANT:
- if (goi->isconfigure) {
- if (goi->argc < 1) {
- Jim_SetResultFormatted(goi->interp,
- "%s ?STRING?",
- n->name);
- return JIM_ERR;
- }
- e = Jim_GetOpt_String(goi, &cp, NULL);
- if (e != JIM_OK)
- return e;
- free(target->variant);
- target->variant = strdup(cp);
- } else {
- if (goi->argc != 0)
- goto no_params;
- }
- Jim_SetResultString(goi->interp, target->variant, -1);
- /* loop for more */
- break;
-
case TCFG_COREID:
if (goi->isconfigure) {
e = Jim_GetOpt_Wide(goi, &w);
@@ -5185,10 +5161,6 @@ static int target_create(Jim_GetOptInfo *goi)
target->endianness = TARGET_LITTLE_ENDIAN;
}
- /* incase variant is not set */
- if (!target->variant)
- target->variant = strdup("");
-
cp = Jim_GetString(new_cmd, NULL);
target->cmd_name = strdup(cp);
diff --git a/src/target/target.h b/src/target/target.h
index 8e1c8f9..0552b8f 100644
--- a/src/target/target.h
+++ b/src/target/target.h
@@ -129,7 +129,6 @@ struct target {
int target_number; /* DO NOT USE! field to be removed in 2010 */
struct jtag_tap *tap; /* where on the jtag chain is this */
int32_t coreid; /* which device on the TAP? */
- char *variant; /* what variant of this chip is it? */
/**
* Indicates whether this target has been examined.
diff --git a/src/target/xscale.c b/src/target/xscale.c
index 04189a1..b64a1bf 100644
--- a/src/target/xscale.c
+++ b/src/target/xscale.c
@@ -2905,7 +2905,7 @@ static int xscale_init_target(struct command_context *cmd_ctx,
}
static int xscale_init_arch_info(struct target *target,
- struct xscale_common *xscale, struct jtag_tap *tap, const char *variant)
+ struct xscale_common *xscale, struct jtag_tap *tap)
{
struct arm *arm;
uint32_t high_reset_branch, low_reset_branch;
@@ -2916,33 +2916,7 @@ static int xscale_init_arch_info(struct target *target,
/* store architecture specfic data */
xscale->common_magic = XSCALE_COMMON_MAGIC;
- /* we don't really *need* a variant param ... */
- if (variant) {
- int ir_length = 0;
-
- if (strcmp(variant, "pxa250") == 0
- || strcmp(variant, "pxa255") == 0
- || strcmp(variant, "pxa26x") == 0)
- ir_length = 5;
- else if (strcmp(variant, "pxa27x") == 0
- || strcmp(variant, "ixp42x") == 0
- || strcmp(variant, "ixp45x") == 0
- || strcmp(variant, "ixp46x") == 0)
- ir_length = 7;
- else if (strcmp(variant, "pxa3xx") == 0)
- ir_length = 11;
- else
- LOG_WARNING("%s: unrecognized variant %s",
- tap->dotted_name, variant);
-
- if (ir_length && ir_length != tap->ir_length) {
- LOG_WARNING("%s: IR length for %s is %d; fixing",
- tap->dotted_name, variant, ir_length);
- tap->ir_length = ir_length;
- }
- }
-
- /* PXA3xx shifts the JTAG instructions */
+ /* PXA3xx with 11 bit IR shifts the JTAG instructions */
if (tap->ir_length == 11)
xscale->xscale_variant = XSCALE_PXA3XX;
else
@@ -3033,8 +3007,7 @@ static int xscale_target_create(struct target *target, Jim_Interp *interp)
if (!xscale)
return ERROR_FAIL;
- return xscale_init_arch_info(target, xscale, target->tap,
- target->variant);
+ return xscale_init_arch_info(target, xscale, target->tap);
}
COMMAND_HANDLER(xscale_handle_debug_handler_command)