aboutsummaryrefslogtreecommitdiff
path: root/kernel/include
diff options
context:
space:
mode:
authorMikael Olsson <mikael.olsson@arm.com>2024-02-12 09:56:56 +0100
committerMikael Olsson <mikael.olsson@arm.com>2024-02-12 13:28:26 +0100
commit16be28550f0906e2bfff20b94dd373f59b4a2ccf (patch)
tree72ac8fa23cccacc5db2f4e08e31659eaed60ad51 /kernel/include
parentd4ad9e55cb8e17a4a42b3a94c64e6bc48529b26e (diff)
downloadethos-u-linux-driver-stack-16be28550f0906e2bfff20b94dd373f59b4a2ccf.tar.gz
Rename macros and types to namespace their usage
Macros and types have been renamed accordingly to namespace them by their usage in the new kernel driver source tree structure. This is done in a separate commit from the restructuring to avoid Git from seeing some of the moved files as new ones because they have been both moved and modified at the same time and thus losing the connection in the history. Change-Id: Icd4d8e8c76779479b5b46a55bf1d4f78a629c281 Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
Diffstat (limited to 'kernel/include')
-rw-r--r--kernel/include/common/ethosu_device.h2
-rw-r--r--kernel/include/rpmsg/ethosu_rpmsg.h193
-rw-r--r--kernel/include/rpmsg/ethosu_rpmsg_cancel_inference.h34
-rw-r--r--kernel/include/rpmsg/ethosu_rpmsg_capabilities.h24
-rw-r--r--kernel/include/rpmsg/ethosu_rpmsg_inference.h78
-rw-r--r--kernel/include/rpmsg/ethosu_rpmsg_mailbox.h121
-rw-r--r--kernel/include/rpmsg/ethosu_rpmsg_network.h40
-rw-r--r--kernel/include/rpmsg/ethosu_rpmsg_network_info.h34
-rw-r--r--kernel/include/rpmsg/ethosu_rpmsg_version.h30
9 files changed, 279 insertions, 277 deletions
diff --git a/kernel/include/common/ethosu_device.h b/kernel/include/common/ethosu_device.h
index e96543e..04ac5d8 100644
--- a/kernel/include/common/ethosu_device.h
+++ b/kernel/include/common/ethosu_device.h
@@ -46,7 +46,7 @@ struct ethosu_device {
struct rpmsg_endpoint *ept;
struct cdev cdev;
struct class *class;
- struct ethosu_mailbox mailbox;
+ struct ethosu_rpmsg_mailbox mailbox;
struct ethosu_uapi_device_capabilities capabilities;
};
diff --git a/kernel/include/rpmsg/ethosu_rpmsg.h b/kernel/include/rpmsg/ethosu_rpmsg.h
index c1923c2..0be323e 100644
--- a/kernel/include/rpmsg/ethosu_rpmsg.h
+++ b/kernel/include/rpmsg/ethosu_rpmsg.h
@@ -17,8 +17,8 @@
* http://www.gnu.org/licenses/gpl-2.0.html.
*/
-#ifndef ETHOSU_CORE_RPMSG_H
-#define ETHOSU_CORE_RPMSG_H
+#ifndef ETHOSU_RPMSG_H
+#define ETHOSU_RPMSG_H
#ifdef __KERNEL__
#include <linux/types.h>
@@ -31,137 +31,138 @@ namespace EthosU {
#endif
/** Maximum number of IFM/OFM buffers per inference */
-#define ETHOSU_CORE_BUFFER_MAX 16
+#define ETHOSU_RPMSG_BUFFER_MAX 16
/** Maximum number of PMU counters to be returned for inference */
-#define ETHOSU_CORE_PMU_MAX 8
+#define ETHOSU_RPMSG_PMU_MAX 8
-#define ETHOSU_CORE_MSG_MAGIC 0x41457631
-#define ETHOSU_CORE_MSG_VERSION_MAJOR 0
-#define ETHOSU_CORE_MSG_VERSION_MINOR 2
-#define ETHOSU_CORE_MSG_VERSION_PATCH 0
+#define ETHOSU_RPMSG_MAGIC 0x41457631
+#define ETHOSU_RPMSG_VERSION_MAJOR 0
+#define ETHOSU_RPMSG_VERSION_MINOR 2
+#define ETHOSU_RPMSG_VERSION_PATCH 0
/**
- * enum ethosu_core_msg_type - Message types
+ * enum ethosu_rpmsg_type - Message types
*
* Types for the messages sent between the host and the core subsystem.
*/
-enum ethosu_core_msg_type {
- ETHOSU_CORE_MSG_ERR = 1,
- ETHOSU_CORE_MSG_PING,
- ETHOSU_CORE_MSG_PONG,
- ETHOSU_CORE_MSG_INFERENCE_REQ,
- ETHOSU_CORE_MSG_INFERENCE_RSP,
- ETHOSU_CORE_MSG_VERSION_REQ,
- ETHOSU_CORE_MSG_VERSION_RSP,
- ETHOSU_CORE_MSG_CAPABILITIES_REQ,
- ETHOSU_CORE_MSG_CAPABILITIES_RSP,
- ETHOSU_CORE_MSG_NETWORK_INFO_REQ,
- ETHOSU_CORE_MSG_NETWORK_INFO_RSP,
- ETHOSU_CORE_MSG_CANCEL_INFERENCE_REQ,
- ETHOSU_CORE_MSG_CANCEL_INFERENCE_RSP,
- ETHOSU_CORE_MSG_MAX
+enum ethosu_rpmsg_type {
+ ETHOSU_RPMSG_ERR = 1,
+ ETHOSU_RPMSG_PING,
+ ETHOSU_RPMSG_PONG,
+ ETHOSU_RPMSG_INFERENCE_REQ,
+ ETHOSU_RPMSG_INFERENCE_RSP,
+ ETHOSU_RPMSG_VERSION_REQ,
+ ETHOSU_RPMSG_VERSION_RSP,
+ ETHOSU_RPMSG_CAPABILITIES_REQ,
+ ETHOSU_RPMSG_CAPABILITIES_RSP,
+ ETHOSU_RPMSG_NETWORK_INFO_REQ,
+ ETHOSU_RPMSG_NETWORK_INFO_RSP,
+ ETHOSU_RPMSG_CANCEL_INFERENCE_REQ,
+ ETHOSU_RPMSG_CANCEL_INFERENCE_RSP,
+ ETHOSU_RPMSG_MAX
};
/**
- * struct ethosu_core_msg_header - Message header
+ * struct ethosu_rpmsg_header - Message header
*/
-struct ethosu_core_msg_header {
+struct ethosu_rpmsg_header {
uint32_t magic;
uint32_t type;
uint64_t msg_id;
};
/**
- * enum ethosu_core_status - Status
+ * enum ethosu_rpmsg_status - Status
*/
-enum ethosu_core_status {
- ETHOSU_CORE_STATUS_OK,
- ETHOSU_CORE_STATUS_ERROR,
- ETHOSU_CORE_STATUS_RUNNING,
- ETHOSU_CORE_STATUS_REJECTED,
- ETHOSU_CORE_STATUS_ABORTED,
- ETHOSU_CORE_STATUS_ABORTING,
+enum ethosu_rpmsg_status {
+ ETHOSU_RPMSG_STATUS_OK,
+ ETHOSU_RPMSG_STATUS_ERROR,
+ ETHOSU_RPMSG_STATUS_RUNNING,
+ ETHOSU_RPMSG_STATUS_REJECTED,
+ ETHOSU_RPMSG_STATUS_ABORTED,
+ ETHOSU_RPMSG_STATUS_ABORTING,
};
/**
- * struct ethosu_core_buffer - Buffer descriptor
+ * struct ethosu_rpmsg_buffer - Buffer descriptor
*
* Pointer and size to a buffer within the Ethos-U address space.
*/
-struct ethosu_core_buffer {
+struct ethosu_rpmsg_buffer {
uint32_t ptr;
uint32_t size;
};
/**
- * enum ethosu_core_network_type - Network buffer type
+ * enum ethosu_rpmsg_network_type - Network buffer type
*/
-enum ethosu_core_network_type {
- ETHOSU_CORE_NETWORK_BUFFER = 1,
- ETHOSU_CORE_NETWORK_INDEX
+enum ethosu_rpmsg_network_type {
+ ETHOSU_RPMSG_NETWORK_BUFFER = 1,
+ ETHOSU_RPMSG_NETWORK_INDEX
};
/**
- * struct ethosu_core_network_buffer - Network buffer
+ * struct ethosu_rpmsg_network_buffer - Network buffer
*/
-struct ethosu_core_network_buffer {
+struct ethosu_rpmsg_network_buffer {
uint32_t type;
union {
- struct ethosu_core_buffer buffer;
- uint32_t index;
+ struct ethosu_rpmsg_buffer buffer;
+ uint32_t index;
};
};
/**
- * struct ethosu_core_msg_inference_req - Inference request
+ * struct ethosu_rpmsg_inference_req - Inference request
*/
-struct ethosu_core_msg_inference_req {
- uint32_t ifm_count;
- struct ethosu_core_buffer ifm[ETHOSU_CORE_BUFFER_MAX];
- uint32_t ofm_count;
- struct ethosu_core_buffer ofm[ETHOSU_CORE_BUFFER_MAX];
- struct ethosu_core_network_buffer network;
- uint8_t pmu_event_config[ETHOSU_CORE_PMU_MAX];
- uint32_t pmu_cycle_counter_enable;
+struct ethosu_rpmsg_inference_req {
+ uint32_t ifm_count;
+ struct ethosu_rpmsg_buffer ifm[ETHOSU_RPMSG_BUFFER_MAX];
+ uint32_t ofm_count;
+ struct ethosu_rpmsg_buffer ofm[ETHOSU_RPMSG_BUFFER_MAX];
+ struct ethosu_rpmsg_network_buffer network;
+ uint8_t pmu_event_config[ETHOSU_RPMSG_PMU_MAX
+ ];
+ uint32_t pmu_cycle_counter_enable;
};
/**
- * struct ethosu_core_msg_inference_rsp - Inference response
+ * struct ethosu_rpmsg_inference_rsp - Inference response
*/
-struct ethosu_core_msg_inference_rsp {
+struct ethosu_rpmsg_inference_rsp {
uint32_t ofm_count;
- uint32_t ofm_size[ETHOSU_CORE_BUFFER_MAX];
+ uint32_t ofm_size[ETHOSU_RPMSG_BUFFER_MAX];
uint32_t status;
- uint8_t pmu_event_config[ETHOSU_CORE_PMU_MAX];
- uint64_t pmu_event_count[ETHOSU_CORE_PMU_MAX];
+ uint8_t pmu_event_config[ETHOSU_RPMSG_PMU_MAX];
+ uint64_t pmu_event_count[ETHOSU_RPMSG_PMU_MAX];
uint32_t pmu_cycle_counter_enable;
uint64_t pmu_cycle_counter_count;
};
/**
- * struct ethosu_core_msg_network_info_req - Network information request
+ * struct ethosu_rpmsg_network_info_req - Network information request
*/
-struct ethosu_core_msg_network_info_req {
- struct ethosu_core_network_buffer network;
+struct ethosu_rpmsg_network_info_req {
+ struct ethosu_rpmsg_network_buffer network;
};
/**
- * struct ethosu_core_msg_network_info_rsp - Network information response
+ * struct ethosu_rpmsg_network_info_rsp - Network information response
*/
-struct ethosu_core_msg_network_info_rsp {
+struct ethosu_rpmsg_network_info_rsp {
char desc[32];
uint32_t ifm_count;
- uint32_t ifm_size[ETHOSU_CORE_BUFFER_MAX];
+ uint32_t ifm_size[ETHOSU_RPMSG_BUFFER_MAX];
uint32_t ofm_count;
- uint32_t ofm_size[ETHOSU_CORE_BUFFER_MAX];
+ uint32_t ofm_size[ETHOSU_RPMSG_BUFFER_MAX];
uint32_t status;
};
/**
- * struct ethosu_core_msg_version_rsp - Message protocol version
+ * struct ethosu_rpmsg_version_rsp - Message protocol version
*/
-struct ethosu_core_msg_version_rsp {
+struct ethosu_rpmsg_version_rsp {
uint8_t major;
uint8_t minor;
uint8_t patch;
@@ -169,9 +170,9 @@ struct ethosu_core_msg_version_rsp {
};
/**
- * struct ethosu_core_msg_capabilities_rsp - Message capabilities response
+ * struct ethosu_rpmsg_capabilities_rsp - Message capabilities response
*/
-struct ethosu_core_msg_capabilities_rsp {
+struct ethosu_rpmsg_capabilities_rsp {
uint32_t version_status;
uint32_t version_minor;
uint32_t version_major;
@@ -188,56 +189,56 @@ struct ethosu_core_msg_capabilities_rsp {
};
/**
- * struct ethosu_core_msg_cancel_inference_req - Message cancel inference
+ * struct ethosu_rpmsg_cancel_inference_req - Message cancel inference
* request
*/
-struct ethosu_core_msg_cancel_inference_req {
+struct ethosu_rpmsg_cancel_inference_req {
uint64_t inference_handle;
};
/**
- * struct ethosu_core_msg_cancel_inference_rsp - Message cancel inference
+ * struct ethosu_rpmsg_cancel_inference_rsp - Message cancel inference
* response
*/
-struct ethosu_core_msg_cancel_inference_rsp {
+struct ethosu_rpmsg_cancel_inference_rsp {
uint32_t status;
};
/**
- * enum ethosu_core_err_type - Error types
+ * enum ethosu_rpmsg_err_type - Error types
*/
-enum ethosu_core_err_type {
- ETHOSU_CORE_MSG_ERR_GENERIC = 0,
- ETHOSU_CORE_MSG_ERR_UNSUPPORTED_TYPE,
- ETHOSU_CORE_MSG_ERR_INVALID_PAYLOAD,
- ETHOSU_CORE_MSG_ERR_INVALID_SIZE,
- ETHOSU_CORE_MSG_ERR_INVALID_MAGIC,
- ETHOSU_CORE_MSG_ERR_MAX
+enum ethosu_rpmsg_err_type {
+ ETHOSU_RPMSG_ERR_GENERIC = 0,
+ ETHOSU_RPMSG_ERR_UNSUPPORTED_TYPE,
+ ETHOSU_RPMSG_ERR_INVALID_PAYLOAD,
+ ETHOSU_RPMSG_ERR_INVALID_SIZE,
+ ETHOSU_RPMSG_ERR_INVALID_MAGIC,
+ ETHOSU_RPMSG_ERR_MAX
};
/**
- * struct ethosu_core_msg_err - Error message struct
+ * struct ethosu_rpmsg_err - Error message struct
*/
-struct ethosu_core_msg_err {
+struct ethosu_rpmsg_err {
uint32_t type; /* optional use of extra error code */
char msg[128];
};
/**
- * struct ethosu_core_rpmsg - Rpmsg message
+ * struct ethosu_rpmsg - Rpmsg message
*/
-struct ethosu_core_rpmsg {
- struct ethosu_core_msg_header header;
+struct ethosu_rpmsg {
+ struct ethosu_rpmsg_header header;
union {
- struct ethosu_core_msg_inference_req inf_req;
- struct ethosu_core_msg_inference_rsp inf_rsp;
- struct ethosu_core_msg_network_info_req net_info_req;
- struct ethosu_core_msg_network_info_rsp net_info_rsp;
- struct ethosu_core_msg_capabilities_rsp cap_rsp;
- struct ethosu_core_msg_cancel_inference_req cancel_req;
- struct ethosu_core_msg_cancel_inference_rsp cancel_rsp;
- struct ethosu_core_msg_version_rsp version_rsp;
- struct ethosu_core_msg_err error;
+ struct ethosu_rpmsg_inference_req inf_req;
+ struct ethosu_rpmsg_inference_rsp inf_rsp;
+ struct ethosu_rpmsg_network_info_req net_info_req;
+ struct ethosu_rpmsg_network_info_rsp net_info_rsp;
+ struct ethosu_rpmsg_capabilities_rsp cap_rsp;
+ struct ethosu_rpmsg_cancel_inference_req cancel_req;
+ struct ethosu_rpmsg_cancel_inference_rsp cancel_rsp;
+ struct ethosu_rpmsg_version_rsp version_rsp;
+ struct ethosu_rpmsg_err error;
};
};
@@ -245,4 +246,4 @@ struct ethosu_core_rpmsg {
} /*namespace EthosU */
#endif
-#endif /* ETHOSU_CORE_RPMSG_H */
+#endif /* ETHOSU_RPMSG_H */
diff --git a/kernel/include/rpmsg/ethosu_rpmsg_cancel_inference.h b/kernel/include/rpmsg/ethosu_rpmsg_cancel_inference.h
index 1d6cc03..799b006 100644
--- a/kernel/include/rpmsg/ethosu_rpmsg_cancel_inference.h
+++ b/kernel/include/rpmsg/ethosu_rpmsg_cancel_inference.h
@@ -17,8 +17,8 @@
* http://www.gnu.org/licenses/gpl-2.0.html.
*/
-#ifndef ETHOSU_CANCEL_INFERENCE_H
-#define ETHOSU_CANCEL_INFERENCE_H
+#ifndef ETHOSU_RPMSG_CANCEL_INFERENCE_H
+#define ETHOSU_RPMSG_CANCEL_INFERENCE_H
/****************************************************************************
* Includes
@@ -34,16 +34,16 @@
* Types
****************************************************************************/
-struct ethosu_core_msg_cancel_inference_rsp;
-struct ethosu_inference;
+struct ethosu_rpmsg_cancel_inference_rsp;
+struct ethosu_rpmsg_inference;
struct ethosu_uapi_cancel_inference_status;
-struct ethosu_cancel_inference {
+struct ethosu_rpmsg_cancel_inference {
struct device *dev;
- struct ethosu_inference *inf;
+ struct ethosu_rpmsg_inference *inf;
struct ethosu_uapi_cancel_inference_status *uapi;
struct completion done;
- struct ethosu_mailbox_msg msg;
+ struct ethosu_rpmsg_mailbox_msg msg;
int errno;
};
@@ -52,20 +52,20 @@ struct ethosu_cancel_inference {
****************************************************************************/
/**
- * ethosu_cancel_inference_request() - Send cancel inference request
+ * ethosu_rpmsg_cancel_inference_request() - Send cancel inference request
*
* Return: 0 on success, error code otherwise.
*/
-int ethosu_cancel_inference_request(struct device *dev,
- struct ethosu_mailbox *mailbox,
- struct ethosu_inference *inf,
- struct ethosu_uapi_cancel_inference_status *uapi);
+int ethosu_rpmsg_cancel_inference_request(struct device *dev,
+ struct ethosu_rpmsg_mailbox *mailbox,
+ struct ethosu_rpmsg_inference *inf,
+ struct ethosu_uapi_cancel_inference_status *uapi);
/**
- * ethosu_cancel_inference_rsp() - Handle cancel inference response
+ * ethosu_rpmsg_cancel_inference_rsp() - Handle cancel inference response
*/
-void ethosu_cancel_inference_rsp(struct ethosu_mailbox *mailbox,
- int msg_id,
- struct ethosu_core_msg_cancel_inference_rsp *rsp);
+void ethosu_rpmsg_cancel_inference_rsp(struct ethosu_rpmsg_mailbox *mailbox,
+ int msg_id,
+ struct ethosu_rpmsg_cancel_inference_rsp *rsp);
-#endif /* ETHOSU_CANCEL_INFERENCE_H */
+#endif /* ETHOSU_RPMSG_CANCEL_INFERENCE_H */
diff --git a/kernel/include/rpmsg/ethosu_rpmsg_capabilities.h b/kernel/include/rpmsg/ethosu_rpmsg_capabilities.h
index aefdbaa..04e5354 100644
--- a/kernel/include/rpmsg/ethosu_rpmsg_capabilities.h
+++ b/kernel/include/rpmsg/ethosu_rpmsg_capabilities.h
@@ -17,8 +17,8 @@
* http://www.gnu.org/licenses/gpl-2.0.html.
*/
-#ifndef ETHOSU_CAPABILITIES_H
-#define ETHOSU_CAPABILITIES_H
+#ifndef ETHOSU_RPMSG_CAPABILITES_H
+#define ETHOSU_RPMSG_CAPABILITES_H
/****************************************************************************
* Includes
@@ -33,18 +33,18 @@
* Types
****************************************************************************/
-struct ethosu_core_msg_capabilities_rsp;
+struct ethosu_rpmsg_capabilities_rsp;
struct ethosu_device;
struct ethosu_uapi_device_capabilities;
/**
- * struct ethosu_capabilities - Capabilities internal struct
+ * struct ethosu_rpmsg_capabilities - Capabilities internal struct
*/
-struct ethosu_capabilities {
+struct ethosu_rpmsg_capabilities {
struct device *dev;
struct completion done;
struct ethosu_uapi_device_capabilities *uapi;
- struct ethosu_mailbox_msg msg;
+ struct ethosu_rpmsg_mailbox_msg msg;
int errno;
};
@@ -52,12 +52,12 @@ struct ethosu_capabilities {
* Functions
****************************************************************************/
-int ethosu_capabilities_request(struct device *dev,
- struct ethosu_mailbox *mailbox,
- struct ethosu_uapi_device_capabilities *uapi);
+int ethosu_rpmsg_capabilities_request(struct device *dev,
+ struct ethosu_rpmsg_mailbox *mailbox,
+ struct ethosu_uapi_device_capabilities *uapi);
-void ethosu_capability_rsp(struct ethosu_mailbox *mailbox,
+void ethosu_capability_rsp(struct ethosu_rpmsg_mailbox *mailbox,
int msg_id,
- struct ethosu_core_msg_capabilities_rsp *rsp);
+ struct ethosu_rpmsg_capabilities_rsp *rsp);
-#endif
+#endif /* ETHOSU_RPMSG_CAPABILITES_H */
diff --git a/kernel/include/rpmsg/ethosu_rpmsg_inference.h b/kernel/include/rpmsg/ethosu_rpmsg_inference.h
index 8bdfb8a..e1d1610 100644
--- a/kernel/include/rpmsg/ethosu_rpmsg_inference.h
+++ b/kernel/include/rpmsg/ethosu_rpmsg_inference.h
@@ -17,8 +17,8 @@
* http://www.gnu.org/licenses/gpl-2.0.html.
*/
-#ifndef ETHOSU_INFERENCE_H
-#define ETHOSU_INFERENCE_H
+#ifndef ETHOSU_RPMSG_INFERENCE_H
+#define ETHOSU_RPMSG_INFERENCE_H
/****************************************************************************
* Includes
@@ -35,13 +35,13 @@
****************************************************************************/
struct ethosu_buffer;
-struct ethosu_core_msg_inference_rsp;
-struct ethosu_network;
+struct ethosu_rpmsg_inference_rsp;
+struct ethosu_rpmsg_network;
struct ethosu_uapi_inference_create;
struct file;
/**
- * struct ethosu_inference - Inference struct
+ * struct ethosu_rpmsg_inference - Inference struct
* @edev: Arm Ethos-U device
* @file: File handle
* @kref: Reference counter
@@ -57,24 +57,24 @@ struct file;
* @pmu_cycle_counter_count: PMU cycle counter count after inference
* @msg: Mailbox message
*/
-struct ethosu_inference {
- struct device *dev;
- struct ethosu_mailbox *mailbox;
- struct file *file;
- struct kref kref;
- wait_queue_head_t waitq;
- bool done;
- uint32_t ifm_count;
- struct ethosu_buffer *ifm[ETHOSU_FD_MAX];
- uint32_t ofm_count;
- struct ethosu_buffer *ofm[ETHOSU_FD_MAX];
- struct ethosu_network *net;
- enum ethosu_uapi_status status;
- uint8_t pmu_event_config[ETHOSU_PMU_EVENT_MAX];
- uint64_t pmu_event_count[ETHOSU_PMU_EVENT_MAX];
- uint32_t pmu_cycle_counter_enable;
- uint64_t pmu_cycle_counter_count;
- struct ethosu_mailbox_msg msg;
+struct ethosu_rpmsg_inference {
+ struct device *dev;
+ struct ethosu_rpmsg_mailbox *mailbox;
+ struct file *file;
+ struct kref kref;
+ wait_queue_head_t waitq;
+ bool done;
+ uint32_t ifm_count;
+ struct ethosu_buffer *ifm[ETHOSU_FD_MAX];
+ uint32_t ofm_count;
+ struct ethosu_buffer *ofm[ETHOSU_FD_MAX];
+ struct ethosu_rpmsg_network *net;
+ enum ethosu_uapi_status status;
+ uint8_t pmu_event_config[ETHOSU_PMU_EVENT_MAX];
+ uint64_t pmu_event_count[ETHOSU_PMU_EVENT_MAX];
+ uint32_t pmu_cycle_counter_enable;
+ uint64_t pmu_cycle_counter_count;
+ struct ethosu_rpmsg_mailbox_msg msg;
};
/****************************************************************************
@@ -82,43 +82,43 @@ struct ethosu_inference {
****************************************************************************/
/**
- * ethosu_inference_create() - Create inference
+ * ethosu_rpmsg_inference_create() - Create inference
*
* This function must be called in the context of a user space process.
*
* Return: fd on success, else error code.
*/
-int ethosu_inference_create(struct device *dev,
- struct ethosu_mailbox *mailbox,
- struct ethosu_network *net,
- struct ethosu_uapi_inference_create *uapi);
+int ethosu_rpmsg_inference_create(struct device *dev,
+ struct ethosu_rpmsg_mailbox *mailbox,
+ struct ethosu_rpmsg_network *net,
+ struct ethosu_uapi_inference_create *uapi);
/**
- * ethosu_inference_get_from_fd() - Get inference handle from fd
+ * ethosu_rpmsg_inference_get_from_fd() - Get inference handle from fd
*
* This function must be called from a user space context.
*
* Return: Pointer on success, else ERR_PTR.
*/
-struct ethosu_inference *ethosu_inference_get_from_fd(int fd);
+struct ethosu_rpmsg_inference *ethosu_rpmsg_inference_get_from_fd(int fd);
/**
- * ethosu_inference_get() - Get inference
+ * ethosu_rpmsg_inference_get() - Get inference
*/
-void ethosu_inference_get(struct ethosu_inference *inf);
+void ethosu_rpmsg_inference_get(struct ethosu_rpmsg_inference *inf);
/**
- * ethosu_inference_put() - Put inference
+ * ethosu_rpmsg_inference_put() - Put inference
*
* Return: 1 if object was removed, else 0.
*/
-int ethosu_inference_put(struct ethosu_inference *inf);
+int ethosu_rpmsg_inference_put(struct ethosu_rpmsg_inference *inf);
/**
- * ethosu_inference_rsp() - Handle inference response
+ * ethosu_rpmsg_inference_rsp() - Handle inference response
*/
-void ethosu_inference_rsp(struct ethosu_mailbox *mailbox,
- int msg_id,
- struct ethosu_core_msg_inference_rsp *rsp);
+void ethosu_rpmsg_inference_rsp(struct ethosu_rpmsg_mailbox *mailbox,
+ int msg_id,
+ struct ethosu_rpmsg_inference_rsp *rsp);
-#endif /* ETHOSU_INFERENCE_H */
+#endif /* ETHOSU_RPMSG_INFERENCE_H */
diff --git a/kernel/include/rpmsg/ethosu_rpmsg_mailbox.h b/kernel/include/rpmsg/ethosu_rpmsg_mailbox.h
index 66eb172..b660288 100644
--- a/kernel/include/rpmsg/ethosu_rpmsg_mailbox.h
+++ b/kernel/include/rpmsg/ethosu_rpmsg_mailbox.h
@@ -17,8 +17,8 @@
* http://www.gnu.org/licenses/gpl-2.0.html.
*/
-#ifndef ETHOSU_MAILBOX_H
-#define ETHOSU_MAILBOX_H
+#ifndef ETHOSU_RPMSG_MAILBOX_H
+#define ETHOSU_RPMSG_MAILBOX_H
/****************************************************************************
* Includes
@@ -36,15 +36,15 @@
struct device;
struct ethosu_buffer;
-struct ethosu_core_msg;
-struct ethosu_core_queue;
+struct ethosu_rpmsg;
+struct ethosu_rpmsg_core_queue;
struct ethosu_device;
-struct ethosu_network;
+struct ethosu_rpmsg_network;
struct resource;
-typedef void (*ethosu_mailbox_cb)(void *user_arg);
+typedef void (*ethosu_rpmsg_mailbox_cb)(void *user_arg);
-struct ethosu_mailbox {
+struct ethosu_rpmsg_mailbox {
struct device *dev;
struct rpmsg_endpoint *ept;
struct idr msg_idr;
@@ -53,17 +53,17 @@ struct ethosu_mailbox {
};
/**
- * struct ethosu_mailbox_msg - Mailbox message
+ * struct ethosu_rpmsg_mailbox_msg - Mailbox message
* @id: Message id
* @type: Message request type
* @fail: Message failure callback
*
* The fail callback will be called with the device mutex locked
*/
-struct ethosu_mailbox_msg {
+struct ethosu_rpmsg_mailbox_msg {
int id;
uint32_t type;
- void (*fail)(struct ethosu_mailbox_msg *msg);
+ void (*fail)(struct ethosu_rpmsg_mailbox_msg *msg);
};
/****************************************************************************
@@ -71,124 +71,125 @@ struct ethosu_mailbox_msg {
****************************************************************************/
/**
- * ethosu_mailbox_init() - Initialize mailbox
+ * ethosu_rpmsg_mailbox_init() - Initialize mailbox
*
* Return: 0 on success, else error code.
*/
-int ethosu_mailbox_init(struct ethosu_mailbox *mbox,
- struct device *dev,
- struct rpmsg_endpoint *ept);
+int ethosu_rpmsg_mailbox_init(struct ethosu_rpmsg_mailbox *mbox,
+ struct device *dev,
+ struct rpmsg_endpoint *ept);
/**
- * ethosu_mailbox_deinit() - Deinitialize mailbox
+ * ethosu_rpmsg_mailbox_deinit() - Deinitialize mailbox
*/
-void ethosu_mailbox_deinit(struct ethosu_mailbox *mbox);
+void ethosu_rpmsg_mailbox_deinit(struct ethosu_rpmsg_mailbox *mbox);
/**
- * ethosu_mailbox_register() - Register the ethosu_mailbox_msg in ethosu_mailbox
+ * ethosu_rpmsg_mailbox_register() - Register the message in mailbox
*
* Context: Must be called with the device mutex locked
*
* Return: 0 on success, else error code.
*/
-int ethosu_mailbox_register(struct ethosu_mailbox *mbox,
- struct ethosu_mailbox_msg *msg);
+int ethosu_rpmsg_mailbox_register(struct ethosu_rpmsg_mailbox *mbox,
+ struct ethosu_rpmsg_mailbox_msg *msg);
/**
- * ethosu_mailbox_free_id() - Free the id of the ethosu_mailbox_msg
+ * ethosu_rpmsg_mailbox_free_id() - Free the id of the message
*
* Context: Must be called with the device mutex locked
*/
-void ethosu_mailbox_deregister(struct ethosu_mailbox *mbox,
- struct ethosu_mailbox_msg *msg);
+void ethosu_rpmsg_mailbox_deregister(struct ethosu_rpmsg_mailbox *mbox,
+ struct ethosu_rpmsg_mailbox_msg *msg);
/**
- * ethosu_mailbox_find() - Find mailbox message
+ * ethosu_rpmsg_mailbox_find() - Find mailbox message
*
* Context: Must be called with the device mutex locked
*
* Return: a valid pointer on success, otherwise an error ptr.
*/
-struct ethosu_mailbox_msg *ethosu_mailbox_find(struct ethosu_mailbox *mbox,
- int msg_id,
- uint32_t msg_type);
+struct ethosu_rpmsg_mailbox_msg *ethosu_rpmsg_mailbox_find(
+ struct ethosu_rpmsg_mailbox *mbox,
+ int msg_id,
+ uint32_t msg_type);
/**
- * ethosu_mailbox_fail() - Fail mailbox messages
+ * ethosu_rpmsg_mailbox_fail() - Fail mailbox messages
*
* Call fail() callback on all messages in pending list.
*
* Context: Must be called with the device mutex locked
*/
-void ethosu_mailbox_fail(struct ethosu_mailbox *mbox);
+void ethosu_rpmsg_mailbox_fail(struct ethosu_rpmsg_mailbox *mbox);
/**
- * ethosu_mailbox_reset() - Reset to end of queue
+ * ethosu_rpmsg_mailbox_reset() - Reset to end of queue
*/
-void ethosu_mailbox_reset(struct ethosu_mailbox *mbox);
+void ethosu_rpmsg_mailbox_reset(struct ethosu_rpmsg_mailbox *mbox);
/**
- * ethosu_mailbox_ping() - Send ping message
+ * ethosu_rpmsg_mailbox_ping() - Send ping message
*
* Return: 0 on success, else error code.
*/
-int ethosu_mailbox_ping(struct ethosu_mailbox *mbox);
+int ethosu_rpmsg_mailbox_ping(struct ethosu_rpmsg_mailbox *mbox);
/**
- * ethosu_mailbox_pong() - Send pong response
+ * ethosu_rpmsg_mailbox_pong() - Send pong response
*
* Return: 0 on success, else error code.
*/
-int ethosu_mailbox_pong(struct ethosu_mailbox *mbox);
+int ethosu_rpmsg_mailbox_pong(struct ethosu_rpmsg_mailbox *mbox);
/**
- * ethosu_mailbox_version_request() - Send protocol version request
+ * ethosu_rpmsg_mailbox_version_request() - Send protocol version request
*
* Return: 0 on succes, else error code
*/
-int ethosu_mailbox_version_request(struct ethosu_mailbox *mbox,
- struct ethosu_mailbox_msg *msg);
+int ethosu_rpmsg_mailbox_version_request(struct ethosu_rpmsg_mailbox *mbox,
+ struct ethosu_rpmsg_mailbox_msg *msg);
/**
- * ethosu_mailbox_capabilities_request() - Send capabilities request
+ * ethosu_rpmsg_mailbox_capabilities_request() - Send capabilities request
*
* Return: 0 on success, else error code.
*/
-int ethosu_mailbox_capabilities_request(struct ethosu_mailbox *mbox,
- struct ethosu_mailbox_msg *msg);
+int ethosu_rpmsg_mailbox_capabilities_request(struct ethosu_rpmsg_mailbox *mbox,
+ struct ethosu_rpmsg_mailbox_msg *msg);
/**
- * ethosu_mailbox_inference() - Send inference
+ * ethosu_rpmsg_mailbox_inference() - Send inference
*
* Return: 0 on success, else error code.
*/
-int ethosu_mailbox_inference(struct ethosu_mailbox *mbox,
- struct ethosu_mailbox_msg *msg,
- uint32_t ifm_count,
- struct ethosu_buffer **ifm,
- uint32_t ofm_count,
- struct ethosu_buffer **ofm,
- struct ethosu_network *network,
- uint8_t *pmu_event_config,
- uint8_t pmu_event_config_count,
- uint8_t pmu_cycle_counter_enable);
+int ethosu_rpmsg_mailbox_inference(struct ethosu_rpmsg_mailbox *mbox,
+ struct ethosu_rpmsg_mailbox_msg *msg,
+ uint32_t ifm_count,
+ struct ethosu_buffer **ifm,
+ uint32_t ofm_count,
+ struct ethosu_buffer **ofm,
+ struct ethosu_rpmsg_network *network,
+ uint8_t *pmu_event_config,
+ uint8_t pmu_event_config_count,
+ uint8_t pmu_cycle_counter_enable);
/**
- * ethosu_mailbox_network_info_request() - Send network info request
+ * ethosu_rpmsg_mailbox_network_info_request() - Send network info request
*
* Return: 0 on success, else error code.
*/
-int ethosu_mailbox_network_info_request(struct ethosu_mailbox *mbox,
- struct ethosu_mailbox_msg *msg,
- struct ethosu_network *network);
+int ethosu_rpmsg_mailbox_network_info_request(struct ethosu_rpmsg_mailbox *mbox,
+ struct ethosu_rpmsg_mailbox_msg *msg,
+ struct ethosu_rpmsg_network *network);
/**
- * ethosu_mailbox_cancel_inference() - Send inference cancellation
+ * ethosu_rpmsg_mailbox_cancel_inference() - Send inference cancellation
*
* Return: 0 on success, else error code.
*/
-int ethosu_mailbox_cancel_inference(struct ethosu_mailbox *mbox,
- struct ethosu_mailbox_msg *msg,
- int inference_handle);
+int ethosu_rpmsg_mailbox_cancel_inference(struct ethosu_rpmsg_mailbox *mbox,
+ struct ethosu_rpmsg_mailbox_msg *msg,
+ int inference_handle);
-#endif /* ETHOSU_MAILBOX_H */
+#endif /* ETHOSU_RPMSG_MAILBOX_H */
diff --git a/kernel/include/rpmsg/ethosu_rpmsg_network.h b/kernel/include/rpmsg/ethosu_rpmsg_network.h
index 269018a..40819ce 100644
--- a/kernel/include/rpmsg/ethosu_rpmsg_network.h
+++ b/kernel/include/rpmsg/ethosu_rpmsg_network.h
@@ -17,8 +17,8 @@
* http://www.gnu.org/licenses/gpl-2.0.html.
*/
-#ifndef ETHOSU_NETWORK_H
-#define ETHOSU_NETWORK_H
+#ifndef ETHOSU_RPMSG_NETWORK_H
+#define ETHOSU_RPMSG_NETWORK_H
/****************************************************************************
* Includes
@@ -36,13 +36,13 @@ struct ethosu_uapi_network_create;
struct device;
struct file;
-struct ethosu_network {
- struct device *dev;
- struct ethosu_mailbox *mailbox;
- struct file *file;
- struct kref kref;
- struct ethosu_dma_mem *dma_mem;
- uint32_t index;
+struct ethosu_rpmsg_network {
+ struct device *dev;
+ struct ethosu_rpmsg_mailbox *mailbox;
+ struct file *file;
+ struct kref kref;
+ struct ethosu_dma_mem *dma_mem;
+ uint32_t index;
};
/****************************************************************************
@@ -50,35 +50,35 @@ struct ethosu_network {
****************************************************************************/
/**
- * ethosu_network_create() - Create network
+ * ethosu_rpmsg_network_create() - Create network
*
* This function must be called in the context of a user space process.
*
* Return: fd on success, else error code.
*/
-int ethosu_network_create(struct device *dev,
- struct ethosu_mailbox *mailbox,
- struct ethosu_uapi_network_create *uapi);
+int ethosu_rpmsg_network_create(struct device *dev,
+ struct ethosu_rpmsg_mailbox *mailbox,
+ struct ethosu_uapi_network_create *uapi);
/**
- * ethosu_network_get_from_fd() - Get network handle from fd
+ * ethosu_rpmsg_network_get_from_fd() - Get network handle from fd
*
* This function must be called from a user space context.
*
* Return: Pointer on success, else ERR_PTR.
*/
-struct ethosu_network *ethosu_network_get_from_fd(int fd);
+struct ethosu_rpmsg_network *ethosu_rpmsg_network_get_from_fd(int fd);
/**
- * ethosu_network_get() - Get network
+ * ethosu_rpmsg_network_get() - Get network
*/
-void ethosu_network_get(struct ethosu_network *net);
+void ethosu_rpmsg_network_get(struct ethosu_rpmsg_network *net);
/**
- * ethosu_network_put() - Put network
+ * ethosu_rpmsg_network_put() - Put network
*
* Return: 1 if object was removed, else 0.
*/
-int ethosu_network_put(struct ethosu_network *net);
+int ethosu_rpmsg_network_put(struct ethosu_rpmsg_network *net);
-#endif /* ETHOSU_NETWORK_H */
+#endif /* ETHOSU_RPMSG_NETWORK_H */
diff --git a/kernel/include/rpmsg/ethosu_rpmsg_network_info.h b/kernel/include/rpmsg/ethosu_rpmsg_network_info.h
index aaa3733..a5965c0 100644
--- a/kernel/include/rpmsg/ethosu_rpmsg_network_info.h
+++ b/kernel/include/rpmsg/ethosu_rpmsg_network_info.h
@@ -17,8 +17,8 @@
* http://www.gnu.org/licenses/gpl-2.0.html.
*/
-#ifndef ETHOSU_NETWORK_INFO_H
-#define ETHOSU_NETWORK_INFO_H
+#ifndef ETHOSU_RPMSG_NETWORK_INFO_H
+#define ETHOSU_RPMSG_NETWORK_INFO_H
/****************************************************************************
* Includes
@@ -33,17 +33,17 @@
* Types
****************************************************************************/
-struct ethosu_core_msg_network_info_rsp;
-struct ethosu_network;
+struct ethosu_rpmsg_network_info_rsp;
+struct ethosu_rpmsg_network;
struct ethosu_uapi_network_info;
-struct ethosu_network_info {
+struct ethosu_rpmsg_network_info {
struct device *dev;
- struct ethosu_network *net;
+ struct ethosu_rpmsg_network *net;
struct ethosu_uapi_network_info *uapi;
struct completion done;
int errno;
- struct ethosu_mailbox_msg msg;
+ struct ethosu_rpmsg_mailbox_msg msg;
};
/****************************************************************************
@@ -51,22 +51,22 @@ struct ethosu_network_info {
****************************************************************************/
/**
- * ethosu_network_info_request() - Send a network info request
+ * ethosu_rpmsg_network_info_request() - Send a network info request
*
* This function must be called in the context of a user space process.
*
* Return: 0 on success, .
*/
-int ethosu_network_info_request(struct device *dev,
- struct ethosu_mailbox *mailbox,
- struct ethosu_network *net,
- struct ethosu_uapi_network_info *uapi);
+int ethosu_rpmsg_network_info_request(struct device *dev,
+ struct ethosu_rpmsg_mailbox *mailbox,
+ struct ethosu_rpmsg_network *net,
+ struct ethosu_uapi_network_info *uapi);
/**
- * ethosu_network_info_rsp() - Handle network info response.
+ * ethosu_rpmsg_network_info_rsp() - Handle network info response.
*/
-void ethosu_network_info_rsp(struct ethosu_mailbox *mailbox,
- int msg_id,
- struct ethosu_core_msg_network_info_rsp *rsp);
+void ethosu_rpmsg_network_info_rsp(struct ethosu_rpmsg_mailbox *mailbox,
+ int msg_id,
+ struct ethosu_rpmsg_network_info_rsp *rsp);
-#endif /* ETHOSU_NETWORK_INFO_H */
+#endif /* ETHOSU_RPMSG_NETWORK_INFO_H */
diff --git a/kernel/include/rpmsg/ethosu_rpmsg_version.h b/kernel/include/rpmsg/ethosu_rpmsg_version.h
index 755a3d5..aa80835 100644
--- a/kernel/include/rpmsg/ethosu_rpmsg_version.h
+++ b/kernel/include/rpmsg/ethosu_rpmsg_version.h
@@ -17,8 +17,8 @@
* http://www.gnu.org/licenses/gpl-2.0.html.
*/
-#ifndef ETHOSU_VERSION_H
-#define ETHOSU_VERSION_H
+#ifndef ETHOSU_RPMSG_VERSION_H
+#define ETHOSU_RPMSG_VERSION_H
/****************************************************************************
* Includes
@@ -33,27 +33,27 @@
* Types
****************************************************************************/
-struct ethosu_core_msg_version_rsp;
+struct ethosu_rpmsg_version_rsp;
/**
- * struct ethosu_version - Protocol version internal struct
+ * struct ethosu_rpmsg_version - Protocol version internal struct
*/
-struct ethosu_version {
- struct device *dev;
- struct completion done;
- struct ethosu_mailbox_msg msg;
- int errno;
+struct ethosu_rpmsg_version {
+ struct device *dev;
+ struct completion done;
+ struct ethosu_rpmsg_mailbox_msg msg;
+ int errno;
};
/****************************************************************************
* Functions
****************************************************************************/
-void ethosu_version_rsp(struct ethosu_mailbox *mailbox,
- int msg_id,
- struct ethosu_core_msg_version_rsp *rsp);
+void ethosu_rpmsg_version_rsp(struct ethosu_rpmsg_mailbox *mailbox,
+ int msg_id,
+ struct ethosu_rpmsg_version_rsp *rsp);
-int ethosu_version_check_request(struct device *dev,
- struct ethosu_mailbox *mailbox);
+int ethosu_rpmsg_version_check_request(struct device *dev,
+ struct ethosu_rpmsg_mailbox *mailbox);
-#endif /* ETHOSU_VERSION_H */
+#endif /* ETHOSU_RPMSG_VERSION_H */