aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorMikael Olsson <mikael.olsson@arm.com>2024-02-16 11:04:46 +0100
committerMikael Olsson <mikael.olsson@arm.com>2024-02-19 13:27:51 +0100
commitdc18ceaa54957d5ac05292b363a5ac6fe479f409 (patch)
treeb7fae5e1448ef4436e78c0c838f4a07e59ce3039 /kernel
parent16be28550f0906e2bfff20b94dd373f59b4a2ccf (diff)
downloadethos-u-linux-driver-stack-dc18ceaa54957d5ac05292b363a5ac6fe479f409.tar.gz
Add NPU device type to capabilities
In preparation to support the Linux kernel driver directly managing the NPU without a subsystem. A NPU device type has been added to the capabilities to be able to specify what kind of NPU is used. Change-Id: I45345b7d75d234f821d70b858453d3af2a99194e Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/include/uapi/ethosu.h15
-rw-r--r--kernel/rpmsg/ethosu_rpmsg_capabilities.c1
2 files changed, 16 insertions, 0 deletions
diff --git a/kernel/include/uapi/ethosu.h b/kernel/include/uapi/ethosu.h
index 58b9c34..699ef7e 100644
--- a/kernel/include/uapi/ethosu.h
+++ b/kernel/include/uapi/ethosu.h
@@ -194,15 +194,30 @@ struct ethosu_uapi_device_hw_id {
};
/**
+ * enum ethosu_dev_type - NPU device type
+ * @ETHOSU_DEV_UNKNOWN: Unknown NPU device type
+ * @ETHOSU_DEV_SUBSYSTEM: NPU managed by a subsystem communicated with via a
+ * mailbox
+ * @ETHOSU_DEV_DIRECT: NPU directly managed by the kernel driver
+ */
+enum ethosu_dev_type {
+ ETHOSU_DEV_UNKNOWN = 0,
+ ETHOSU_DEV_SUBSYSTEM,
+ ETHOSU_DEV_DIRECT,
+};
+
+/**
* struct ethosu_uapi_device_hw_cfg - Device hardware configuration
* @macs_per_cc: MACs per clock cycle
* @cmd_stream_version: NPU command stream version
* @custom_dma: Custom DMA enabled
+ * @type: NPU device type
*/
struct ethosu_uapi_device_hw_cfg {
__u32 macs_per_cc;
__u32 cmd_stream_version;
__u32 custom_dma;
+ __u32 type;
};
/**
diff --git a/kernel/rpmsg/ethosu_rpmsg_capabilities.c b/kernel/rpmsg/ethosu_rpmsg_capabilities.c
index 3c21d3e..30a9aef 100644
--- a/kernel/rpmsg/ethosu_rpmsg_capabilities.c
+++ b/kernel/rpmsg/ethosu_rpmsg_capabilities.c
@@ -97,6 +97,7 @@ void ethosu_capability_rsp(struct ethosu_rpmsg_mailbox *mailbox,
cap->uapi->hw_cfg.macs_per_cc = rsp->macs_per_cc;
cap->uapi->hw_cfg.cmd_stream_version = rsp->cmd_stream_version;
cap->uapi->hw_cfg.custom_dma = rsp->custom_dma;
+ cap->uapi->hw_cfg.type = ETHOSU_DEV_SUBSYSTEM;
cap->errno = 0;
complete(&cap->done);