diff options
author | Tim Newsome <tim@sifive.com> | 2020-06-30 11:04:48 -0700 |
---|---|---|
committer | Tim Newsome <tim@sifive.com> | 2020-06-30 11:04:48 -0700 |
commit | 43463b30ed472f97ede801c5267512b35236efd5 (patch) | |
tree | 408056b87d73a6dd500c3dd6ce06afaa5ad7ae96 /src | |
parent | 426d4fa27b4dec8317dee3d50cce6c61b91a2500 (diff) | |
parent | f0151889f0f5a51e2555980d74e7a86d0b9aa849 (diff) | |
download | riscv-openocd-43463b30ed472f97ede801c5267512b35236efd5.zip riscv-openocd-43463b30ed472f97ede801c5267512b35236efd5.tar.gz riscv-openocd-43463b30ed472f97ede801c5267512b35236efd5.tar.bz2 |
Merge branch 'riscv' into from_upstream
Change-Id: Ia9c5d7c7f0a4913c1af17e042266736943334c7f
Diffstat (limited to 'src')
-rw-r--r-- | src/target/riscv/riscv-013.c | 8 | ||||
-rw-r--r-- | src/target/riscv/riscv.c | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c index 2c60a36..2ea8fdf 100644 --- a/src/target/riscv/riscv-013.c +++ b/src/target/riscv/riscv-013.c @@ -687,8 +687,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); @@ -1612,7 +1613,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; } diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index 97c21b5..c5ad3df 100644 --- a/src/target/riscv/riscv.c +++ b/src/target/riscv/riscv.c @@ -2077,7 +2077,7 @@ int riscv_openocd_poll(struct target *target) } else if (target->smp) { unsigned halts_discovered = 0; unsigned total_targets = 0; - bool newly_halted[128] = {0}; + bool newly_halted[RISCV_MAX_HARTS] = {0}; unsigned should_remain_halted = 0; unsigned should_resume = 0; unsigned i = 0; @@ -2090,8 +2090,6 @@ int riscv_openocd_poll(struct target *target) enum riscv_poll_hart out = riscv_poll_hart(t, r->current_hartid); switch (out) { case RPH_NO_CHANGE: - if (t->state == TARGET_HALTED) - should_remain_halted++; break; case RPH_DISCOVERED_RUNNING: t->state = TARGET_RUNNING; |