aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAnton Moberg <anton.moberg@arm.com>2021-05-03 09:25:06 +0200
committerAnton Moberg <anton.moberg@arm.com>2021-05-03 09:28:34 +0200
commiteffc7aa8b9272fb20cdd1a7d1097818af70acc93 (patch)
treef549b59734b56fbd081d740c41525fb9473fcbe7 /include
parent61ec36b7f85991f83e3729e2997ef8d2cd6cc0f2 (diff)
downloadethos-u-core-driver-effc7aa8b9272fb20cdd1a7d1097818af70acc93.tar.gz
[Core driver] Update to support removal of "_v"-functions21.05-rc221.05-rc1
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: Remove all "_v"-functions and make the latest version the base entrypoint Update: Remove all redefine macros to only allow base entrypoint Note: static inline ethosu_invoke_v2() is kept as it is needed for tensorflow backwards compatibility. Will be removed in later patches. Change-Id: Ifa331daab35af24dc29e0d0007096902b8efc319
Diffstat (limited to 'include')
-rw-r--r--include/ethosu_driver.h51
1 files changed, 17 insertions, 34 deletions
diff --git a/include/ethosu_driver.h b/include/ethosu_driver.h
index 96822e0..e492f91 100644
--- a/include/ethosu_driver.h
+++ b/include/ethosu_driver.h
@@ -103,59 +103,42 @@ extern struct ethosu_driver ethosu_drv;
/**
* Initialize the Ethos-U driver.
*/
-int ethosu_init_v4(struct ethosu_driver *drv,
- const void *base_address,
- const void *fast_memory,
- const size_t fast_memory_size,
- uint32_t secure_enable,
- uint32_t privilege_enable);
-
-#define ethosu_init(base_address) ethosu_init_v3(base_address, NULL, 0, 0, 0)
-#define ethosu_init_v2(base_address, fast_memory, fast_memory_size) \
- ethosu_init_v3(base_address, fast_memory, fast_memory_size, 0, 0)
-#define ethosu_init_v3(base_address, fast_memory, fast_memory_size, secure_enable, privilege_enable) \
- ethosu_init_v4(&ethosu_drv, base_address, fast_memory, fast_memory_size, secure_enable, privilege_enable)
+int ethosu_init(struct ethosu_driver *drv,
+ const void *base_address,
+ const void *fast_memory,
+ const size_t fast_memory_size,
+ uint32_t secure_enable,
+ uint32_t privilege_enable);
/**
* Get Ethos-U version.
*/
-int ethosu_get_version_v2(struct ethosu_driver *drv, struct ethosu_version *version);
-
-#define ethosu_get_version(version) ethosu_get_version_v2(&ethosu_drv, version)
+int ethosu_get_version(struct ethosu_driver *drv, struct ethosu_version *version);
/**
* Invoke Vela command stream.
*/
-int ethosu_invoke_v3(struct ethosu_driver *drv,
- const void *custom_data_ptr,
- const int custom_data_size,
- const uint64_t *base_addr,
- const size_t *base_addr_size,
- const int num_base_addr);
-
-#define ethosu_invoke(custom_data_ptr, custom_data_size, base_addr, num_base_addr) \
- ethosu_invoke_v2(custom_data_ptr, custom_data_size, base_addr, NULL, num_base_addr)
+int ethosu_invoke(struct ethosu_driver *drv,
+ const void *custom_data_ptr,
+ const int custom_data_size,
+ const uint64_t *base_addr,
+ const size_t *base_addr_size,
+ const int num_base_addr);
/**
* Abort Ethos-U inference.
*/
-void ethosu_abort_v2(struct ethosu_driver *drv);
-
-#define ethosu_abort(void) ethosu_abort_v2(&ethosu_drv)
+void ethosu_abort(struct ethosu_driver *drv);
/**
* Interrupt handler do be called on IRQ from Ethos-U
*/
-void ethosu_irq_handler_v2(struct ethosu_driver *drv);
-
-#define ethosu_irq_handler(void) ethosu_irq_handler_v2(&ethosu_drv)
+void ethosu_irq_handler(struct ethosu_driver *drv);
/**
* Set Ethos-U power mode.
*/
-void ethosu_set_power_mode_v2(struct ethosu_driver *drv, bool always_on);
-
-#define ethosu_set_power_mode(always_on) ethosu_set_power_mode_v2(&ethosu_drv, always_on)
+void ethosu_set_power_mode(struct ethosu_driver *drv, bool always_on);
/**
* Register a driver for multiNPU usage
@@ -195,7 +178,7 @@ static inline int ethosu_invoke_v2(const void *custom_data_ptr,
const int num_base_addr)
{
struct ethosu_driver *drv = ethosu_reserve_driver();
- int result = ethosu_invoke_v3(drv, custom_data_ptr, custom_data_size, base_addr, base_addr_size, num_base_addr);
+ int result = ethosu_invoke(drv, custom_data_ptr, custom_data_size, base_addr, base_addr_size, num_base_addr);
ethosu_release_driver(drv);
return result;
}