From: Alison Wang <alison.wang@nxp.com>
To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Cc: leoyang.li@nxp.com, xuelin.shi@nxp.com, xiaofeng.ren@nxp.com,
feng.guo@nxp.com, Alison Wang <alison.wang@nxp.com>
Subject: [PATCH 4/8] ethosu: Add suspend/resume power management
Date: Fri, 16 Jun 2023 13:59:09 +0800 [thread overview]
Message-ID: <20230616055913.2360-5-alison.wang@nxp.com> (raw)
In-Reply-To: <20230616055913.2360-1-alison.wang@nxp.com>
This patch adds suspend and resume power management support. The
corresponding message will be sent to Cortex-M core via RPMsg protocol.
Signed-off-by: Alison Wang <alison.wang@nxp.com>
Signed-off-by: Feng Guo <feng.guo@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
---
drivers/firmware/ethosu/ethosu_buffer.c | 3 ++
.../firmware/ethosu/ethosu_core_interface.h | 14 ++++++++
drivers/firmware/ethosu/ethosu_device.c | 36 +++++++++++++++++++
drivers/firmware/ethosu/ethosu_device.h | 10 ++++++
drivers/firmware/ethosu/ethosu_driver.c | 29 +++++++++++++++
drivers/firmware/ethosu/ethosu_rpmsg.c | 30 ++++++++++++++++
drivers/firmware/ethosu/ethosu_rpmsg.h | 11 ++++++
7 files changed, 133 insertions(+)
diff --git a/drivers/firmware/ethosu/ethosu_buffer.c b/drivers/firmware/ethosu/ethosu_buffer.c
index 43a433355f30..c8aa8031a8de 100644
--- a/drivers/firmware/ethosu/ethosu_buffer.c
+++ b/drivers/firmware/ethosu/ethosu_buffer.c
@@ -222,6 +222,9 @@ int ethosu_buffer_create(struct ethosu_device *edev,
struct ethosu_buffer *buf;
int ret = -ENOMEM;
+ if (!capacity)
+ return -EINVAL;
+
buf = devm_kzalloc(edev->dev, sizeof(*buf), GFP_KERNEL);
if (!buf)
return -ENOMEM;
diff --git a/drivers/firmware/ethosu/ethosu_core_interface.h b/drivers/firmware/ethosu/ethosu_core_interface.h
index b60508e4792f..9267e96aec9b 100644
--- a/drivers/firmware/ethosu/ethosu_core_interface.h
+++ b/drivers/firmware/ethosu/ethosu_core_interface.h
@@ -60,6 +60,8 @@ enum ethosu_core_msg_type {
ETHOSU_CORE_MSG_VERSION_RSP,
ETHOSU_CORE_MSG_CAPABILITIES_REQ,
ETHOSU_CORE_MSG_CAPABILITIES_RSP,
+ ETHOSU_CORE_MSG_POWER_REQ,
+ ETHOSU_CORE_MSG_POWER_RSP,
ETHOSU_CORE_MSG_MAX
};
@@ -161,6 +163,18 @@ struct ethosu_core_msg_capabilities_rsp {
uint32_t custom_dma;
};
+enum ethosu_core_power_req_type {
+ ETHOSU_CORE_POWER_REQ_SUSPEND = 0,
+ ETHOSU_CORE_POWER_REQ_RESUME
+};
+
+/**
+ * struct ethosu_core_power_req - Message power request
+ */
+struct ethosu_core_power_req {
+ enum ethosu_core_power_req_type type;
+};
+
/**
* enum ethosu_core_msg_err_type - Error types
*/
diff --git a/drivers/firmware/ethosu/ethosu_device.c b/drivers/firmware/ethosu/ethosu_device.c
index b2d4737080ac..1627f25c8a95 100644
--- a/drivers/firmware/ethosu/ethosu_device.c
+++ b/drivers/firmware/ethosu/ethosu_device.c
@@ -38,6 +38,7 @@
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/of_reserved_mem.h>
+#include <linux/remoteproc.h>
#include <linux/uaccess.h>
#include <linux/slab.h>
@@ -49,6 +50,8 @@
#define CAPABILITIES_RESP_TIMEOUT_MS 2000
+#define ETHOSU_FIRMWARE_NAME "ethosu_firmware"
+
/****************************************************************************
* Types
****************************************************************************/
@@ -161,6 +164,9 @@ static int ethosu_handle_msg(struct ethosu_device *edev, void *data)
case ETHOSU_CORE_MSG_PONG:
dev_info(edev->dev, "Msg: Pong\n");
break;
+ case ETHOSU_CORE_MSG_POWER_RSP:
+ dev_info(edev->dev, "Msg: Power response\n");
+ break;
case ETHOSU_CORE_MSG_INFERENCE_RSP:
if (header->length != sizeof(struct ethosu_core_inference_rsp)) {
dev_warn(edev->dev,
@@ -243,11 +249,41 @@ static int ethosu_open(struct inode *inode,
{
struct ethosu_device *edev =
container_of(inode->i_cdev, struct ethosu_device, cdev);
+ phandle rproc_phandle;
+ struct rproc *rproc;
+ int ret = 0;
file->private_data = edev;
dev_info(edev->dev, "Opening device node.\n");
+ if (of_property_read_u32(edev->dev->of_node, "fsl,cm33-proc",
+ &rproc_phandle)) {
+ dev_err(edev->dev, "could not get rproc phandle\n");
+ return -ENODEV;
+ }
+
+ rproc = rproc_get_by_phandle(rproc_phandle);
+ if (!rproc) {
+ dev_err(edev->dev, "could not get rproc handle\n");
+ return -EINVAL;
+ }
+
+ ret = rproc_set_firmware(rproc, ETHOSU_FIRMWARE_NAME);
+
+ if (!ret && atomic_read(&rproc->power) == 0) {
+ init_completion(&edev->erp.rpmsg_ready);
+ ret = rproc_boot(rproc);
+ if (ret)
+ dev_err(edev->dev, "could not boot a remote processor\n");
+ else
+ wait_for_completion_interruptible(&edev->erp.rpmsg_ready);
+ } else {
+ dev_err(edev->dev, "can't change firmware or remote processor is running\n");
+ }
+
+ edev->open = true;
+
return nonseekable_open(inode, file);
}
diff --git a/drivers/firmware/ethosu/ethosu_device.h b/drivers/firmware/ethosu/ethosu_device.h
index 3943c8df8f28..da470241b6a1 100644
--- a/drivers/firmware/ethosu/ethosu_device.h
+++ b/drivers/firmware/ethosu/ethosu_device.h
@@ -51,6 +51,7 @@ struct ethosu_device {
struct ethosu_rpmsg erp;
struct list_head capabilities_list;
struct list_head inference_list;
+ bool open;
};
/**
@@ -83,4 +84,13 @@ int ethosu_dev_init(struct ethosu_device *edev,
*/
void ethosu_dev_deinit(struct ethosu_device *edev);
+/**
+ * ethosu_suspend() - Suspend the device
+ */
+int ethosu_suspend(struct device *dev);
+/**
+ * ethosu_resume() - Resume the device
+ */
+int ethosu_resume(struct device *dev);
+
#endif /* ETHOSU_DEVICE_H */
diff --git a/drivers/firmware/ethosu/ethosu_driver.c b/drivers/firmware/ethosu/ethosu_driver.c
index 27931e9aa97c..d3306ef625ae 100644
--- a/drivers/firmware/ethosu/ethosu_driver.c
+++ b/drivers/firmware/ethosu/ethosu_driver.c
@@ -27,6 +27,7 @@
#include <linux/of_address.h>
#include <linux/platform_device.h>
+#include "ethosu_core_interface.h"
#include "ethosu_device.h"
/****************************************************************************
@@ -101,6 +102,33 @@ static int ethosu_pdev_remove(struct platform_device *pdev)
return 0;
}
+int ethosu_suspend(struct device *dev)
+{
+ struct ethosu_device *edev = dev->driver_data;
+ int ret = 0;
+
+ if (edev->open)
+ ret = ethosu_rpmsg_power_request(&edev->erp, ETHOSU_CORE_POWER_REQ_SUSPEND);
+
+ return ret;
+}
+
+int ethosu_resume(struct device *dev)
+{
+ struct ethosu_device *edev = dev->driver_data;
+ int ret = 0;
+
+ if (edev->open)
+ ret = ethosu_rpmsg_power_request(&edev->erp, ETHOSU_CORE_POWER_REQ_RESUME);
+
+ return ret;
+}
+
+struct dev_pm_ops ethosu_pm_ops = {
+ .suspend = ethosu_suspend,
+ .resume = ethosu_resume,
+};
+
static const struct of_device_id ethosu_pdev_match[] = {
{ .compatible = "arm,ethosu" },
{ /* Sentinel */ },
@@ -115,6 +143,7 @@ static struct platform_driver ethosu_pdev_driver = {
.name = ETHOSU_DRIVER_NAME,
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(ethosu_pdev_match),
+ .pm = ðosu_pm_ops,
},
};
diff --git a/drivers/firmware/ethosu/ethosu_rpmsg.c b/drivers/firmware/ethosu/ethosu_rpmsg.c
index e4cf398468e4..a0320b8407d1 100644
--- a/drivers/firmware/ethosu/ethosu_rpmsg.c
+++ b/drivers/firmware/ethosu/ethosu_rpmsg.c
@@ -98,6 +98,35 @@ int ethosu_rpmsg_capabilities_request(struct ethosu_rpmsg *erp, void *user_arg)
return 0;
}
+int ethosu_rpmsg_power_request(struct ethosu_rpmsg *erp,
+ enum ethosu_core_power_req_type power_type)
+{
+ struct ethosu_core_msg msg = {
+ .magic = ETHOSU_CORE_MSG_MAGIC,
+ .type = ETHOSU_CORE_MSG_POWER_REQ,
+ .length = sizeof(struct ethosu_core_power_req)
+ };
+ struct ethosu_core_power_req req;
+ struct rpmsg_device *rpdev = erp->rpdev;
+ uint8_t data[sizeof(struct ethosu_core_msg) +
+ sizeof(struct ethosu_core_power_req)];
+ int ret;
+
+ req.type = power_type;
+ memcpy(data, &msg, sizeof(struct ethosu_core_msg));
+ memcpy(data + sizeof(struct ethosu_core_msg), &req,
+ sizeof(struct ethosu_core_power_req));
+
+ ret = rpmsg_send(rpdev->ept, (void *)&data,
+ sizeof(struct ethosu_core_msg) +
+ sizeof(struct ethosu_core_power_req));
+ if (ret) {
+ dev_err(&rpdev->dev, "rpmsg_send failed: %d\n", ret);
+ return ret;
+ }
+ return 0;
+}
+
int ethosu_rpmsg_inference(struct ethosu_rpmsg *erp,
void *user_arg,
uint32_t ifm_count,
@@ -193,6 +222,7 @@ static int ethosu_rpmsg_probe(struct rpmsg_device *rpdev)
if (ret) {
dev_err(&rpdev->dev, "rpmsg_send failed: %d\n", ret);
}
+ complete(&grp->rpmsg_ready);
return 0;
}
diff --git a/drivers/firmware/ethosu/ethosu_rpmsg.h b/drivers/firmware/ethosu/ethosu_rpmsg.h
index a4a639997a26..cee3d96c7895 100644
--- a/drivers/firmware/ethosu/ethosu_rpmsg.h
+++ b/drivers/firmware/ethosu/ethosu_rpmsg.h
@@ -7,6 +7,8 @@
#define ETHOSU_RPMSG_H
#include <linux/types.h>
+#include <linux/completion.h>
+#include "ethosu_core_interface.h"
struct device;
struct ethosu_buffer;
@@ -19,6 +21,7 @@ struct ethosu_rpmsg {
struct rpmsg_device *rpdev;
ethosu_rpmsg_cb callback;
void *user_arg;
+ struct completion rpmsg_ready;
};
/**
* ethosu_rpmsg_ping() - Send ping message
@@ -49,6 +52,14 @@ int ethosu_rpmsg_version_request(struct ethosu_rpmsg *erp);
int ethosu_rpmsg_capabilities_request(struct ethosu_rpmsg *erp,
void *user_arg);
+/**
+ * ethosu_rpmsg_power_request - Send power request
+ *
+ * Return: 0 on success, else error code
+ */
+int ethosu_rpmsg_power_request(struct ethosu_rpmsg *erp,
+ enum ethosu_core_power_req_type power_type);
+
/**
* ethosu_rpmsg_inference() - Send inference
*
--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Alison Wang <alison.wang@nxp.com>
To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Cc: leoyang.li@nxp.com, xuelin.shi@nxp.com, xiaofeng.ren@nxp.com,
feng.guo@nxp.com, Alison Wang <alison.wang@nxp.com>
Subject: [PATCH 4/8] ethosu: Add suspend/resume power management
Date: Fri, 16 Jun 2023 13:59:09 +0800 [thread overview]
Message-ID: <20230616055913.2360-5-alison.wang@nxp.com> (raw)
In-Reply-To: <20230616055913.2360-1-alison.wang@nxp.com>
This patch adds suspend and resume power management support. The
corresponding message will be sent to Cortex-M core via RPMsg protocol.
Signed-off-by: Alison Wang <alison.wang@nxp.com>
Signed-off-by: Feng Guo <feng.guo@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
---
drivers/firmware/ethosu/ethosu_buffer.c | 3 ++
.../firmware/ethosu/ethosu_core_interface.h | 14 ++++++++
drivers/firmware/ethosu/ethosu_device.c | 36 +++++++++++++++++++
drivers/firmware/ethosu/ethosu_device.h | 10 ++++++
drivers/firmware/ethosu/ethosu_driver.c | 29 +++++++++++++++
drivers/firmware/ethosu/ethosu_rpmsg.c | 30 ++++++++++++++++
drivers/firmware/ethosu/ethosu_rpmsg.h | 11 ++++++
7 files changed, 133 insertions(+)
diff --git a/drivers/firmware/ethosu/ethosu_buffer.c b/drivers/firmware/ethosu/ethosu_buffer.c
index 43a433355f30..c8aa8031a8de 100644
--- a/drivers/firmware/ethosu/ethosu_buffer.c
+++ b/drivers/firmware/ethosu/ethosu_buffer.c
@@ -222,6 +222,9 @@ int ethosu_buffer_create(struct ethosu_device *edev,
struct ethosu_buffer *buf;
int ret = -ENOMEM;
+ if (!capacity)
+ return -EINVAL;
+
buf = devm_kzalloc(edev->dev, sizeof(*buf), GFP_KERNEL);
if (!buf)
return -ENOMEM;
diff --git a/drivers/firmware/ethosu/ethosu_core_interface.h b/drivers/firmware/ethosu/ethosu_core_interface.h
index b60508e4792f..9267e96aec9b 100644
--- a/drivers/firmware/ethosu/ethosu_core_interface.h
+++ b/drivers/firmware/ethosu/ethosu_core_interface.h
@@ -60,6 +60,8 @@ enum ethosu_core_msg_type {
ETHOSU_CORE_MSG_VERSION_RSP,
ETHOSU_CORE_MSG_CAPABILITIES_REQ,
ETHOSU_CORE_MSG_CAPABILITIES_RSP,
+ ETHOSU_CORE_MSG_POWER_REQ,
+ ETHOSU_CORE_MSG_POWER_RSP,
ETHOSU_CORE_MSG_MAX
};
@@ -161,6 +163,18 @@ struct ethosu_core_msg_capabilities_rsp {
uint32_t custom_dma;
};
+enum ethosu_core_power_req_type {
+ ETHOSU_CORE_POWER_REQ_SUSPEND = 0,
+ ETHOSU_CORE_POWER_REQ_RESUME
+};
+
+/**
+ * struct ethosu_core_power_req - Message power request
+ */
+struct ethosu_core_power_req {
+ enum ethosu_core_power_req_type type;
+};
+
/**
* enum ethosu_core_msg_err_type - Error types
*/
diff --git a/drivers/firmware/ethosu/ethosu_device.c b/drivers/firmware/ethosu/ethosu_device.c
index b2d4737080ac..1627f25c8a95 100644
--- a/drivers/firmware/ethosu/ethosu_device.c
+++ b/drivers/firmware/ethosu/ethosu_device.c
@@ -38,6 +38,7 @@
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/of_reserved_mem.h>
+#include <linux/remoteproc.h>
#include <linux/uaccess.h>
#include <linux/slab.h>
@@ -49,6 +50,8 @@
#define CAPABILITIES_RESP_TIMEOUT_MS 2000
+#define ETHOSU_FIRMWARE_NAME "ethosu_firmware"
+
/****************************************************************************
* Types
****************************************************************************/
@@ -161,6 +164,9 @@ static int ethosu_handle_msg(struct ethosu_device *edev, void *data)
case ETHOSU_CORE_MSG_PONG:
dev_info(edev->dev, "Msg: Pong\n");
break;
+ case ETHOSU_CORE_MSG_POWER_RSP:
+ dev_info(edev->dev, "Msg: Power response\n");
+ break;
case ETHOSU_CORE_MSG_INFERENCE_RSP:
if (header->length != sizeof(struct ethosu_core_inference_rsp)) {
dev_warn(edev->dev,
@@ -243,11 +249,41 @@ static int ethosu_open(struct inode *inode,
{
struct ethosu_device *edev =
container_of(inode->i_cdev, struct ethosu_device, cdev);
+ phandle rproc_phandle;
+ struct rproc *rproc;
+ int ret = 0;
file->private_data = edev;
dev_info(edev->dev, "Opening device node.\n");
+ if (of_property_read_u32(edev->dev->of_node, "fsl,cm33-proc",
+ &rproc_phandle)) {
+ dev_err(edev->dev, "could not get rproc phandle\n");
+ return -ENODEV;
+ }
+
+ rproc = rproc_get_by_phandle(rproc_phandle);
+ if (!rproc) {
+ dev_err(edev->dev, "could not get rproc handle\n");
+ return -EINVAL;
+ }
+
+ ret = rproc_set_firmware(rproc, ETHOSU_FIRMWARE_NAME);
+
+ if (!ret && atomic_read(&rproc->power) == 0) {
+ init_completion(&edev->erp.rpmsg_ready);
+ ret = rproc_boot(rproc);
+ if (ret)
+ dev_err(edev->dev, "could not boot a remote processor\n");
+ else
+ wait_for_completion_interruptible(&edev->erp.rpmsg_ready);
+ } else {
+ dev_err(edev->dev, "can't change firmware or remote processor is running\n");
+ }
+
+ edev->open = true;
+
return nonseekable_open(inode, file);
}
diff --git a/drivers/firmware/ethosu/ethosu_device.h b/drivers/firmware/ethosu/ethosu_device.h
index 3943c8df8f28..da470241b6a1 100644
--- a/drivers/firmware/ethosu/ethosu_device.h
+++ b/drivers/firmware/ethosu/ethosu_device.h
@@ -51,6 +51,7 @@ struct ethosu_device {
struct ethosu_rpmsg erp;
struct list_head capabilities_list;
struct list_head inference_list;
+ bool open;
};
/**
@@ -83,4 +84,13 @@ int ethosu_dev_init(struct ethosu_device *edev,
*/
void ethosu_dev_deinit(struct ethosu_device *edev);
+/**
+ * ethosu_suspend() - Suspend the device
+ */
+int ethosu_suspend(struct device *dev);
+/**
+ * ethosu_resume() - Resume the device
+ */
+int ethosu_resume(struct device *dev);
+
#endif /* ETHOSU_DEVICE_H */
diff --git a/drivers/firmware/ethosu/ethosu_driver.c b/drivers/firmware/ethosu/ethosu_driver.c
index 27931e9aa97c..d3306ef625ae 100644
--- a/drivers/firmware/ethosu/ethosu_driver.c
+++ b/drivers/firmware/ethosu/ethosu_driver.c
@@ -27,6 +27,7 @@
#include <linux/of_address.h>
#include <linux/platform_device.h>
+#include "ethosu_core_interface.h"
#include "ethosu_device.h"
/****************************************************************************
@@ -101,6 +102,33 @@ static int ethosu_pdev_remove(struct platform_device *pdev)
return 0;
}
+int ethosu_suspend(struct device *dev)
+{
+ struct ethosu_device *edev = dev->driver_data;
+ int ret = 0;
+
+ if (edev->open)
+ ret = ethosu_rpmsg_power_request(&edev->erp, ETHOSU_CORE_POWER_REQ_SUSPEND);
+
+ return ret;
+}
+
+int ethosu_resume(struct device *dev)
+{
+ struct ethosu_device *edev = dev->driver_data;
+ int ret = 0;
+
+ if (edev->open)
+ ret = ethosu_rpmsg_power_request(&edev->erp, ETHOSU_CORE_POWER_REQ_RESUME);
+
+ return ret;
+}
+
+struct dev_pm_ops ethosu_pm_ops = {
+ .suspend = ethosu_suspend,
+ .resume = ethosu_resume,
+};
+
static const struct of_device_id ethosu_pdev_match[] = {
{ .compatible = "arm,ethosu" },
{ /* Sentinel */ },
@@ -115,6 +143,7 @@ static struct platform_driver ethosu_pdev_driver = {
.name = ETHOSU_DRIVER_NAME,
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(ethosu_pdev_match),
+ .pm = ðosu_pm_ops,
},
};
diff --git a/drivers/firmware/ethosu/ethosu_rpmsg.c b/drivers/firmware/ethosu/ethosu_rpmsg.c
index e4cf398468e4..a0320b8407d1 100644
--- a/drivers/firmware/ethosu/ethosu_rpmsg.c
+++ b/drivers/firmware/ethosu/ethosu_rpmsg.c
@@ -98,6 +98,35 @@ int ethosu_rpmsg_capabilities_request(struct ethosu_rpmsg *erp, void *user_arg)
return 0;
}
+int ethosu_rpmsg_power_request(struct ethosu_rpmsg *erp,
+ enum ethosu_core_power_req_type power_type)
+{
+ struct ethosu_core_msg msg = {
+ .magic = ETHOSU_CORE_MSG_MAGIC,
+ .type = ETHOSU_CORE_MSG_POWER_REQ,
+ .length = sizeof(struct ethosu_core_power_req)
+ };
+ struct ethosu_core_power_req req;
+ struct rpmsg_device *rpdev = erp->rpdev;
+ uint8_t data[sizeof(struct ethosu_core_msg) +
+ sizeof(struct ethosu_core_power_req)];
+ int ret;
+
+ req.type = power_type;
+ memcpy(data, &msg, sizeof(struct ethosu_core_msg));
+ memcpy(data + sizeof(struct ethosu_core_msg), &req,
+ sizeof(struct ethosu_core_power_req));
+
+ ret = rpmsg_send(rpdev->ept, (void *)&data,
+ sizeof(struct ethosu_core_msg) +
+ sizeof(struct ethosu_core_power_req));
+ if (ret) {
+ dev_err(&rpdev->dev, "rpmsg_send failed: %d\n", ret);
+ return ret;
+ }
+ return 0;
+}
+
int ethosu_rpmsg_inference(struct ethosu_rpmsg *erp,
void *user_arg,
uint32_t ifm_count,
@@ -193,6 +222,7 @@ static int ethosu_rpmsg_probe(struct rpmsg_device *rpdev)
if (ret) {
dev_err(&rpdev->dev, "rpmsg_send failed: %d\n", ret);
}
+ complete(&grp->rpmsg_ready);
return 0;
}
diff --git a/drivers/firmware/ethosu/ethosu_rpmsg.h b/drivers/firmware/ethosu/ethosu_rpmsg.h
index a4a639997a26..cee3d96c7895 100644
--- a/drivers/firmware/ethosu/ethosu_rpmsg.h
+++ b/drivers/firmware/ethosu/ethosu_rpmsg.h
@@ -7,6 +7,8 @@
#define ETHOSU_RPMSG_H
#include <linux/types.h>
+#include <linux/completion.h>
+#include "ethosu_core_interface.h"
struct device;
struct ethosu_buffer;
@@ -19,6 +21,7 @@ struct ethosu_rpmsg {
struct rpmsg_device *rpdev;
ethosu_rpmsg_cb callback;
void *user_arg;
+ struct completion rpmsg_ready;
};
/**
* ethosu_rpmsg_ping() - Send ping message
@@ -49,6 +52,14 @@ int ethosu_rpmsg_version_request(struct ethosu_rpmsg *erp);
int ethosu_rpmsg_capabilities_request(struct ethosu_rpmsg *erp,
void *user_arg);
+/**
+ * ethosu_rpmsg_power_request - Send power request
+ *
+ * Return: 0 on success, else error code
+ */
+int ethosu_rpmsg_power_request(struct ethosu_rpmsg *erp,
+ enum ethosu_core_power_req_type power_type);
+
/**
* ethosu_rpmsg_inference() - Send inference
*
--
2.17.1
next prev parent reply other threads:[~2023-06-16 5:43 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-16 5:59 [PATCH 0/8] ethosu: Add Arm Ethos-U driver Alison Wang
2023-06-16 5:59 ` Alison Wang
2023-06-16 5:59 ` [PATCH 1/8] " Alison Wang
2023-06-16 5:59 ` Alison Wang
2023-06-16 6:25 ` Greg KH
2023-06-16 6:25 ` Greg KH
2023-06-16 8:28 ` [EXT] " Alison Wang
2023-06-16 8:28 ` Alison Wang
2023-06-16 15:08 ` Andrew Lunn
2023-06-16 15:08 ` Andrew Lunn
2023-07-06 6:01 ` Alison Wang
2023-07-06 6:01 ` Alison Wang
2023-06-16 6:26 ` Greg KH
2023-06-16 6:26 ` Greg KH
2023-06-16 8:28 ` [EXT] " Alison Wang
2023-06-16 8:28 ` Alison Wang
2023-06-16 10:42 ` kernel test robot
2023-06-16 10:42 ` kernel test robot
2023-06-16 15:49 ` Robin Murphy
2023-06-16 15:49 ` Robin Murphy
2023-06-16 17:16 ` kernel test robot
2023-06-16 17:16 ` kernel test robot
2023-06-24 18:30 ` kernel test robot
2023-06-24 18:30 ` kernel test robot
2023-06-16 5:59 ` [PATCH 2/8] ethosu: Use RPMsg messaging protocol based on i.MX Rpmsg implementation Alison Wang
2023-06-16 5:59 ` Alison Wang
2023-06-16 5:59 ` [PATCH 3/8] ethosu: Add inference type option for model and op Alison Wang
2023-06-16 5:59 ` Alison Wang
2023-06-16 5:59 ` Alison Wang [this message]
2023-06-16 5:59 ` [PATCH 4/8] ethosu: Add suspend/resume power management Alison Wang
2023-06-16 5:59 ` [PATCH 5/8] ethosu: Use ids for identifying messages sent to Ethos-U firmware Alison Wang
2023-06-16 5:59 ` Alison Wang
2023-06-16 5:59 ` [PATCH 6/8] ethosu: Add core message about network info Alison Wang
2023-06-16 5:59 ` Alison Wang
2023-06-16 5:59 ` [PATCH 7/8] ethosu: Add core message about inference cancellation Alison Wang
2023-06-16 5:59 ` Alison Wang
2023-06-16 16:13 ` kernel test robot
2023-06-16 16:13 ` kernel test robot
2023-06-16 5:59 ` [PATCH 8/8] ethosu: Add rwlock when alloc and remove msg id Alison Wang
2023-06-16 5:59 ` Alison Wang
2023-06-16 6:22 ` [PATCH 0/8] ethosu: Add Arm Ethos-U driver Greg KH
2023-06-16 6:22 ` Greg KH
2023-06-16 8:26 ` [EXT] " Alison Wang
2023-06-16 8:26 ` Alison Wang
2023-06-16 9:04 ` Greg KH
2023-06-16 9:04 ` Greg KH
2023-06-16 10:47 ` Alison Wang
2023-06-16 10:47 ` Alison Wang
2023-06-16 11:11 ` Greg KH
2023-06-16 11:11 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230616055913.2360-5-alison.wang@nxp.com \
--to=alison.wang@nxp.com \
--cc=feng.guo@nxp.com \
--cc=gregkh@linuxfoundation.org \
--cc=leoyang.li@nxp.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=xiaofeng.ren@nxp.com \
--cc=xuelin.shi@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.