From e43c8c26e6ebad3cadabda9d5d4fecba84333078 Mon Sep 17 00:00:00 2001 From: Mikael Olsson Date: Tue, 20 Feb 2024 15:48:47 +0100 Subject: Fix UAPI device type naming and validation The device types in the UAPI have been renamed to follow the UAPI namespacing and driver library validation has been added to ensure the driver library and UAPI device enum values match. The kernel and driver library version have been given a major bump for the introduction of the device type in the capabilities. Change-Id: Ib782b0bd7a8641db88521f8be399f709d2d73816 Signed-off-by: Mikael Olsson --- kernel/include/uapi/ethosu.h | 20 ++++++++++---------- kernel/rpmsg/ethosu_rpmsg_capabilities.c | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'kernel') diff --git a/kernel/include/uapi/ethosu.h b/kernel/include/uapi/ethosu.h index 699ef7e..4311186 100644 --- a/kernel/include/uapi/ethosu.h +++ b/kernel/include/uapi/ethosu.h @@ -67,7 +67,7 @@ namespace EthosU { #define ETHOSU_PMU_EVENT_MAX 8 /* Kernel driver version */ -#define ETHOSU_KERNEL_DRIVER_VERSION_MAJOR 3 +#define ETHOSU_KERNEL_DRIVER_VERSION_MAJOR 4 #define ETHOSU_KERNEL_DRIVER_VERSION_MINOR 0 #define ETHOSU_KERNEL_DRIVER_VERSION_PATCH 0 @@ -194,16 +194,16 @@ 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_uapi_device_type - NPU device type + * @ETHOSU_UAPI_DEVICE_UNKNOWN: Unknown NPU device type + * @ETHOSU_UAPI_DEVICE_SUBSYSTEM: NPU managed by a subsystem communicated with + * via a mailbox + * @ETHOSU_UAPI_DEVICE_DIRECT: NPU directly managed by the kernel driver */ -enum ethosu_dev_type { - ETHOSU_DEV_UNKNOWN = 0, - ETHOSU_DEV_SUBSYSTEM, - ETHOSU_DEV_DIRECT, +enum ethosu_uapi_device_type { + ETHOSU_UAPI_DEVICE_UNKNOWN = 0, + ETHOSU_UAPI_DEVICE_SUBSYSTEM, + ETHOSU_UAPI_DEVICE_DIRECT, }; /** diff --git a/kernel/rpmsg/ethosu_rpmsg_capabilities.c b/kernel/rpmsg/ethosu_rpmsg_capabilities.c index 30a9aef..8d9386e 100644 --- a/kernel/rpmsg/ethosu_rpmsg_capabilities.c +++ b/kernel/rpmsg/ethosu_rpmsg_capabilities.c @@ -97,7 +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->uapi->hw_cfg.type = ETHOSU_UAPI_DEVICE_SUBSYSTEM; cap->errno = 0; complete(&cap->done); -- cgit v1.2.1