aboutsummaryrefslogtreecommitdiff
path: root/include/ethosu_driver.h
diff options
context:
space:
mode:
authorJonny Svärd <jonny.svaerd@arm.com>2021-10-13 16:04:26 +0200
committerJonny Svärd <jonny.svaerd@arm.com>2021-11-01 17:41:41 +0100
commit136810fa7e8f7f21c0bfb17dd5c81b247fc1e305 (patch)
treecac3ed567b70deeeca7053a435d51ff0c78628c0 /include/ethosu_driver.h
parenta0e4d31c5531b55a638d1efa0a43e1f296a2f2d9 (diff)
downloadethos-u-core-driver-136810fa7e8f7f21c0bfb17dd5c81b247fc1e305.tar.gz
Autumn clean/refactor of NPU driver
A continuation of the spring clean/refactor work. Create a better separation between driver and device(s). A short summary of what this commit contains: - Split device and driver - Simplify and hide the internal device interface - Remove (broken) abort inference functionality - Refactoring of structure - Optimizations and bugfixes Change-Id: I8988bc5f163f9ea62add2a933e4f100a82cc8d35
Diffstat (limited to 'include/ethosu_driver.h')
-rw-r--r--include/ethosu_driver.h19
1 files changed, 5 insertions, 14 deletions
diff --git a/include/ethosu_driver.h b/include/ethosu_driver.h
index 6f8f201..a7b2bdb 100644
--- a/include/ethosu_driver.h
+++ b/include/ethosu_driver.h
@@ -23,7 +23,7 @@
* Includes
******************************************************************************/
-#include "ethosu_device.h"
+#include "ethosu_types.h"
#include <stdbool.h>
#include <stddef.h>
@@ -45,15 +45,17 @@ extern "C" {
* Types
******************************************************************************/
+// Forward declare
+struct ethosu_device;
+
struct ethosu_driver
{
- struct ethosu_device dev;
+ struct ethosu_device *dev;
struct ethosu_driver *next;
void *semaphore;
uint64_t fast_memory;
size_t fast_memory_size;
bool status_error;
- bool abort_inference;
bool dev_power_always_on;
bool reserved;
volatile bool irq_triggered;
@@ -68,12 +70,6 @@ struct ethosu_driver_version
uint8_t patch;
};
-struct ethosu_hw_info
-{
- struct ethosu_id version;
- struct ethosu_config cfg;
-};
-
enum ethosu_request_clients
{
ETHOSU_PMU_REQUEST = 0,
@@ -159,11 +155,6 @@ int ethosu_invoke(struct ethosu_driver *drv,
const int num_base_addr);
/**
- * Abort Ethos-U inference.
- */
-void ethosu_abort(struct ethosu_driver *drv);
-
-/**
* Set Ethos-U power mode.
*/
void ethosu_set_power_mode(struct ethosu_driver *drv, bool always_on);