diff options
author | Tim Newsome <tim@sifive.com> | 2020-06-23 11:10:18 -0700 |
---|---|---|
committer | Tim Newsome <tim@sifive.com> | 2020-06-23 11:10:18 -0700 |
commit | bd5a1e80d1c05087e308a4775351a40704c517ce (patch) | |
tree | c387ef9ac0298e129cbb2110fe390f262451c86d | |
parent | 03f943ae239f59727ef47e46fffc31dd405a642d (diff) | |
download | riscv-openocd-dmstatus_version.zip riscv-openocd-dmstatus_version.tar.gz riscv-openocd-dmstatus_version.tar.bz2 |
Accept dmstatus.version==3 (0.14)dmstatus_version
Fixes #485.
Change-Id: I60b3d68827ca726558bc28035c0b74c5cf0d9754
-rw-r--r-- | src/target/riscv/riscv-013.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c index bbe77e9..9522e5e 100644 --- a/src/target/riscv/riscv-013.c +++ b/src/target/riscv/riscv-013.c @@ -686,8 +686,9 @@ int dmstatus_read_timeout(struct target *target, uint32_t *dmstatus, DMI_DMSTATUS, 0, timeout_sec, false, true); if (result != ERROR_OK) return result; - if (get_field(*dmstatus, DMI_DMSTATUS_VERSION) != 2) { - LOG_ERROR("OpenOCD only supports Debug Module version 2 (0.13), not " + int dmstatus_version = get_field(*dmstatus, DMI_DMSTATUS_VERSION); + if (dmstatus_version != 2 && dmstatus_version != 3) { + LOG_ERROR("OpenOCD only supports Debug Module version 2 (0.13) and 3 (0.14), not " "%d (dmstatus=0x%x). This error might be caused by a JTAG " "signal issue. Try reducing the JTAG clock speed.", get_field(*dmstatus, DMI_DMSTATUS_VERSION), *dmstatus); @@ -1613,7 +1614,8 @@ static int examine(struct target *target) if (dmstatus_read(target, &dmstatus, false) != ERROR_OK) return ERROR_FAIL; LOG_DEBUG("dmstatus: 0x%08x", dmstatus); - if (get_field(dmstatus, DMI_DMSTATUS_VERSION) != 2) { + int dmstatus_version = get_field(dmstatus, DMI_DMSTATUS_VERSION); + if (dmstatus_version != 2 && dmstatus_version != 3) { /* Error was already printed out in dmstatus_read(). */ return ERROR_FAIL; } |