aboutsummaryrefslogtreecommitdiff
path: root/kernel/ethosu_mailbox.c
diff options
context:
space:
mode:
authorKristofer Jonsson <kristofer.jonsson@arm.com>2022-03-10 11:17:29 +0100
committerKristofer Jonsson <kristofer.jonsson@arm.com>2022-03-14 11:14:06 +0100
commit3c6a260a705a668b5ff8e8159f04c257273fb458 (patch)
tree3661451b5d0e2675534c290f36c2cf834fc1f4a6 /kernel/ethosu_mailbox.c
parent35de9e63d9c2fe0a557637ac104d7d73382d2d4a (diff)
downloadethos-u-linux-driver-stack-3c6a260a705a668b5ff8e8159f04c257273fb458.tar.gz
Network info
Add UAPI and core message that allows user space space to fetch information about network models built into the firmware. Change-Id: Ic92529bce3edd0a5499e691a566bd065da2a72ad
Diffstat (limited to 'kernel/ethosu_mailbox.c')
-rw-r--r--kernel/ethosu_mailbox.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/kernel/ethosu_mailbox.c b/kernel/ethosu_mailbox.c
index ef9a07d..e3d31fe 100644
--- a/kernel/ethosu_mailbox.c
+++ b/kernel/ethosu_mailbox.c
@@ -275,6 +275,27 @@ int ethosu_mailbox_inference(struct ethosu_mailbox *mbox,
&inf, sizeof(inf));
}
+int ethosu_mailbox_network_info_request(struct ethosu_mailbox *mbox,
+ void *user_arg,
+ struct ethosu_buffer *network,
+ uint32_t network_index)
+{
+ struct ethosu_core_network_info_req info;
+
+ info.user_arg = (ptrdiff_t)user_arg;
+
+ if (network != NULL) {
+ info.network.type = ETHOSU_CORE_NETWORK_BUFFER;
+ ethosu_core_set_size(network, &info.network.buffer);
+ } else {
+ info.network.type = ETHOSU_CORE_NETWORK_INDEX;
+ info.network.index = network_index;
+ }
+
+ return ethosu_queue_write_msg(mbox, ETHOSU_CORE_MSG_NETWORK_INFO_REQ,
+ &info, sizeof(info));
+}
+
static void ethosu_mailbox_rx_work(struct work_struct *work)
{
struct ethosu_mailbox *mbox = container_of(work, typeof(*mbox), work);