diff options
-rw-r--r-- | driver_library/include/ethosu.hpp | 6 | ||||
-rw-r--r-- | driver_library/src/ethosu.cpp | 5 | ||||
-rw-r--r-- | kernel/include/uapi/ethosu.h | 20 | ||||
-rw-r--r-- | kernel/rpmsg/ethosu_rpmsg_capabilities.c | 2 |
4 files changed, 19 insertions, 14 deletions
diff --git a/driver_library/include/ethosu.hpp b/driver_library/include/ethosu.hpp index d0e391c..fe43689 100644 --- a/driver_library/include/ethosu.hpp +++ b/driver_library/include/ethosu.hpp @@ -39,12 +39,12 @@ namespace EthosU { -constexpr uint32_t DRIVER_LIBRARY_VERSION_MAJOR = 3; +constexpr uint32_t DRIVER_LIBRARY_VERSION_MAJOR = 4; constexpr uint32_t DRIVER_LIBRARY_VERSION_MINOR = 0; constexpr uint32_t DRIVER_LIBRARY_VERSION_PATCH = 0; -constexpr uint32_t MAX_SUPPORTED_KERNEL_DRIVER_MAJOR_VERSION = 3; -constexpr uint32_t MIN_SUPPORTED_KERNEL_DRIVER_MAJOR_VERSION = 3; +constexpr uint32_t MAX_SUPPORTED_KERNEL_DRIVER_MAJOR_VERSION = 4; +constexpr uint32_t MIN_SUPPORTED_KERNEL_DRIVER_MAJOR_VERSION = 4; class Exception : public std::exception { public: diff --git a/driver_library/src/ethosu.cpp b/driver_library/src/ethosu.cpp index 0166f0a..c00f69f 100644 --- a/driver_library/src/ethosu.cpp +++ b/driver_library/src/ethosu.cpp @@ -288,6 +288,11 @@ ostream &operator<<(ostream &out, const HardwareConfiguration::DeviceType &devic } } +static_assert(static_cast<uint32_t>(HardwareConfiguration::DeviceType::UNKNOWN) == ETHOSU_UAPI_DEVICE_UNKNOWN && + static_cast<uint32_t>(HardwareConfiguration::DeviceType::SUBSYSTEM) == ETHOSU_UAPI_DEVICE_SUBSYSTEM && + static_cast<uint32_t>(HardwareConfiguration::DeviceType::DIRECT) == ETHOSU_UAPI_DEVICE_DIRECT, + "DeviceType enums values doesn't match UAPI"); + /**************************************************************************** * Buffer ****************************************************************************/ 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); |