aboutsummaryrefslogtreecommitdiff
path: root/src/ethosu_driver.c
diff options
context:
space:
mode:
authorJonny Svärd <jonny.svaerd@arm.com>2021-11-30 14:54:07 +0100
committerKristofer Jonsson <kristofer.jonsson@arm.com>2021-12-08 14:27:14 +0000
commit6d5b083e2e4279284f406d73c7f92e48ef28b218 (patch)
treead71253ed293384c96c3ca93c3d795cfaa56000e /src/ethosu_driver.c
parent1975b8d9845efdc9a3e2b997ace0a05fdaa11ed0 (diff)
downloadethos-u-core-driver-6d5b083e2e4279284f406d73c7f92e48ef28b218.tar.gz
Minor bugfixes and clean up
Change error message to LOG_ERR from LOG_DEBUG and simplify error checks Remove redundant code in driver Disable the PMU before enabling power/clock gating Change-Id: I3092113250c1b165d985194ca2da213622629488
Diffstat (limited to 'src/ethosu_driver.c')
-rw-r--r--src/ethosu_driver.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/ethosu_driver.c b/src/ethosu_driver.c
index 1c78bcc..522f3e8 100644
--- a/src/ethosu_driver.c
+++ b/src/ethosu_driver.c
@@ -522,25 +522,12 @@ int ethosu_invoke(struct ethosu_driver *drv,
// NPU might have lost power and thus its settings and state
if (!drv->dev_power_always_on)
{
- bool axi_reinit = true;
- // Only soft reset if security state or privilege level needs changing
- if (ethosu_dev_verify_access_state(drv->dev) != true)
- {
- if (ethosu_dev_soft_reset(drv->dev) != ETHOSU_SUCCESS)
- {
- return -1;
- }
- axi_reinit = false;
- }
-
- // Set power ON during the inference
+ // Set power ON during the inference. Will soft reset if security state or
+ // privilege level needs changing
set_clock_and_power_request(drv, ETHOSU_INFERENCE_REQUEST, ETHOSU_CLOCK_Q_ENABLE, ETHOSU_POWER_Q_DISABLE);
- // If a soft reset occured, AXI reinit has already been performed
- if (axi_reinit)
- {
- ethosu_dev_axi_init(drv->dev);
- }
+ // Make sure AXI settings are applied
+ ethosu_dev_axi_init(drv->dev);
}
drv->status_error = false;