aboutsummaryrefslogtreecommitdiff
path: root/src/ethosu_pmu.c
diff options
context:
space:
mode:
authorJonny Svärd <jonny.svaerd@arm.com>2022-04-26 18:31:24 +0200
committerKristofer Jonsson <kristofer.jonsson@arm.com>2022-05-05 12:56:33 +0000
commit301399d9e0b619fb2e229c9a9223aaf31ec6bcfa (patch)
tree5dbbfa41d5186add0e28b6d6b3e07b2267856c4f /src/ethosu_pmu.c
parentc6505f3f8df8a5f00197f0eee5cc502e4e59c6a4 (diff)
downloadethos-u-core-driver-301399d9e0b619fb2e229c9a9223aaf31ec6bcfa.tar.gz
Refactor power handling22.05-rc1
Add reference counted ethosu_request_power(), ethosu_release_power() functions. While there are active requests, disable the Q-channel power gating of the Ethos-U device, leaving the device powered on. Note that clock gating is implemented to follow the state of the power gating. Add ethosu_soft_reset() function. Restore power- and clock gating state after reset. Refactor and simplify driver code to use the new functions. Change-Id: I9756572c5c3e51b2be244bcea856d88e890e2d40
Diffstat (limited to 'src/ethosu_pmu.c')
-rw-r--r--src/ethosu_pmu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ethosu_pmu.c b/src/ethosu_pmu.c
index e11636a..df69026 100644
--- a/src/ethosu_pmu.c
+++ b/src/ethosu_pmu.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2021 Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2022 Arm Limited.
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -90,7 +90,7 @@ void ETHOSU_PMU_Enable(struct ethosu_driver *drv)
LOG_DEBUG("Enable PMU");
struct pmcr_r pmcr = {0};
pmcr.cnt_en = 1;
- set_clock_and_power_request(drv, ETHOSU_PMU_REQUEST, ETHOSU_CLOCK_Q_DISABLE, ETHOSU_POWER_Q_DISABLE);
+ ethosu_request_power(drv);
drv->dev->reg->PMCR.word = pmcr.word;
}
@@ -98,7 +98,7 @@ void ETHOSU_PMU_Disable(struct ethosu_driver *drv)
{
LOG_DEBUG("Disable PMU");
drv->dev->reg->PMCR.word = 0;
- set_clock_and_power_request(drv, ETHOSU_PMU_REQUEST, ETHOSU_CLOCK_Q_ENABLE, ETHOSU_POWER_Q_ENABLE);
+ ethosu_release_power(drv);
}
uint32_t ETHOSU_PMU_Get_NumEventCounters(void)