1 /* 2 * Copyright (c) 2019-2021 Arm Limited. All rights reserved. 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Licensed under the Apache License, Version 2.0 (the License); you may 7 * not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an AS IS BASIS, WITHOUT 14 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19 #ifndef ETHOSU_TYPES_H 20 #define ETHOSU_TYPES_H 21 22 /****************************************************************************** 23 * Includes 24 ******************************************************************************/ 25 26 #include <stdint.h> 27 28 /****************************************************************************** 29 * Types 30 ******************************************************************************/ 31 32 enum ethosu_error_codes 33 { 34 ETHOSU_SUCCESS = 0, ///< Success 35 ETHOSU_GENERIC_FAILURE = -1, ///< Generic failure 36 ETHOSU_INVALID_PARAM = -2 ///< Invalid parameter 37 }; 38 39 enum ethosu_clock_q_request 40 { 41 ETHOSU_CLOCK_Q_DISABLE = 0, ///< Disable NPU signal ready for clock off. 42 ETHOSU_CLOCK_Q_ENABLE = 1, ///< Enable NPU signal ready for clock off when stop+idle state reached. 43 ETHOSU_CLOCK_Q_UNCHANGED = 2 ///< Keep current clock q setting 44 }; 45 46 enum ethosu_power_q_request 47 { 48 ETHOSU_POWER_Q_DISABLE = 0, ///< Disable NPU signal ready for power off. 49 ETHOSU_POWER_Q_ENABLE = 1, ///< Enable NPU signal ready for power off when stop+idle state reached. 50 ETHOSU_POWER_Q_UNCHANGED = 2 ///< Keep current power q setting 51 }; 52 53 struct ethosu_id 54 { 55 uint32_t version_status; ///< Version status 56 uint32_t version_minor; ///< Version minor 57 uint32_t version_major; ///< Version major 58 uint32_t product_major; ///< Product major 59 uint32_t arch_patch_rev; ///< Architecture version patch 60 uint32_t arch_minor_rev; ///< Architecture version minor 61 uint32_t arch_major_rev; ///< Architecture version major 62 }; 63 64 struct ethosu_config 65 { 66 uint32_t macs_per_cc; ///< MACs per clock cycle 67 uint32_t cmd_stream_version; ///< NPU command stream version 68 uint32_t custom_dma; ///< Custom DMA enabled 69 }; 70 71 struct ethosu_hw_info 72 { 73 struct ethosu_id version; 74 struct ethosu_config cfg; 75 }; 76 #endif // ETHOSU_TYPES_H 77