diff options
author | Tim Newsome <tim@sifive.com> | 2018-01-04 12:53:09 -0800 |
---|---|---|
committer | Tim Newsome <tim@sifive.com> | 2018-01-04 12:53:09 -0800 |
commit | f401f2304fa3c876243efd8454dbbb4bb3a23a5f (patch) | |
tree | a4c4928824fe906b62cf7affc88b5604de21fc57 | |
parent | 2ffa3f3382d3fba2cd12c49477aef1c70dcb4c09 (diff) | |
download | riscv-openocd-dmi_read.zip riscv-openocd-dmi_read.tar.gz riscv-openocd-dmi_read.tar.bz2 |
Deal with busy status on dbus_read() request.dmi_read
Change-Id: I3699bde01887dfba37d7f420737988248c7fca5b
-rw-r--r-- | src/target/riscv/riscv-011.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/target/riscv/riscv-011.c b/src/target/riscv/riscv-011.c index f7f2e8c..a5ebe42 100644 --- a/src/target/riscv/riscv-011.c +++ b/src/target/riscv/riscv-011.c @@ -459,7 +459,11 @@ static uint64_t dbus_read(struct target *target, uint16_t address) * If there happens to be a busy state pending, we will clear it after we * discover it as part of the NOP scan. */ for (unsigned i = 0; i < 256; i++) { - dbus_scan(target, NULL, NULL, DBUS_OP_READ, address, 0); + status = dbus_scan(target, NULL, NULL, DBUS_OP_READ, address, 0); + if (status == DBUS_STATUS_BUSY) { + increase_dbus_busy_delay(target); + continue; + } status = dbus_scan(target, &address_in, &value, DBUS_OP_NOP, address, 0); if (status == DBUS_STATUS_BUSY) increase_dbus_busy_delay(target); |