aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Blot <emmanuel.blot@free.fr>2024-04-04 16:30:43 +0200
committerEmmanuel Blot <emmanuel.blot@free.fr>2024-04-04 19:41:48 +0200
commitfbd9b3d5f4d135f1debc8e8c42ea23a854cd0ee4 (patch)
tree5cf62e32d7af1663fcb43a60252172b98186ea30
parent722cef1ae0ec55ee7aa47e60acafaa787be16b32 (diff)
downloadriscv-openocd-fbd9b3d5f4d135f1debc8e8c42ea23a854cd0ee4.zip
riscv-openocd-fbd9b3d5f4d135f1debc8e8c42ea23a854cd0ee4.tar.gz
riscv-openocd-fbd9b3d5f4d135f1debc8e8c42ea23a854cd0ee4.tar.bz2
target/riscv: Add missing DM base offset to read_memory_bus_v1()
dmi_scan expects the full DMI address. Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
-rw-r--r--src/target/riscv/riscv-013.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c
index 0134548..b02d0a3 100644
--- a/src/target/riscv/riscv-013.c
+++ b/src/target/riscv/riscv-013.c
@@ -3224,6 +3224,10 @@ static int read_memory_bus_v1(struct target *target, target_addr_t address,
return ERROR_NOT_IMPLEMENTED;
}
+ dm013_info_t *dm = get_dm(target);
+ if (!dm)
+ return ERROR_FAIL;
+
RISCV013_INFO(info);
target_addr_t next_address = address;
target_addr_t end_address = address + (increment ? count : 1) * size;
@@ -3272,7 +3276,7 @@ static int read_memory_bus_v1(struct target *target, target_addr_t address,
}
keep_alive();
dmi_status_t status = dmi_scan(target, NULL, &sbvalue[next_read_j],
- DMI_OP_READ, sbdata[j], 0, false);
+ DMI_OP_READ, sbdata[j] + dm->base, 0, false);
/* By reading from sbdata0, we have just initiated another system bus read.
* If necessary add a delay so the read can finish. */
if (j == 0 && info->bus_master_read_delay) {