diff options
author | Antonio Borneo <borneo.antonio@gmail.com> | 2019-02-28 11:31:11 +0100 |
---|---|---|
committer | Tomas Vanek <vanekt@fbl.cz> | 2019-03-14 13:50:49 +0000 |
commit | 420a692e0fae34a59eb3c33932362812e33f5583 (patch) | |
tree | 35d4656729dcef72d8f096e105e7a1437d823cdb /src | |
parent | 380502d82074b799f10d9671c4fe0fe24eb93023 (diff) | |
download | riscv-openocd-420a692e0fae34a59eb3c33932362812e33f5583.zip riscv-openocd-420a692e0fae34a59eb3c33932362812e33f5583.tar.gz riscv-openocd-420a692e0fae34a59eb3c33932362812e33f5583.tar.bz2 |
target/adi_v5_swd: update cached value on write to DP_SELECT
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/target/adi_v5_swd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/target/adi_v5_swd.c b/src/target/adi_v5_swd.c index eb181cb..d099f4e 100644 --- a/src/target/adi_v5_swd.c +++ b/src/target/adi_v5_swd.c @@ -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); |