From d779a08a0f7ca3cdde16941720ddc7af96e74520 Mon Sep 17 00:00:00 2001 From: Kristofer Jonsson Date: Wed, 4 Jan 2023 17:09:47 +0100 Subject: 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 --- kernel/ethosu_mailbox.h | 51 +++++-------------------------------------------- 1 file changed, 5 insertions(+), 46 deletions(-) (limited to 'kernel/ethosu_mailbox.h') 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 #include @@ -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,46 +66,13 @@ 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 */ 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 * -- cgit v1.2.1