target/adi_v5_swd: update cached value on write to DP_SELECT 79/4979/2
authorAntonio Borneo <borneo.antonio@gmail.com>
Thu, 28 Feb 2019 10:31:11 +0000 (11:31 +0100)
committerTomas Vanek <vanekt@fbl.cz>
Thu, 14 Mar 2019 13:50:49 +0000 (13:50 +0000)
When the register DP_SELECT is written directly, e.g. with command
<dap> dpreg 8 <value>
the cached value in OpenOCD is not completely updated with the new
value, thus creating issues in the following AP and DP read/write
that rely on the cached value.

Update the cached value while writing to DP_SELECT.

Change-Id: I8221b10cd6fc1fbe73e6b834b68820b43480e1a2
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/4979
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
src/target/adi_v5_swd.c

index eb181cb653a0862304c44829bef9a46d763e4b66..d099f4e710021153b179c8bc4dcb0bb9d510010f 100644 (file)
@@ -211,7 +211,10 @@ static int swd_queue_dp_write(struct adiv5_dap *dap, unsigned reg,
                return retval;
 
        swd_finish_read(dap);
-       swd_queue_dp_bankselect(dap, reg);
+       if (reg == DP_SELECT)
+               dap->select = data & (DP_SELECT_APSEL | DP_SELECT_APBANK | DP_SELECT_DPBANK);
+       else
+               swd_queue_dp_bankselect(dap, reg);
        swd->write_reg(swd_cmd(false,  false, reg), data, 0);
 
        return check_sync(dap);

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)