Skip to content

Commit 0ef33f2

Browse files
author
Jan Matyas
committed
Merge branch 'keepalive' into add-ci-2
Change-Id: I4046c1353f44371b0f4214861d360be065bef42e
2 parents 966e769 + 090a6b7 commit 0ef33f2

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/target/riscv/batch.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ int riscv_batch_run(struct riscv_batch *batch)
8282
return ERROR_OK;
8383
}
8484

85-
keep_alive();
86-
8785
riscv_batch_add_nop(batch);
8886

8987
for (size_t i = 0; i < batch->used_scans; ++i) {
@@ -96,11 +94,15 @@ int riscv_batch_run(struct riscv_batch *batch)
9694
jtag_add_runtest(batch->idle_count, TAP_IDLE);
9795
}
9896

97+
keep_alive();
98+
9999
if (jtag_execute_queue() != ERROR_OK) {
100100
LOG_ERROR("Unable to execute JTAG queue");
101101
return ERROR_FAIL;
102102
}
103103

104+
keep_alive();
105+
104106
if (bscan_tunnel_ir_width != 0) {
105107
/* need to right-shift "in" by one bit, because of clock skew between BSCAN TAP and DM TAP */
106108
for (size_t i = 0; i < batch->used_scans; ++i)

src/target/riscv/riscv-013.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,8 @@ static int dmi_op_timeout(struct target *target, uint32_t *data_in,
591591
return ERROR_FAIL;
592592
}
593593

594+
keep_alive();
595+
594596
time_t start = time(NULL);
595597
/* This first loop performs the request. Note that if for some reason this
596598
* stays busy, it is actually due to the previous access. */
@@ -1307,8 +1309,6 @@ static int register_write_direct(struct target *target, unsigned number,
13071309
LOG_DEBUG("{%d} %s <- 0x%" PRIx64, riscv_current_hartid(target),
13081310
gdb_regno_name(number), value);
13091311

1310-
keep_alive();
1311-
13121312
int result = register_write_abstract(target, number, value,
13131313
register_size(target, number));
13141314
if (result == ERROR_OK || !has_sufficient_progbuf(target, 2) ||
@@ -2730,6 +2730,7 @@ static int read_memory_bus_v1(struct target *target, target_addr_t address,
27302730
next_read);
27312731
return ERROR_FAIL;
27322732
}
2733+
keep_alive();
27332734
dmi_status_t status = dmi_scan(target, NULL, &value,
27342735
DMI_OP_READ, sbdata[j], 0, false);
27352736
if (status == DMI_STATUS_BUSY)
@@ -2745,7 +2746,6 @@ static int read_memory_bus_v1(struct target *target, target_addr_t address,
27452746
}
27462747
next_read = address + i * size + j * 4;
27472748
}
2748-
keep_alive();
27492749
}
27502750

27512751
uint32_t sbcs_read = 0;
@@ -3507,7 +3507,6 @@ static int read_memory_progbuf(struct target *target, target_addr_t address,
35073507
uint8_t *buffer_i = buffer;
35083508

35093509
for (uint32_t i = 0; i < count; i++, address_i += increment, buffer_i += size) {
3510-
keep_alive();
35113510
/* TODO: This is much slower than it needs to be because we end up
35123511
* writing the address to read for every word we read. */
35133512
result = read_memory_progbuf_inner(target, address_i, size, count_i, buffer_i, increment);

0 commit comments

Comments
 (0)