aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Moberg <anton.moberg@arm.com>2021-05-03 09:28:52 +0200
committerKristofer Jonsson <kristofer.jonsson@arm.com>2021-05-04 13:19:08 +0000
commitebe9a15e7e3527ff3d8824a6239c1bf68b408647 (patch)
treee3fec76b321e18aca70163587da89c7bd15484a5
parent6440bba43e6842047c8b7ef1e48b786a3c1c2e01 (diff)
downloadethos-u-core-platform-ebe9a15e7e3527ff3d8824a6239c1bf68b408647.tar.gz
[Core Platform] Update to support removal of "_v"-functions
NPU driver interface currently have functions which have been stepped each time a compatibilty breaking changed has been introduced. Old entrypoints have been redefined with macro to use the latest version for backwards compatibility. This series of patches will remove any such functions and macro to unify the interface. Update: All driver entrypoints to support updated interface Change-Id: Ibe5fa7b2ac909eceb16a6879d4eaf9d0d7e36211
-rw-r--r--applications/driver_unit_tests/command_stream.cpp6
-rw-r--r--targets/corstone-300/target.cpp14
2 files changed, 10 insertions, 10 deletions
diff --git a/applications/driver_unit_tests/command_stream.cpp b/applications/driver_unit_tests/command_stream.cpp
index a0b9171..ede9dd6 100644
--- a/applications/driver_unit_tests/command_stream.cpp
+++ b/applications/driver_unit_tests/command_stream.cpp
@@ -105,11 +105,11 @@ CommandStream::CommandStream(const DataPointer &_commandStream,
ethosu_set_clock_and_power(&drv->dev, ETHOSU_CLOCK_Q_DISABLE, ETHOSU_POWER_Q_DISABLE);
// Use simplified driver setup
- ethosu_set_power_mode_v2(drv, true);
+ ethosu_set_power_mode(drv, true);
}
CommandStream::~CommandStream() {
- ethosu_set_power_mode_v2(drv, false);
+ ethosu_set_power_mode(drv, false);
ethosu_release_driver(drv);
}
@@ -123,7 +123,7 @@ int CommandStream::run(size_t repeat) {
}
while (repeat-- > 0) {
- int error = ethosu_invoke_v3(
+ int error = ethosu_invoke(
drv, commandStream.data, commandStream.size, baseAddress, baseAddressSize, ETHOSU_DRIVER_BASEP_INDEXES);
if (error != 0) {
diff --git a/targets/corstone-300/target.cpp b/targets/corstone-300/target.cpp
index 5d93854..2344995 100644
--- a/targets/corstone-300/target.cpp
+++ b/targets/corstone-300/target.cpp
@@ -135,7 +135,7 @@ void HardFault_Handler() {
#ifdef ETHOSU
void ethosuIrqHandler() {
- ethosu_irq_handler();
+ ethosu_irq_handler(ethosu0_driver);
}
#endif
@@ -158,12 +158,12 @@ void targetSetup() {
#ifdef ETHOSU
// Initialize Ethos-U NPU driver
- if (ethosu_init_v4(ethosu0_driver,
- reinterpret_cast<void *>(ETHOSU_BASE_ADDRESS),
- ethosu_scratch,
- ETHOSU_FAST_MEMORY_SIZE,
- 1,
- 1)) {
+ if (ethosu_init(ethosu0_driver,
+ reinterpret_cast<void *>(ETHOSU_BASE_ADDRESS),
+ ethosu_scratch,
+ ETHOSU_FAST_MEMORY_SIZE,
+ 1,
+ 1)) {
printf("Failed to initialize NPU.\n");
return;
}