Lines Matching +full:cs +full:- +full:number

1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
3 * Copyright 2016-2023 HabanaLabs, Ltd.
14 * Defines that are asic-specific but constitutes as ABI between kernel driver
32 /* Max number of elements in timestamps registration buffers */
195 * stream id is a running number from 0 up to (N-1), where N is the number
656 * enum hl_goya_dma_direction - Direction of DMA operation inside a LIN_DMA packet that is
668 * @HL_DMA_ENUM_MAX: number of values in enum
683 * enum hl_device_status - Device status information.
715 * Notifier event values - for the notification mechanism and the HL_INFO_GET_EVENTS command
717 * HL_NOTIFIER_EVENT_TPC_ASSERT - Indicates TPC assert event
718 * HL_NOTIFIER_EVENT_UNDEFINED_OPCODE - Indicates undefined operation code
719 * HL_NOTIFIER_EVENT_DEVICE_RESET - Indicates device requires a reset
720 * HL_NOTIFIER_EVENT_CS_TIMEOUT - Indicates CS timeout error
721 * HL_NOTIFIER_EVENT_DEVICE_UNAVAILABLE - Indicates device is unavailable
722 * HL_NOTIFIER_EVENT_USER_ENGINE_ERR - Indicates device engine in error state
723 * HL_NOTIFIER_EVENT_GENERAL_HW_ERR - Indicates device HW error
724 * HL_NOTIFIER_EVENT_RAZWI - Indicates razwi happened
725 * HL_NOTIFIER_EVENT_PAGE_FAULT - Indicates page fault happened
726 * HL_NOTIFIER_EVENT_CRITICAL_HW_ERR - Indicates a HW error that requires SW abort and
728 * HL_NOTIFIER_EVENT_CRITICAL_FW_ERR - Indicates a FW error that requires SW abort and
745 * HW_IP_INFO - Receive information about different IP blocks in the
747 * HL_INFO_HW_EVENTS - Receive an array describing how many times each event
749 * HL_INFO_DRAM_USAGE - Retrieve the dram usage inside the device and of the
752 * HL_INFO_HW_IDLE - Retrieve information about the idle status of each
754 * HL_INFO_DEVICE_STATUS - Retrieve the device's status. This opcode doesn't
756 * HL_INFO_DEVICE_UTILIZATION - Retrieve the total utilization of the device
761 * HL_INFO_HW_EVENTS_AGGREGATE - Receive an array describing how many times each
763 * HL_INFO_CLK_RATE - Retrieve the current and maximum clock rate
766 * HL_INFO_RESET_COUNT - Retrieve the counts of the soft and hard reset
769 * HL_INFO_TIME_SYNC - Retrieve the device's time alongside the host's time
771 * HL_INFO_CS_COUNTERS - Retrieve command submission counters
772 * HL_INFO_PCI_COUNTERS - Retrieve PCI counters
773 * HL_INFO_CLK_THROTTLE_REASON - Retrieve clock throttling reason
774 * HL_INFO_SYNC_MANAGER - Retrieve sync manager info per dcore
775 * HL_INFO_TOTAL_ENERGY - Retrieve total energy consumption
776 * HL_INFO_PLL_FREQUENCY - Retrieve PLL frequency
777 * HL_INFO_POWER - Retrieve power information
778 * HL_INFO_OPEN_STATS - Retrieve info regarding recent device open calls
779 * HL_INFO_DRAM_REPLACED_ROWS - Retrieve DRAM replaced rows info
780 * HL_INFO_DRAM_PENDING_ROWS - Retrieve DRAM pending rows num
781 * HL_INFO_LAST_ERR_OPEN_DEV_TIME - Retrieve timestamp of the last time the device was opened
782 * and CS timeout or razwi error occurred.
783 * HL_INFO_CS_TIMEOUT_EVENT - Retrieve CS timeout timestamp and its related CS sequence number.
784 * HL_INFO_RAZWI_EVENT - Retrieve parameters of razwi:
791 * HL_INFO_DEV_MEM_ALLOC_PAGE_SIZES - Retrieve valid page sizes for device memory allocation
792 * HL_INFO_SECURED_ATTESTATION - Retrieve attestation report of the boot.
793 * HL_INFO_REGISTER_EVENTFD - Register eventfd for event notifications.
794 * HL_INFO_UNREGISTER_EVENTFD - Unregister eventfd
795 * HL_INFO_GET_EVENTS - Retrieve the last occurred events
796 * HL_INFO_UNDEFINED_OPCODE_EVENT - Retrieve last undefined opcode error information.
799 * HL_INFO_ENGINE_STATUS - Retrieve the status of all the h/w engines in the asic.
800 * HL_INFO_PAGE_FAULT_EVENT - Retrieve parameters of captured page fault.
803 * HL_INFO_USER_MAPPINGS - Retrieve user mappings, captured after page fault event.
804 * HL_INFO_FW_GENERIC_REQ - Send generic request to FW.
805 * HL_INFO_HW_ERR_EVENT - Retrieve information on the reported HW error.
808 * HL_INFO_FW_ERR_EVENT - Retrieve information on the reported FW error.
811 * HL_INFO_USER_ENGINE_ERR_EVENT - Retrieve the last engine id that reported an error.
858 * struct hl_info_hw_ip_info - hardware information on various IPs in the ASIC
865 * @num_of_events: The number of events that can be received from the f/w. This
872 * @decoder_enabled_mask: Bit-mask that represents which decoders are enabled.
884 * @tpc_enabled_mask: Bit-mask that represents which TPCs are enabled. Relevant
892 * @tpc_enabled_mask_ext: Bit-mask that represents which TPCs are enabled.
895 * @edma_enabled_mask: Bit-mask that represents which EDMAs are enabled.
897 * @number_of_user_interrupts: The number of interrupts that are available to the userspace
902 * @rotator_enabled_mask: Bit-mask that represents which rotators are enabled.
999 * struct hl_info_pci_counters - pci counters
1021 * struct hl_info_clk_throttle - clock throttling reason
1023 * @clk_throttling_timestamp_us: represents CPU timestamp in microseconds of the start-event
1034 * struct hl_info_energy - device energy information
1048 * struct hl_open_stats_info - device open statistics information
1063 * struct hl_power_info - power information
1071 * struct hl_info_sync_manager - sync manager information
1084 * struct hl_info_cs_counters - command submission counters
1093 * @total_max_cs_in_flight_drop_cnt: total dropped due to maximum CS in-flight
1094 * @ctx_max_cs_in_flight_drop_cnt: context dropped due to maximum CS in-flight
1114 * struct hl_info_last_err_open_dev_time - last error boot information.
1122 * struct hl_info_cs_timeout_event - last CS timeout information.
1123 * @timestamp: timestamp when last CS timeout event occurred.
1124 * @seq: sequence number of last CS timeout event.
1141 * struct hl_info_razwi_event - razwi information.
1147 * @num_of_possible_engines: contains number of possible engine ids. In some asics, razwi indication
1153 * @flags: bitmask for additional data: HL_RAZWI_READ - razwi caused by read operation
1154 * HL_RAZWI_WRITE - razwi caused by write operation
1155 * HL_RAZWI_LBW - razwi caused by lbw fabric transaction
1156 * HL_RAZWI_HBW - razwi caused by hbw fabric transaction
1157 * HL_RAZWI_RR - razwi caused by range register
1158 * HL_RAZWI_ADDR_DEC - razwi caused by address decode error
1174 * struct hl_info_undefined_opcode_event - info about last undefined opcode error
1178 * filled with values, it means the execution was in Lower-CP.
1181 * @cb_addr_streams_len: num of streams - actual len of cb_addr_streams array.
1183 * in Upper-CP (specific stream) and equal to 4 incase
1184 * of undefined opcode in Lower-CP.
1185 * @engine_id: engine-id that the error occurred on
1187 * MAX_QMAN_STREAMS_INFO it means the error occurred on a Lower-CP.
1200 * struct hl_info_hw_err_event - info about HW error
1218 * struct hl_info_fw_err_event - info about FW error
1219 * @timestamp: time-stamp of error occurrence
1233 * struct hl_info_engine_err_event - engine error info
1234 * @timestamp: time-stamp of error occurrence
1247 * struct hl_info_dev_memalloc_page_sizes - valid page sizes in device mem alloc information.
1256 #define SEC_PCR_QUOTE_BUF_SZ 510 /* (512 - 2) 2 bytes used for size */
1257 #define SEC_SIGNATURE_BUF_SZ 255 /* (256 - 1) 1 byte used for size */
1258 #define SEC_PUB_DATA_BUF_SZ 510 /* (512 - 2) 2 bytes used for size */
1259 #define SEC_CERTIFICATE_BUF_SZ 2046 /* (2048 - 2) 2 bytes used for size */
1263 * struct hl_info_sec_attest - attestation report of the boot
1264 * @nonce: number only used once. random number provided by host. this also passed to the quote
1269 * @pcr_num_reg: number of PCR registers in the pcr_data array
1296 * struct hl_info_signed - device information signed by a secured device.
1297 * @nonce: number only used once. random number provided by host. this also passed to the quote
1322 * struct hl_page_fault_info - page fault information.
1335 * struct hl_user_mapping - user mapping information.
1352 * struct hl_info_args - Main structure to retrieve device related information.
1361 * @period_ms: Period value, in milliseconds, for utilization rate in range 100ms - 1000ms in 100 ms
1369 * @sec_attest_nonce: Nonce number used for attestation report.
1370 * @array_size: Number of array members copied to user buffer.
1403 #define HL_MAX_CB_SIZE (0x200000 - 32)
1422 /* Context ID - Currently not in use */
1458 * CB, the user invokes - “memory ioctl” to map the user memory into a
1462 * increases the PCI-DMA queues throughput. This CB allocation method
1463 * also reduces the use of Linux DMA-able memory pool. Which are limited
1464 * and used by other Linux sub-systems.
1469 * This structure size must always be fixed to 64-bytes for backward
1493 * signal CS sequence numbers. The wait described by
1503 * This is the CS sequence which has the encapsulated signals.
1520 * Number of entries in signal_seq_arr
1563 * The encapsulated signals CS is merged into the existing CS ioctls.
1565 * 1. Reserve signals, set the CS type to HL_CS_FLAGS_RESERVE_SIGNALS_ONLY
1570 * CS type, note that this might fail if out-of-sync happened to the SOB
1572 * reserve-unreserve calls.
1573 * 2. Use the staged CS to do the encapsulated signaling jobs.
1577 * 3. Use WAIT/COLLECTIVE WAIT CS along with HL_CS_FLAGS_ENCAP_SIGNALS flag
1585 * The engine cores CS is merged into the existing CS ioctls.
1591 * The flush HBW PCI writes is merged into the existing CS ioctls.
1594 * the return sequence number (which will be invalid anyway)
1599 * The engines CS is merged into the existing CS ioctls.
1609 * enum hl_engine_command - engine command
1640 /* number of engine cores in engine_cores array */
1652 /* number of engines in engines array */
1662 * Sequence number of a staged submission CS
1671 * 1. CS with encapsulated signals:
1682 /* Encapsulated signals number */
1690 /* Number of chunks in restore phase array. Maximum number is
1695 /* Number of chunks in execution array. Maximum number is
1700 /* timeout in seconds - valid only if HL_CS_FLAGS_CUSTOM_TIMEOUT
1708 /* Context ID - Currently not in use */
1716 * seq holds the sequence number of the CS to pass to wait
1768 * In case of wait_cs holds the CS sequence number.
1769 * In case of wait for multi CS hold a user pointer to
1770 * an array of CS sequence numbers
1802 /* Context ID - Currently not in use */
1819 /* Multi CS API info- valid entries in multi-CS array */
1869 * for wait_cs: timestamp of CS completion
1870 * for wait_multi_cs: timestamp of FIRST CS completion
1873 /* multi CS completion bitmap */
1898 /* Opcode to create DMA-BUF object for an existing device memory allocation
1899 * and to export an FD of that DMA-BUF back to the caller
1919 * structure hl_mem_in - structure that handle input args for memory IOCTL
1923 * For the HL_MEM_OP_EXPORT_DMABUF_FD opcode, this field holds the DMA-BUF file/FD flags.
1924 * @ctx_id: context ID - currently not in use.
1925 * @num_of_elements: number of timestamp elements used only with HL_MEM_OP_TS_ALLOC opcode.
1941 * structure for free-ing device memory (used with the HL_MEM_OP_FREE op)
2013 * address of that the exported dma-buf object describes.
2060 * DMA-BUF object that was created to describe a memory
2141 /* Number of event types selection */
2190 /* Context ID - Currently not in use */
2203 * - H/W IP information
2204 * - Current dram usage
2207 * information. The user should supply a pointer to a user-allocated memory
2219 * - Request a Command Buffer
2220 * - Destroy a Command Buffer
2222 * The command buffers are memory blocks that reside in DMA-able address
2226 * When creating a new CB, the IOCTL returns a handle of it, and the user-space
2242 * of JOBS. That set of JOBS constitutes a CS object.
2246 * The CS IOCTL will receive two sets of JOBS. One set is for "restore" phase
2248 * The JOBS on the "restore" phase are enqueued only after context-switch
2249 * (or if its the first CS for this context). The user can also order the
2253 * There are two types of queues - external and internal. External queues
2264 * through the CB ioctl and give the CB's handle to the CS ioctl. For jobs on
2267 * that buffer to the CS ioctl.
2270 * This IOCTL is asynchronous in regard to the actual execution of the CS. This
2272 * relevant queues. Therefore, the user mustn't assume the CS has been completed
2275 * Upon successful enqueue, the IOCTL returns a sequence number which the user
2276 * can use with the "Wait for CS" IOCTL to check whether the handle's CS
2277 * non-internal JOBS have been completed. Note that if the CS has internal JOBS
2279 * report that the CS has finished executing BEFORE the internal JOBS have
2282 * Even though the sequence number increments per CS, the user can NOT
2283 * automatically assume that if CS with sequence number N finished, then CS
2284 * with sequence number N-1 also finished. The user can make this assumption if
2285 * and only if CS N and CS N-1 are exactly the same (same CBs for the same
2293 * The user can call this IOCTL with a handle it received from the CS IOCTL
2294 * to wait until the handle's CS has finished executing. The user will wait
2295 * inside the kernel until the CS has finished or until the user-requested
2299 * the status of the CS and return immediately
2304 * EINTR - Kernel waiting has been interrupted, e.g. due to OS signal
2306 * ETIMEDOUT - The CS has caused a timeout on the device
2307 * EIO - The CS was aborted (usually because the device was reset)
2308 * ENODEV - The device wants to do hard-reset (so user need to close FD)
2313 * HL_WAIT_CS_STATUS_COMPLETED - The CS has been completed successfully (0)
2314 * HL_WAIT_CS_STATUS_BUSY - The CS is still executing (0)
2315 * HL_WAIT_CS_STATUS_TIMEDOUT - The CS has caused a timeout on the device
2317 * HL_WAIT_CS_STATUS_ABORTED - The CS was aborted, usually because the
2324 * - Map host memory to device MMU
2325 * - Unmap host memory from device MMU
2330 * to allocate the memory in user-space (malloc/new). The driver pins the
2341 * - Enable/disable the ETR/ETF/FUNNEL/STM/BMON/SPMU debug traces
2358 * set the device into non-debug mode, i.e. disable debug mode.