aboutsummaryrefslogtreecommitdiff
path: root/kernel/uapi/ethosu.h
diff options
context:
space:
mode:
authorMikael Olsson <mikael.olsson@arm.com>2023-10-30 11:10:56 +0100
committerMikael Olsson <mikael.olsson@arm.com>2023-11-06 09:36:00 +0100
commitc081e5954cd92165b139488e76bdfef1402acee6 (patch)
tree32bc237c124e21f12287150cba040c87c8e8b7e3 /kernel/uapi/ethosu.h
parent9c999fdd40c0bf2ae420f6f3bfe013dc6baa73c1 (diff)
downloadethos-u-linux-driver-stack-c081e5954cd92165b139488e76bdfef1402acee6.tar.gz
Change create network UAPI to take a user buffer
To not allow the buffer for a network instance to be changed after creation, the create network UAPI will now take the network model data as a user buffer. The content of the user buffer is copied into an internally allocated DMA buffer that cannot be accessed by the user. This breaks the current API so the Linux kernel NPU driver version and the driver library version have been given major version bumps. All the tests, documentation and other applications affected by the changes have been updated accordingly. Change-Id: I25c785d75a24794c3db632e4abe5cfbb1c7ac190 Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
Diffstat (limited to 'kernel/uapi/ethosu.h')
-rw-r--r--kernel/uapi/ethosu.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/kernel/uapi/ethosu.h b/kernel/uapi/ethosu.h
index 4e4d180..35eaf60 100644
--- a/kernel/uapi/ethosu.h
+++ b/kernel/uapi/ethosu.h
@@ -67,7 +67,7 @@ namespace EthosU {
#define ETHOSU_PMU_EVENT_MAX 8
/* Kernel driver version */
-#define ETHOSU_KERNEL_DRIVER_VERSION_MAJOR 2
+#define ETHOSU_KERNEL_DRIVER_VERSION_MAJOR 3
#define ETHOSU_KERNEL_DRIVER_VERSION_MINOR 0
#define ETHOSU_KERNEL_DRIVER_VERSION_PATCH 0
@@ -109,13 +109,14 @@ struct ethosu_uapi_buffer_create {
/**
* enum ethosu_uapi_network_type - Network buffer type.
- * @ETHOSU_UAPI_NETWORK_BUFFER: Network is stored in a buffer handle.
- * @ETHOSU_UAPI_NETWORK_INDEX: Network is built into firmware and referenced by
- * index.
+ * @ETHOSU_UAPI_NETWORK_USER_BUFFER: Network data is provided in a user
+ * buffer.
+ * @ETHOSU_UAPI_NETWORK_INDEX: Network is built into firmware and
+ * referenced by index.
*/
enum ethosu_uapi_network_type {
- ETHOSU_UAPI_NETWORK_BUFFER = 1,
- ETHOSU_UAPI_NETWORK_INDEX
+ ETHOSU_UAPI_NETWORK_USER_BUFFER = 1,
+ ETHOSU_UAPI_NETWORK_INDEX,
};
/**
@@ -127,7 +128,10 @@ enum ethosu_uapi_network_type {
struct ethosu_uapi_network_create {
uint32_t type;
union {
- __u32 fd;
+ struct {
+ __u64 data_ptr;
+ __u32 size;
+ } network;
__u32 index;
};
};