diff options
author | Kristofer Jonsson <kristofer.jonsson@arm.com> | 2023-01-04 17:09:47 +0100 |
---|---|---|
committer | Kristofer Jonsson <kristofer.jonsson@arm.com> | 2023-02-02 16:23:59 +0100 |
commit | d779a08a0f7ca3cdde16941720ddc7af96e74520 (patch) | |
tree | 2b05dc35a14f6787568cf92b1ff539afedffecc9 /kernel/ethosu_mailbox.h | |
parent | b42bc0b95dcc5fac60d52e956056fd46bfe2beb9 (diff) | |
download | ethos-u-linux-driver-stack-d779a08a0f7ca3cdde16941720ddc7af96e74520.tar.gz |
Converting Ethos-U driver to rpmsg
The Ethos-U kernel driver has been converted from a
platform driver with a custom firmware interface into a
rpmsg driver.
Change-Id: I9ae449f5e79eb02924e6630611d0893e5fec86be
Diffstat (limited to 'kernel/ethosu_mailbox.h')
-rw-r--r-- | kernel/ethosu_mailbox.h | 51 |
1 files changed, 5 insertions, 46 deletions
diff --git a/kernel/ethosu_mailbox.h b/kernel/ethosu_mailbox.h index c3f5579..edf922b 100644 --- a/kernel/ethosu_mailbox.h +++ b/kernel/ethosu_mailbox.h @@ -24,7 +24,7 @@ /**************************************************************************** * Includes ****************************************************************************/ -#include "ethosu_core_interface.h" +#include "ethosu_core_rpmsg.h" #include <linux/types.h> #include <linux/mailbox_client.h> @@ -45,17 +45,9 @@ struct resource; typedef void (*ethosu_mailbox_cb)(void *user_arg); struct ethosu_mailbox { - struct device *dev; - struct workqueue_struct *wq; - struct work_struct work; - struct ethosu_core_queue __iomem *in_queue; - struct ethosu_core_queue __iomem *out_queue; - struct mbox_client client; - struct mbox_chan *rx; - struct mbox_chan *tx; - ethosu_mailbox_cb callback; - void *user_arg; - struct idr msg_idr; + struct device *dev; + struct rpmsg_endpoint *ept; + struct idr msg_idr; }; struct ethosu_mailbox_msg { @@ -74,10 +66,7 @@ struct ethosu_mailbox_msg { */ int ethosu_mailbox_init(struct ethosu_mailbox *mbox, struct device *dev, - struct resource *in_queue, - struct resource *out_queue, - ethosu_mailbox_cb callback, - void *user_arg); + struct rpmsg_endpoint *ept); /** * ethosu_mailbox_deinit() - Deinitialize mailbox @@ -85,36 +74,6 @@ int ethosu_mailbox_init(struct ethosu_mailbox *mbox, void ethosu_mailbox_deinit(struct ethosu_mailbox *mbox); /** - * ethosu_mailbox_wait_prepare() - Prepare to wait on firmware - * - * This function must only be called when the firmware is in a - * stopped state. It invalidates the firmware queues setting - * size, read and write positions to illegal values. - */ -void ethosu_mailbox_wait_prepare(struct ethosu_mailbox *mbox); - -/** - * ethosu_mailbox_wait_firmware() - Waiting for firmware to initialize - * message queues - * - * Following a call to ethosu_mailbox_wait_prepare() this function waits for - * the firmware to boot up and initialize the firmware queues. - * - * Return: 0 on success, else error code. - */ -int ethosu_mailbox_wait_firmware(struct ethosu_mailbox *mbox); - -/** - * ethosu_mailbox_read() - Read message from mailbox - * - * Return: 0 message read, else error code. - */ -int ethosu_mailbox_read(struct ethosu_mailbox *mbox, - struct ethosu_core_msg *header, - void *data, - size_t length); - -/** * ethosu_mailbox_register() - Register the ethosu_mailbox_msg in ethosu_mailbox * * Return: 0 on success, else error code. |