From 40e23d12017ba8aa40bb15c9214cd7ac531a159e Mon Sep 17 00:00:00 2001 From: Davide Grohmann Date: Thu, 17 Jun 2021 09:59:40 +0200 Subject: Do not expose device specific hw config in capabilities Change-Id: Ia90e2d74c3e071c6e3de381cfada9a5a155d7529 --- driver_library/include/ethosu.hpp | 10 ++-------- driver_library/src/ethosu.cpp | 5 +---- kernel/ethosu_core_interface.h | 1 - kernel/ethosu_device.c | 4 +--- kernel/uapi/ethosu.h | 2 -- utils/inference_runner/inference_runner.cpp | 1 - 6 files changed, 4 insertions(+), 19 deletions(-) diff --git a/driver_library/include/ethosu.hpp b/driver_library/include/ethosu.hpp index d3f7421..d70ec95 100644 --- a/driver_library/include/ethosu.hpp +++ b/driver_library/include/ethosu.hpp @@ -98,21 +98,15 @@ public: * Hardware Configuration * @macsPerClockCycle: MACs per clock cycle * @cmdStreamVersion: NPU command stream version - * @shramSize: SHRAM size * @customDma: Custom DMA enabled */ struct HardwareConfiguration { public: - HardwareConfiguration(uint32_t _macsPerClockCycle, - uint32_t _cmdStreamVersion, - uint32_t _shramSize, - bool _customDma) : - macsPerClockCycle(_macsPerClockCycle), - cmdStreamVersion(_cmdStreamVersion), shramSize(_shramSize), customDma(_customDma) {} + HardwareConfiguration(uint32_t _macsPerClockCycle, uint32_t _cmdStreamVersion, bool _customDma) : + macsPerClockCycle(_macsPerClockCycle), cmdStreamVersion(_cmdStreamVersion), customDma(_customDma) {} uint32_t macsPerClockCycle; uint32_t cmdStreamVersion; - uint32_t shramSize; bool customDma; }; diff --git a/driver_library/src/ethosu.cpp b/driver_library/src/ethosu.cpp index ea1f7f4..997e12a 100644 --- a/driver_library/src/ethosu.cpp +++ b/driver_library/src/ethosu.cpp @@ -176,10 +176,7 @@ Capabilities Device::capabilities() { SemanticVersion(uapi.hw_id.version_major, uapi.hw_id.version_minor), SemanticVersion(uapi.hw_id.product_major), SemanticVersion(uapi.hw_id.arch_major_rev, uapi.hw_id.arch_minor_rev, uapi.hw_id.arch_patch_rev)), - HardwareConfiguration(uapi.hw_cfg.macs_per_cc, - uapi.hw_cfg.cmd_stream_version, - uapi.hw_cfg.shram_size, - bool(uapi.hw_cfg.custom_dma)), + HardwareConfiguration(uapi.hw_cfg.macs_per_cc, uapi.hw_cfg.cmd_stream_version, bool(uapi.hw_cfg.custom_dma)), SemanticVersion(uapi.driver_major_rev, uapi.driver_minor_rev, uapi.driver_patch_rev)); return capabilities; } diff --git a/kernel/ethosu_core_interface.h b/kernel/ethosu_core_interface.h index ad8311c..d5bcb54 100644 --- a/kernel/ethosu_core_interface.h +++ b/kernel/ethosu_core_interface.h @@ -154,7 +154,6 @@ struct ethosu_core_msg_capabilities_rsp { uint32_t driver_major_rev; uint32_t macs_per_cc; uint32_t cmd_stream_version; - uint32_t shram_size; uint32_t custom_dma; }; diff --git a/kernel/ethosu_device.c b/kernel/ethosu_device.c index 7adc7a6..7617669 100644 --- a/kernel/ethosu_device.c +++ b/kernel/ethosu_device.c @@ -113,7 +113,6 @@ static int ethosu_capability_rsp(struct ethosu_device *edev, capabilities->driver_major_rev = msg->driver_major_rev; capabilities->hw_cfg.macs_per_cc = msg->macs_per_cc; capabilities->hw_cfg.cmd_stream_version = msg->cmd_stream_version; - capabilities->hw_cfg.shram_size = msg->shram_size; capabilities->hw_cfg.custom_dma = msg->custom_dma; complete(&cap->done); @@ -212,7 +211,7 @@ static int ethosu_handle_msg(struct ethosu_device *edev) } dev_info(edev->dev, - "Msg: Capabilities response ua%llx vs%hhu v%hhu.%hhu p%hhu av%hhu.%hhu.%hhu dv%hhu.%hhu.%hhu mcc%hhu csv%hhu ss%hhu cd%hhu\n", + "Msg: Capabilities response ua%llx vs%hhu v%hhu.%hhu p%hhu av%hhu.%hhu.%hhu dv%hhu.%hhu.%hhu mcc%hhu csv%hhu cd%hhu\n", data.capabilities.user_arg, data.capabilities.version_status, data.capabilities.version_major, @@ -226,7 +225,6 @@ static int ethosu_handle_msg(struct ethosu_device *edev) data.capabilities.driver_patch_rev, data.capabilities.macs_per_cc, data.capabilities.cmd_stream_version, - data.capabilities.shram_size, data.capabilities.custom_dma); ret = ethosu_capability_rsp(edev, &data.capabilities); diff --git a/kernel/uapi/ethosu.h b/kernel/uapi/ethosu.h index 3e4e7a3..3c0a983 100644 --- a/kernel/uapi/ethosu.h +++ b/kernel/uapi/ethosu.h @@ -149,13 +149,11 @@ struct ethosu_uapi_device_hw_id { * struct ethosu_uapi_device_hw_cfg - Device hardware configuration * @macs_per_cc: MACs per clock cycle * @cmd_stream_version: NPU command stream version - * @shram_size: SHRAM size * @custom_dma: Custom DMA enabled */ struct ethosu_uapi_device_hw_cfg { __u32 macs_per_cc; __u32 cmd_stream_version; - __u32 shram_size; __u32 custom_dma; }; diff --git a/utils/inference_runner/inference_runner.cpp b/utils/inference_runner/inference_runner.cpp index f2e1fa1..e8c4144 100644 --- a/utils/inference_runner/inference_runner.cpp +++ b/utils/inference_runner/inference_runner.cpp @@ -224,7 +224,6 @@ int main(int argc, char *argv[]) { << "\tdriver:" << capabilities.driver << endl << "\tmacs_per_cc:" << unsigned(capabilities.hwCfg.macsPerClockCycle) << endl << "\tcmd_stream_version:" << unsigned(capabilities.hwCfg.cmdStreamVersion) << endl - << "\tshram_size:" << unsigned(capabilities.hwCfg.shramSize) << endl << "\tcustom_dma:" << std::boolalpha << capabilities.hwCfg.customDma << endl; /* Create network */ -- cgit v1.2.1