Lines Matching +full:required +full:- +full:for +full:- +full:hardware +full:- +full:jobs
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
21 * 128 SOBs reserved for collective wait
22 * 16 SOBs reserved for sync stream
27 * 64 monitors reserved for collective wait
28 * 8 monitors reserved for sync stream
189 * 2. F/W mode, where we use F/W to schedule the JOBS to the different queues.
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
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
743 /* Opcode for management ioctl
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
750 * specific context. This is relevant only for devices
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
770 * for synchronization.
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
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.
854 /* Maximum buffer size for retrieving engines status */
858 * struct hl_info_hw_ip_info - hardware information on various IPs in the ASIC
870 * @module_id: Module ID of the ASIC for mezzanine cards in servers
872 * @decoder_enabled_mask: Bit-mask that represents which decoders are enabled.
873 * @first_available_interrupt_id: The first available interrupt ID for the user
875 * Relevant for Gaudi2 and later.
884 * @tpc_enabled_mask: Bit-mask that represents which TPCs are enabled. Relevant
885 * for Goya/Gaudi only.
889 * configuration. Relevant for Gaudi2 and later.
892 * @tpc_enabled_mask_ext: Bit-mask that represents which TPCs are enabled.
893 * Relevant for Gaudi2 and later.
895 * @edma_enabled_mask: Bit-mask that represents which EDMAs are enabled.
896 * Relevant for Gaudi2 and later.
898 * application to use. Relevant for Gaudi2 and later.
901 * @tpc_interrupt_id: interrupt id for TPC to use in order to raise events towards the host.
902 * @rotator_enabled_mask: Bit-mask that represents which rotators are enabled.
903 * Relevant for Gaudi3 and later.
904 * @engine_core_interrupt_reg_addr: interrupt register address for engine core to use
906 * @reserved_dram_size: DRAM size reserved for driver and firmware.
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.
1141 * struct hl_info_razwi_event - razwi information.
1148 * might be common for several engines and there is no way to get the
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
1203 * @pad: size padding for u64 granularity.
1211 /* FW error definition for event_type in struct hl_info_fw_err_event */
1218 * struct hl_info_fw_err_event - info about FW error
1219 * @timestamp: time-stamp of error occurrence
1223 * @pad: size padding for u64 granularity.
1233 * struct hl_info_engine_err_event - engine error info
1234 * @timestamp: time-stamp of error occurrence
1237 * @pad: size padding for u64 granularity.
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
1275 * @public_data: public key for the signed attestation
1277 * @certificate: certificate for the attestation signing key
1296 * struct hl_info_signed - device information signed by a secured device.
1303 * @certificate: certificate for the signing key
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.
1356 * limits how many bytes the kernel can write. For hw_events array, the size should be
1358 * @op: Defines which type of information to be retrieved. Refer HL_INFO_* for details.
1359 * @dcore_id: DCORE id for which the information is relevant (for Gaudi refer to enum gaudi_dcores).
1361 * @period_ms: Period value, in milliseconds, for utilization rate in range 100ms - 1000ms in 100 ms
1364 * @eventfd: event file descriptor for event notifications.
1366 * driver. It is possible for the user to allocate buffer larger than
1369 * @sec_attest_nonce: Nonce number used for attestation report.
1371 * Relevant for HL_INFO_USER_MAPPINGS info ioctl.
1402 /* 2MB minus 32 bytes for 2xMSG_PROT */
1403 #define HL_MAX_CB_SIZE (0x200000 - 32)
1408 /* Used with HL_CB_OP_INFO opcode to get the device va address for kernel mapped CB */
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
1475 * For external queue, this represents a Handle of CB on the
1477 * For internal queue in Goya, this represents an SRAM or
1482 * For H/W queue, this represents either a Handle of CB on the
1527 * This set the signals range that the user want to wait for
1530 * to wait for signal 8, so he set this offset to 7, then
1567 * this address will be used to patch CB cmds to do the signaling for this
1569 * for reverting the reservation use HL_CS_FLAGS_UNRESERVE_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.
1578 * to wait for the encapsulated signals.
1593 * This is a blocking operation and for this reason the user shall not use
1609 * enum hl_engine_command - engine command
1628 /* this holds address of array of hl_cs_chunk for restore phase */
1631 /* holds address of array of hl_cs_chunk for execution phase */
1637 /* this holds address of array of uint32 for engine_cores */
1649 /* this holds address of array of uint32 for engines */
1670 * Valid for two flows:
1700 /* timeout in seconds - valid only if HL_CS_FLAGS_CUSTOM_TIMEOUT
1708 /* Context ID - Currently not in use */
1717 * ioctl. All values are valid except for 0 and ULLONG_MAX
1769 * In case of wait for multi CS hold a user pointer to
1773 /* Absolute timeout to wait for command submission
1781 /* User address for completion comparison.
1797 /* Target value for completion comparison */
1802 /* Context ID - Currently not in use */
1809 * in order to wait for any CQ interrupt, set interrupt value to
1812 * in order to wait for any decoder interrupt, set interrupt value to
1819 /* Multi CS API info- valid entries in multi-CS array */
1824 /* Absolute timeout to wait for an interrupt in microseconds.
1869 * for wait_cs: timestamp of CS completion
1870 * for wait_multi_cs: timestamp of FIRST CS completion
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
1903 /* Opcode to create timestamps pool for user interrupts registration support
1905 * will get handle to it for mmap, and another internal buffer used by the
1906 * driver for registration management
1919 * structure hl_mem_in - structure that handle input args for memory IOCTL
1922 * @flags: flags for the memory operation (one of the HL_MEM_* definitions).
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.
1930 * structure for device memory allocation (used with the HL_MEM_OP_ALLOC op)
1941 * structure for free-ing device memory (used with the HL_MEM_OP_FREE op)
1949 * structure for mapping device memory (used with the HL_MEM_OP_MAP op)
1964 * structure for mapping host memory (used with the HL_MEM_OP_MAP op)
1981 * structure for mapping hw block (used with the HL_MEM_OP_MAP_BLOCK op)
1991 * structure for unmapping host memory (used with the HL_MEM_OP_UNMAP op)
1999 * structure for exporting DMABUF object (used with
2001 * @addr: for Gaudi1, the driver expects a physical address
2004 * for all other ASICs, the driver expects a device
2010 * @offset: for Gaudi1, this value must be 0. For all other ASICs,
2013 * address of that the exported dma-buf object describes.
2031 * Used for HL_MEM_OP_MAP as the virtual address that was
2039 * This is the assigned handle for the allocated memory
2046 * This is the assigned handle for the mapped block
2060 * DMA-BUF object that was created to describe a memory
2100 /* Two bit masks for HW event and Stimulus Port */
2107 /* Frequency for the timestamp register */
2150 /* Opcode for ETR component */
2152 /* Opcode for ETF component */
2154 /* Opcode for STM component */
2156 /* Opcode for FUNNEL component */
2158 /* Opcode for BMON component */
2160 /* Opcode for SPMU component */
2162 /* Opcode for timestamp (deprecated) */
2164 /* Opcode for setting the device into or out of debug mode. The enable
2165 * variable should be 1 for enabling debug mode and 0 for disabling it
2190 /* Context ID - Currently not in use */
2203 * - H/W IP information
2204 * - Current dram usage
2206 * The user calls this IOCTL with an opcode that describes the required
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
2231 * indicate the driver that such a mapping is required.
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
2247 * and a second set is for "execution" 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
2256 * on JOBS which are enqueued in the external queues.
2259 * There is a single type of queue for all types of engines, either DMA engines
2260 * for transfers from/to the host or inside the device, or compute engines.
2261 * The driver will get completion notifications from the device for all queues.
2263 * For jobs on external queues, the user needs to create command buffers
2264 * through the CB ioctl and give the CB's handle to the CS ioctl. For jobs on
2268 * For jobs on H/W queues both options of command buffers are valid.
2271 * means it returns immediately after ALL the JOBS were enqueued on their
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
2278 * which can execute AFTER the external JOBS have finished, the driver might
2279 * report that the CS has finished executing BEFORE the internal JOBS have
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
2291 * Wait for Command Submission
2295 * inside the kernel until the CS has finished or until the user-requested
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
2329 * For host memory, the IOCTL doesn't allocate memory. The user is supposed
2330 * to allocate the memory in user-space (malloc/new). The driver pins the
2334 * There is an option for the user to specify the requested virtual address.
2341 * - Enable/disable the ETR/ETF/FUNNEL/STM/BMON/SPMU debug traces
2354 * For each configuration request, the user needs to provide the register index
2358 * set the device into non-debug mode, i.e. disable debug mode.