diff options
author | Kristofer Jonsson <kristofer.jonsson@arm.com> | 2020-10-16 12:33:47 +0200 |
---|---|---|
committer | Kristofer Jonsson <kristofer.jonsson@arm.com> | 2020-10-20 14:33:06 +0200 |
commit | 4dc73dcea25d951971ae306481d1f201c8d6ebdd (patch) | |
tree | 6c9d460f047e9123dda07480a6abb5efbcecb050 /src/ethosu_driver.c | |
parent | 5f8dad185b3e3a381fe2e3d16580a8a8e99f9db0 (diff) | |
download | ethos-u-core-driver-4dc73dcea25d951971ae306481d1f201c8d6ebdd.tar.gz |
PMU counter shadow
Storing PMU counters in shadow variables, in case the PMU was powered
off or soft reset.
Change-Id: I64ccf3fb6195f9be2d8315891ec612bb75404885
Diffstat (limited to 'src/ethosu_driver.c')
-rw-r--r-- | src/ethosu_driver.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/ethosu_driver.c b/src/ethosu_driver.c index 6c55b0b..77b8727 100644 --- a/src/ethosu_driver.c +++ b/src/ethosu_driver.c @@ -149,7 +149,7 @@ struct opt_cfg_s ******************************************************************************/ struct ethosu_driver ethosu_drv = { - .dev = {.base_address = NULL, .reset = 0, .pmccntr = 0, .pmu_evcntr = {0, 0, 0, 0}, .pmu_evtypr = {0, 0, 0, 0}}, + .dev = {.base_address = NULL, .reset = 0, .pmccntr = {0}, .pmu_evcntr = {0, 0, 0, 0}, .pmu_evtypr = {0, 0, 0, 0}}, .abort_inference = false, .status_error = false}; @@ -419,7 +419,7 @@ int ethosu_invoke_v2(const void *custom_data_ptr, if (!ethosu_drv.status_error) { - ethosu_save_pmu_config(ðosu_drv.dev); + ethosu_save_pmu_counters(ðosu_drv.dev); ethosu_set_clock_and_power(ðosu_drv.dev, ETHOSU_CLOCK_Q_ENABLE, ETHOSU_POWER_Q_ENABLE); } @@ -580,17 +580,14 @@ static int handle_command_stream(struct ethosu_driver *drv, return -1; } - // ETHOSU would have been reset in the IRQ handler if there were - // status error(s). So don't read the QREAD register. (void)ethosu_get_qread(&drv->dev, &qread); if (qread != cms_bytes) { - LOG_ERR( + LOG_WARN( "Failure: IRQ received but qread (%" PRIu32 ") not at end of stream (%" PRIu32 ").\n", qread, cms_bytes); return -1; } - // TODO Power off return 0; } |