Squashed commit of the following:
commitfb7009fc38
Author: Gleb Gagarin <gleb@sifive.com> Date: Fri Feb 23 16:41:14 2018 -0800 Make some error messages to be printed once commite09dd62229
Author: Gleb Gagarin <gleb@sifive.com> Date: Fri Feb 23 15:30:10 2018 -0800 Reduce severity of the error messages that are polluting the log commit73b6ea55eb
Author: Gleb Gagarin <gleb@sifive.com> Date: Fri Feb 23 13:32:54 2018 -0800 removed unused variable commitc3bdcb0c4a
Author: Gleb Gagarin <gleb@sifive.com> Date: Thu Feb 22 18:32:08 2018 -0800 more R/O checks commit353cf212bd
Author: Gleb Gagarin <gleb@sifive.com> Date: Thu Feb 22 14:27:25 2018 -0800 write progbuf via DMI commite73d82e3d6
Author: Gleb Gagarin <gleb@sifive.com> Date: Wed Feb 21 18:47:36 2018 -0800 add writes to progbuf commitf97e4b53e4
Author: Gleb Gagarin <gleb@sifive.com> Date: Wed Feb 21 16:20:12 2018 -0800 Try to zero out ROM
This commit is contained in:
parent
1b37f60969
commit
7eca2dfe5d
|
@ -383,7 +383,11 @@ static dmi_status_t dmi_scan(struct target *target, uint16_t *address_in,
|
|||
|
||||
int retval = jtag_execute_queue();
|
||||
if (retval != ERROR_OK) {
|
||||
LOG_ERROR("dmi_scan failed jtag scan");
|
||||
static int once = 1;
|
||||
if (once) {
|
||||
LOG_ERROR("dmi_scan failed jtag scan");
|
||||
once = 0;
|
||||
}
|
||||
return DMI_STATUS_FAILED;
|
||||
}
|
||||
|
||||
|
@ -418,13 +422,22 @@ static uint32_t dmi_read(struct target *target, uint16_t address)
|
|||
} else if (status == DMI_STATUS_SUCCESS) {
|
||||
break;
|
||||
} else {
|
||||
LOG_ERROR("failed read from 0x%x, status=%d", address, status);
|
||||
static int once = 1;
|
||||
if (once) {
|
||||
LOG_ERROR("failed read from 0x%x, status=%d", address, status);
|
||||
once = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
usleep(100000);
|
||||
}
|
||||
|
||||
if (status != DMI_STATUS_SUCCESS) {
|
||||
LOG_ERROR("Failed read from 0x%x; status=%d", address, status);
|
||||
static int once = 1;
|
||||
if (once) {
|
||||
LOG_INFO("Failed read from 0x%x; status=%d", address, status);
|
||||
once = 0;
|
||||
}
|
||||
return ~0;
|
||||
}
|
||||
|
||||
|
@ -2268,6 +2281,9 @@ int riscv013_test_compliance(struct target *target) {
|
|||
dmstatus = dmi_read(target, DMI_DMSTATUS);
|
||||
} while ((dmstatus & DMI_DMSTATUS_ALLHALTED) == 0);
|
||||
|
||||
dmi_write(target, DMI_DMSTATUS, 0xffffffff);
|
||||
COMPLIANCE_TEST(dmi_read(target, DMI_DMSTATUS) == dmstatus, "DMSTATUS is R/O");
|
||||
|
||||
// resumereq. This will resume the hart but this test is destructive anyway.
|
||||
dmcontrol &= ~DMI_DMCONTROL_HALTREQ;
|
||||
dmcontrol = set_field(dmcontrol, DMI_DMCONTROL_RESUMEREQ, 1);
|
||||
|
@ -2340,6 +2356,12 @@ int riscv013_test_compliance(struct target *target) {
|
|||
}
|
||||
COMPLIANCE_TEST(dmi_read(target, DMI_HALTSUM) == expected_haltsum, "HALTSUM should report all halted harts");
|
||||
|
||||
dmi_write(target, DMI_HALTSUM, 0xffffffff);
|
||||
COMPLIANCE_TEST(dmi_read(target, DMI_HALTSUM) == expected_haltsum, "HALTSUM is R/O");
|
||||
|
||||
dmi_write(target, DMI_HALTSUM, 0x0);
|
||||
COMPLIANCE_TEST(dmi_read(target, DMI_HALTSUM) == expected_haltsum, "HALTSUM is R/O");
|
||||
|
||||
for (int i = 0; i < riscv_count_harts(target); i +=32){
|
||||
uint32_t haltstat = dmi_read(target, 0x40 + (i / 32));
|
||||
uint32_t haltstat_expected = (((i + 1) * 32) <= riscv_count_harts(target)) ? 0xFFFFFFFFU : ((1U << (riscv_count_harts(target) % 32)) - 1);
|
||||
|
|
Loading…
Reference in New Issue