Add '-coreid' target option to support multiple cores per TAP.
authorAaron Carroll <aaronc@cse.unsw.edu.au>
Mon, 24 Jan 2011 07:06:44 +0000 (18:06 +1100)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Mon, 31 Jan 2011 07:53:21 +0000 (08:53 +0100)
ARM Cortex-A9 multi-core chips expose a single TAP/DAP which connects
to both cores.  The '-coreid' option selects which core the target
should connect to.

Note that at present, OpenOCD can connect to either core, but not both
simulatenously, until ADI contexts can be shared.

Signed-off-by: Aaron Carroll <aaronc@cse.unsw.edu.au>
src/target/target.c
src/target/target.h

index 820e7471ae3644efe7fc5f3446b99e017eb9eade..31ade6acff60d9908b22734f3ed9092e325a1a17 100644 (file)
@@ -3660,6 +3660,7 @@ enum target_cfg_param {
        TCFG_WORK_AREA_BACKUP,
        TCFG_ENDIAN,
        TCFG_VARIANT,
+       TCFG_COREID,
        TCFG_CHAIN_POSITION,
 };
 
@@ -3672,6 +3673,7 @@ static Jim_Nvp nvp_config_opts[] = {
        { .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 = NULL, .value = -1 }
@@ -3924,6 +3926,23 @@ static int target_configure(Jim_GetOptInfo *goi, struct target *target)
                        Jim_SetResultString(goi->interp, target->variant,-1);
                        /* loop for more */
                        break;
+
+               case TCFG_COREID:
+                       if (goi->isconfigure) {
+                               e = Jim_GetOpt_Wide(goi, &w);
+                               if (e != JIM_OK) {
+                                       return e;
+                               }
+                               target->coreid = (int)w;
+                       } else {
+                               if (goi->argc != 0) {
+                                       goto no_params;
+                               }
+                       }
+                       Jim_SetResult(goi->interp, Jim_NewIntObj(goi->interp, target->working_area_size));
+                       /* loop for more */
+                       break;
+
                case TCFG_CHAIN_POSITION:
                        if (goi->isconfigure) {
                                Jim_Obj *o_t;
@@ -4634,6 +4653,9 @@ static int target_create(Jim_GetOptInfo *goi)
        /* will be set by "-endian" */
        target->endianness = TARGET_ENDIAN_UNKNOWN;
 
+       /* default to first core, override with -coreid */
+       target->coreid = 0;
+
        target->working_area        = 0x0;
        target->working_area_size   = 0x0;
        target->working_areas       = NULL;
index 4d03018e7015409896319d9ac7465f36b3b49a59..2c6f4cd50d680e37a2a9651b18f05946441b172b 100644 (file)
@@ -107,6 +107,7 @@ struct target
        const char *cmd_name;                           /* tcl Name of target */
        int target_number;                                      /* DO NOT USE!  field to be removed in 2010 */
        struct jtag_tap *tap;                                   /* where on the jtag chain is this */
+       int coreid;                                                     /* which device on the TAP? */
        const char *variant;                            /* what variant of this chip is it? */
 
        /**

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)