Lines Matching +full:use +full:- +full:internal +full:- +full:clock
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
3 * Copyright 2016-2020 HabanaLabs, Ltd.
15 * Defines that are asic-specific but constitutes as ABI between kernel driver
26 * The external queues (PCI DMA channels) MUST be before the internal queues
27 * and each group (PCI DMA channels and internal) must be contiguous inside
39 GOYA_QUEUE_ID_MME = 6, /* Internal queues start here */
54 * Except one CPU queue, all the rest are internal queues.
67 GAUDI_QUEUE_ID_DMA_2_0 = 9, /* internal */
68 GAUDI_QUEUE_ID_DMA_2_1 = 10, /* internal */
69 GAUDI_QUEUE_ID_DMA_2_2 = 11, /* internal */
70 GAUDI_QUEUE_ID_DMA_2_3 = 12, /* internal */
71 GAUDI_QUEUE_ID_DMA_3_0 = 13, /* internal */
72 GAUDI_QUEUE_ID_DMA_3_1 = 14, /* internal */
73 GAUDI_QUEUE_ID_DMA_3_2 = 15, /* internal */
74 GAUDI_QUEUE_ID_DMA_3_3 = 16, /* internal */
75 GAUDI_QUEUE_ID_DMA_4_0 = 17, /* internal */
76 GAUDI_QUEUE_ID_DMA_4_1 = 18, /* internal */
77 GAUDI_QUEUE_ID_DMA_4_2 = 19, /* internal */
78 GAUDI_QUEUE_ID_DMA_4_3 = 20, /* internal */
83 GAUDI_QUEUE_ID_DMA_6_0 = 25, /* internal */
84 GAUDI_QUEUE_ID_DMA_6_1 = 26, /* internal */
85 GAUDI_QUEUE_ID_DMA_6_2 = 27, /* internal */
86 GAUDI_QUEUE_ID_DMA_6_3 = 28, /* internal */
87 GAUDI_QUEUE_ID_DMA_7_0 = 29, /* internal */
88 GAUDI_QUEUE_ID_DMA_7_1 = 30, /* internal */
89 GAUDI_QUEUE_ID_DMA_7_2 = 31, /* internal */
90 GAUDI_QUEUE_ID_DMA_7_3 = 32, /* internal */
91 GAUDI_QUEUE_ID_MME_0_0 = 33, /* internal */
92 GAUDI_QUEUE_ID_MME_0_1 = 34, /* internal */
93 GAUDI_QUEUE_ID_MME_0_2 = 35, /* internal */
94 GAUDI_QUEUE_ID_MME_0_3 = 36, /* internal */
95 GAUDI_QUEUE_ID_MME_1_0 = 37, /* internal */
96 GAUDI_QUEUE_ID_MME_1_1 = 38, /* internal */
97 GAUDI_QUEUE_ID_MME_1_2 = 39, /* internal */
98 GAUDI_QUEUE_ID_MME_1_3 = 40, /* internal */
99 GAUDI_QUEUE_ID_TPC_0_0 = 41, /* internal */
100 GAUDI_QUEUE_ID_TPC_0_1 = 42, /* internal */
101 GAUDI_QUEUE_ID_TPC_0_2 = 43, /* internal */
102 GAUDI_QUEUE_ID_TPC_0_3 = 44, /* internal */
103 GAUDI_QUEUE_ID_TPC_1_0 = 45, /* internal */
104 GAUDI_QUEUE_ID_TPC_1_1 = 46, /* internal */
105 GAUDI_QUEUE_ID_TPC_1_2 = 47, /* internal */
106 GAUDI_QUEUE_ID_TPC_1_3 = 48, /* internal */
107 GAUDI_QUEUE_ID_TPC_2_0 = 49, /* internal */
108 GAUDI_QUEUE_ID_TPC_2_1 = 50, /* internal */
109 GAUDI_QUEUE_ID_TPC_2_2 = 51, /* internal */
110 GAUDI_QUEUE_ID_TPC_2_3 = 52, /* internal */
111 GAUDI_QUEUE_ID_TPC_3_0 = 53, /* internal */
112 GAUDI_QUEUE_ID_TPC_3_1 = 54, /* internal */
113 GAUDI_QUEUE_ID_TPC_3_2 = 55, /* internal */
114 GAUDI_QUEUE_ID_TPC_3_3 = 56, /* internal */
115 GAUDI_QUEUE_ID_TPC_4_0 = 57, /* internal */
116 GAUDI_QUEUE_ID_TPC_4_1 = 58, /* internal */
117 GAUDI_QUEUE_ID_TPC_4_2 = 59, /* internal */
118 GAUDI_QUEUE_ID_TPC_4_3 = 60, /* internal */
119 GAUDI_QUEUE_ID_TPC_5_0 = 61, /* internal */
120 GAUDI_QUEUE_ID_TPC_5_1 = 62, /* internal */
121 GAUDI_QUEUE_ID_TPC_5_2 = 63, /* internal */
122 GAUDI_QUEUE_ID_TPC_5_3 = 64, /* internal */
123 GAUDI_QUEUE_ID_TPC_6_0 = 65, /* internal */
124 GAUDI_QUEUE_ID_TPC_6_1 = 66, /* internal */
125 GAUDI_QUEUE_ID_TPC_6_2 = 67, /* internal */
126 GAUDI_QUEUE_ID_TPC_6_3 = 68, /* internal */
127 GAUDI_QUEUE_ID_TPC_7_0 = 69, /* internal */
128 GAUDI_QUEUE_ID_TPC_7_1 = 70, /* internal */
129 GAUDI_QUEUE_ID_TPC_7_2 = 71, /* internal */
130 GAUDI_QUEUE_ID_TPC_7_3 = 72, /* internal */
131 GAUDI_QUEUE_ID_NIC_0_0 = 73, /* internal */
132 GAUDI_QUEUE_ID_NIC_0_1 = 74, /* internal */
133 GAUDI_QUEUE_ID_NIC_0_2 = 75, /* internal */
134 GAUDI_QUEUE_ID_NIC_0_3 = 76, /* internal */
135 GAUDI_QUEUE_ID_NIC_1_0 = 77, /* internal */
136 GAUDI_QUEUE_ID_NIC_1_1 = 78, /* internal */
137 GAUDI_QUEUE_ID_NIC_1_2 = 79, /* internal */
138 GAUDI_QUEUE_ID_NIC_1_3 = 80, /* internal */
139 GAUDI_QUEUE_ID_NIC_2_0 = 81, /* internal */
140 GAUDI_QUEUE_ID_NIC_2_1 = 82, /* internal */
141 GAUDI_QUEUE_ID_NIC_2_2 = 83, /* internal */
142 GAUDI_QUEUE_ID_NIC_2_3 = 84, /* internal */
143 GAUDI_QUEUE_ID_NIC_3_0 = 85, /* internal */
144 GAUDI_QUEUE_ID_NIC_3_1 = 86, /* internal */
145 GAUDI_QUEUE_ID_NIC_3_2 = 87, /* internal */
146 GAUDI_QUEUE_ID_NIC_3_3 = 88, /* internal */
147 GAUDI_QUEUE_ID_NIC_4_0 = 89, /* internal */
148 GAUDI_QUEUE_ID_NIC_4_1 = 90, /* internal */
149 GAUDI_QUEUE_ID_NIC_4_2 = 91, /* internal */
150 GAUDI_QUEUE_ID_NIC_4_3 = 92, /* internal */
151 GAUDI_QUEUE_ID_NIC_5_0 = 93, /* internal */
152 GAUDI_QUEUE_ID_NIC_5_1 = 94, /* internal */
153 GAUDI_QUEUE_ID_NIC_5_2 = 95, /* internal */
154 GAUDI_QUEUE_ID_NIC_5_3 = 96, /* internal */
155 GAUDI_QUEUE_ID_NIC_6_0 = 97, /* internal */
156 GAUDI_QUEUE_ID_NIC_6_1 = 98, /* internal */
157 GAUDI_QUEUE_ID_NIC_6_2 = 99, /* internal */
158 GAUDI_QUEUE_ID_NIC_6_3 = 100, /* internal */
159 GAUDI_QUEUE_ID_NIC_7_0 = 101, /* internal */
160 GAUDI_QUEUE_ID_NIC_7_1 = 102, /* internal */
161 GAUDI_QUEUE_ID_NIC_7_2 = 103, /* internal */
162 GAUDI_QUEUE_ID_NIC_7_3 = 104, /* internal */
163 GAUDI_QUEUE_ID_NIC_8_0 = 105, /* internal */
164 GAUDI_QUEUE_ID_NIC_8_1 = 106, /* internal */
165 GAUDI_QUEUE_ID_NIC_8_2 = 107, /* internal */
166 GAUDI_QUEUE_ID_NIC_8_3 = 108, /* internal */
167 GAUDI_QUEUE_ID_NIC_9_0 = 109, /* internal */
168 GAUDI_QUEUE_ID_NIC_9_1 = 110, /* internal */
169 GAUDI_QUEUE_ID_NIC_9_2 = 111, /* internal */
170 GAUDI_QUEUE_ID_NIC_9_3 = 112, /* internal */
240 * HW_IP_INFO - Receive information about different IP blocks in the
242 * HL_INFO_HW_EVENTS - Receive an array describing how many times each event
244 * HL_INFO_DRAM_USAGE - Retrieve the dram usage inside the device and of the
247 * HL_INFO_HW_IDLE - Retrieve information about the idle status of each
248 * internal engine.
249 * HL_INFO_DEVICE_STATUS - Retrieve the device's status. This opcode doesn't
251 * HL_INFO_DEVICE_UTILIZATION - Retrieve the total utilization of the device
256 * HL_INFO_HW_EVENTS_AGGREGATE - Receive an array describing how many times each
258 * HL_INFO_CLK_RATE - Retrieve the current and maximum clock rate
259 * of the device in MHz. The maximum clock rate is
261 * HL_INFO_RESET_COUNT - Retrieve the counts of the soft and hard reset
264 * HL_INFO_TIME_SYNC - Retrieve the device's time alongside the host's time
266 * HL_INFO_CS_COUNTERS - Retrieve command submission counters
267 * HL_INFO_PCI_COUNTERS - Retrieve PCI counters
268 * HL_INFO_CLK_THROTTLE_REASON - Retrieve clock throttling reason
269 * HL_INFO_SYNC_MANAGER - Retrieve sync manager info per dcore
270 * HL_INFO_TOTAL_ENERGY - Retrieve total energy consumption
358 * struct hl_info_pci_counters - pci counters
373 * struct hl_info_clk_throttle - clock throttling reason
381 * struct hl_info_energy - device energy information
389 * struct hl_info_sync_manager - sync manager information
399 * struct hl_info_cs_counters - command submission counters
404 * @max_cs_in_flight_drop_cnt: dropped due to maximum CS in-flight
446 /* Context ID - Currently not in use */
448 /* Period value for utilization rate (100ms - 1000ms, in 100ms
463 #define HL_MAX_CB_SIZE (0x200000 - 32)
477 /* Context ID - Currently not in use */
494 * This structure size must always be fixed to 64-bytes for backward
501 * For internal queue in Goya, this represents an SRAM or
502 * a DRAM address of the internal CB. In Gaudi, this might also
558 /* this holds address of array of hl_cs_chunk for store phase -
559 * Currently not in use
573 /* Number of chunks in restore phase array - Currently not in use */
579 /* Context ID - Currently not in use */
604 /* Context ID - Currently not in use */
642 /* HL_MEM_OP_ALLOC- allocate device memory */
648 /* HL_MEM_OP_FREE - free device memory */
654 /* HL_MEM_OP_MAP - map device memory */
670 /* HL_MEM_OP_MAP - map host memory */
688 /* HL_MEM_OP_UNMAP - unmap host memory */
699 /* Context ID - Currently not in use */
830 /* Context ID - Currently not in use */
836 * - H/W IP information
837 * - Current dram usage
840 * information. The user should supply a pointer to a user-allocated memory
853 * - Request a Command Buffer
854 * - Destroy a Command Buffer
856 * The command buffers are memory blocks that reside in DMA-able address
860 * When creating a new CB, the IOCTL returns a handle of it, and the user-space
861 * process needs to use that handle to mmap the buffer so it can access them.
883 * The JOBS on the "restore" phase are enqueued only after context-switch
887 * There are two types of queues - external and internal. External queues
889 * internal. The driver will get completion notifications from the device only
894 * internal queues, the user needs to prepare a "command buffer" with packets
904 * can use with the "Wait for CS" IOCTL to check whether the handle's CS
905 * external JOBS have been completed. Note that if the CS has internal JOBS
907 * report that the CS has finished executing BEFORE the internal JOBS have
912 * with sequence number N-1 also finished. The user can make this assumption if
913 * and only if CS N and CS N-1 are exactly the same (same CBs for the same
924 * inside the kernel until the CS has finished or until the user-requested
933 * EINTR - Kernel waiting has been interrupted, e.g. due to OS signal
935 * ETIMEDOUT - The CS has caused a timeout on the device
936 * EIO - The CS was aborted (usually because the device was reset)
937 * ENODEV - The device wants to do hard-reset (so user need to close FD)
941 * HL_WAIT_CS_STATUS_COMPLETED - The CS has been completed successfully (0)
942 * HL_WAIT_CS_STATUS_BUSY - The CS is still executing (0)
943 * HL_WAIT_CS_STATUS_TIMEDOUT - The CS has caused a timeout on the device
945 * HL_WAIT_CS_STATUS_ABORTED - The CS was aborted, usually because the
947 * HL_WAIT_CS_STATUS_INTERRUPTED - Waiting for the CS was interrupted (EINTR)
956 * - Map host memory to device MMU
957 * - Unmap host memory from device MMU
962 * to allocate the memory in user-space (malloc/new). The driver pins the
974 * - Enable/disable the ETR/ETF/FUNNEL/STM/BMON/SPMU debug traces
991 * set the device into non-debug mode, i.e. disable debug mode.