Lines Matching +full:compute +full:- +full:cb

1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
3 * Copyright 2016-2022 HabanaLabs, Ltd.
15 * Defines that are asic-specific but constitutes as ABI between kernel driver
196 * stream id is a running number from 0 up to (N-1), where N is the number
653 * enum hl_goya_dma_direction - Direction of DMA operation inside a LIN_DMA packet that is
680 * enum hl_device_status - Device status information.
711 * Notifier event values - for the notification mechanism and the HL_INFO_GET_EVENTS command
713 * HL_NOTIFIER_EVENT_TPC_ASSERT - Indicates TPC assert event
714 * HL_NOTIFIER_EVENT_UNDEFINED_OPCODE - Indicates undefined operation code
715 * HL_NOTIFIER_EVENT_DEVICE_RESET - Indicates device requires a reset
716 * HL_NOTIFIER_EVENT_CS_TIMEOUT - Indicates CS timeout error
717 * HL_NOTIFIER_EVENT_DEVICE_UNAVAILABLE - Indicates device is unavailable
718 * HL_NOTIFIER_EVENT_USER_ENGINE_ERR - Indicates device engine in error state
719 * HL_NOTIFIER_EVENT_GENERAL_HW_ERR - Indicates device HW error
731 * HW_IP_INFO - Receive information about different IP blocks in the
733 * HL_INFO_HW_EVENTS - Receive an array describing how many times each event
735 * HL_INFO_DRAM_USAGE - Retrieve the dram usage inside the device and of the
738 * HL_INFO_HW_IDLE - Retrieve information about the idle status of each
740 * HL_INFO_DEVICE_STATUS - Retrieve the device's status. This opcode doesn't
742 * HL_INFO_DEVICE_UTILIZATION - Retrieve the total utilization of the device
747 * HL_INFO_HW_EVENTS_AGGREGATE - Receive an array describing how many times each
749 * HL_INFO_CLK_RATE - Retrieve the current and maximum clock rate
752 * HL_INFO_RESET_COUNT - Retrieve the counts of the soft and hard reset
755 * HL_INFO_TIME_SYNC - Retrieve the device's time alongside the host's time
757 * HL_INFO_CS_COUNTERS - Retrieve command submission counters
758 * HL_INFO_PCI_COUNTERS - Retrieve PCI counters
759 * HL_INFO_CLK_THROTTLE_REASON - Retrieve clock throttling reason
760 * HL_INFO_SYNC_MANAGER - Retrieve sync manager info per dcore
761 * HL_INFO_TOTAL_ENERGY - Retrieve total energy consumption
762 * HL_INFO_PLL_FREQUENCY - Retrieve PLL frequency
763 * HL_INFO_POWER - Retrieve power information
764 * HL_INFO_OPEN_STATS - Retrieve info regarding recent device open calls
765 * HL_INFO_DRAM_REPLACED_ROWS - Retrieve DRAM replaced rows info
766 * HL_INFO_DRAM_PENDING_ROWS - Retrieve DRAM pending rows num
767 * HL_INFO_LAST_ERR_OPEN_DEV_TIME - Retrieve timestamp of the last time the device was opened
769 * HL_INFO_CS_TIMEOUT_EVENT - Retrieve CS timeout timestamp and its related CS sequence number.
770 * HL_INFO_RAZWI_EVENT - Retrieve parameters of razwi:
775 * HL_INFO_DEV_MEM_ALLOC_PAGE_SIZES - Retrieve valid page sizes for device memory allocation
776 * HL_INFO_SECURED_ATTESTATION - Retrieve attestation report of the boot.
777 * HL_INFO_REGISTER_EVENTFD - Register eventfd for event notifications.
778 * HL_INFO_UNREGISTER_EVENTFD - Unregister eventfd
779 * HL_INFO_GET_EVENTS - Retrieve the last occurred events
780 * HL_INFO_UNDEFINED_OPCODE_EVENT - Retrieve last undefined opcode error information.
820 * struct hl_info_hw_ip_info - hardware information on various IPs in the ASIC
834 * @decoder_enabled_mask: Bit-mask that represents which decoders are enabled.
846 * @tpc_enabled_mask: Bit-mask that represents which TPCs are enabled. Relevant
854 * @tpc_enabled_mask_ext: Bit-mask that represents which TPCs are enabled.
857 * @edma_enabled_mask: Bit-mask that represents which EDMAs are enabled.
942 * struct hl_info_pci_counters - pci counters
964 * struct hl_info_clk_throttle - clock throttling reason
966 * @clk_throttling_timestamp_us: represents CPU timestamp in microseconds of the start-event
977 * struct hl_info_energy - device energy information
991 * struct hl_open_stats_info - device open statistics information
994 * @is_compute_ctx_active: Whether there is an active compute context executing
995 * @compute_ctx_in_release: true if the current compute context is being released
1006 * struct hl_power_info - power information
1014 * struct hl_info_sync_manager - sync manager information
1027 * struct hl_info_cs_counters - command submission counters
1036 * @total_max_cs_in_flight_drop_cnt: total dropped due to maximum CS in-flight
1037 * @ctx_max_cs_in_flight_drop_cnt: context dropped due to maximum CS in-flight
1057 * struct hl_info_last_err_open_dev_time - last error boot information.
1065 * struct hl_info_cs_timeout_event - last CS timeout information.
1078 * struct hl_info_razwi_event - razwi information.
1104 * struct hl_info_undefined_opcode_event - info about last undefined opcode error
1106 * @cb_addr_streams: CB addresses (per stream) that are currently exists in the PQ
1108 * filled with values, it means the execution was in Lower-CP.
1111 * @cb_addr_streams_len: num of streams - actual len of cb_addr_streams array.
1113 * in Upper-CP (specific stream) and equal to 4 incase
1114 * of undefined opcode in Lower-CP.
1115 * @engine_id: engine-id that the error occurred on
1117 * MAX_QMAN_STREAMS_INFO it means the error occurred on a Lower-CP.
1130 * struct hl_info_dev_memalloc_page_sizes - valid page sizes in device mem alloc information.
1139 #define SEC_PCR_QUOTE_BUF_SZ 510 /* (512 - 2) 2 bytes used for size */
1140 #define SEC_SIGNATURE_BUF_SZ 255 /* (256 - 1) 1 byte used for size */
1141 #define SEC_PUB_DATA_BUF_SZ 510 /* (512 - 2) 2 bytes used for size */
1142 #define SEC_CERTIFICATE_BUF_SZ 2046 /* (2048 - 2) 2 bytes used for size */
1145 * struct hl_info_sec_attest - attestation report of the boot
1185 * struct hl_info_args - Main structure to retrieve device related information.
1194 * @period_ms: Period value, in milliseconds, for utilization rate in range 100ms - 1000ms in 100 ms
1231 #define HL_MAX_CB_SIZE (0x200000 - 32)
1236 /* Used with HL_CB_OP_INFO opcode to get the device va address for kernel mapped CB */
1240 /* Handle of CB or 0 if we want to create one */
1245 /* Size of CB. Maximum size is HL_MAX_CB_SIZE. The minimum size that
1250 /* Context ID - Currently not in use */
1258 /* Handle of CB */
1262 /* Information about CB */
1264 /* Usage count of CB */
1269 /* CB mapped address to device MMU */
1283 * Indicates if the CB was allocated and mapped by userspace
1284 * (relevant to greco and above). User allocated CB is a command buffer,
1286 * CB, the user invokes - “memory ioctl” to map the user memory into a
1290 * increases the PCI-DMA queues throughput. This CB allocation method
1291 * also reduces the use of Linux DMA-able memory pool. Which are limited
1292 * and used by other Linux sub-systems.
1297 * This structure size must always be fixed to 64-bytes for backward
1303 * For external queue, this represents a Handle of CB on the
1306 * a DRAM address of the internal CB. In Gaudi, this might also
1307 * represent a mapped host address of the CB.
1310 * For H/W queue, this represents either a Handle of CB on the
1311 * Host, or an SRAM, a DRAM, or a mapped host address of the CB.
1336 /* Index of queue to put the CB on */
1342 * Can be smaller then actual CB size
1395 * this address will be used to patch CB cmds to do the signaling for this
1398 * CS type, note that this might fail if out-of-sync happened to the SOB
1400 * reserve-unreserve calls.
1494 /* timeout in seconds - valid only if HL_CS_FLAGS_CUSTOM_TIMEOUT
1502 /* Context ID - Currently not in use */
1584 /* cq_counters_handle to a kernel mapped cb which contains
1596 /* Context ID - Currently not in use */
1613 /* Multi CS API info- valid entries in multi-CS array */
1625 * cq counter offset inside the counters cb pointed by cq_counters_handle above.
1692 /* Opcode to create DMA-BUF object for an existing device memory allocation
1693 * and to export an FD of that DMA-BUF back to the caller
1713 * structure hl_mem_in - structure that handle input args for memory IOCTL
1717 * For the HL_MEM_OP_EXPORT_DMABUF_FD opcode, this field holds the DMA-BUF file/FD flags.
1718 * @ctx_id: context ID - currently not in use.
1735 * structure for free-ing device memory (used with the HL_MEM_OP_FREE op)
1845 * DMA-BUF object that was created to describe a memory
1975 /* Context ID - Currently not in use */
1981 * - H/W IP information
1982 * - Current dram usage
1985 * information. The user should supply a pointer to a user-allocated memory
1998 * - Request a Command Buffer
1999 * - Destroy a Command Buffer
2001 * The command buffers are memory blocks that reside in DMA-able address
2005 * When creating a new CB, the IOCTL returns a handle of it, and the user-space
2028 * The JOBS on the "restore" phase are enqueued only after context-switch
2033 * There are two types of queues - external and internal. External queues
2040 * for transfers from/to the host or inside the device, or compute engines.
2044 * through the CB ioctl and give the CB's handle to the CS ioctl. For jobs on
2057 * non-internal JOBS have been completed. Note that if the CS has internal JOBS
2064 * with sequence number N-1 also finished. The user can make this assumption if
2065 * and only if CS N and CS N-1 are exactly the same (same CBs for the same
2076 * inside the kernel until the CS has finished or until the user-requested
2085 * EINTR - Kernel waiting has been interrupted, e.g. due to OS signal
2087 * ETIMEDOUT - The CS has caused a timeout on the device
2088 * EIO - The CS was aborted (usually because the device was reset)
2089 * ENODEV - The device wants to do hard-reset (so user need to close FD)
2094 * HL_WAIT_CS_STATUS_COMPLETED - The CS has been completed successfully (0)
2095 * HL_WAIT_CS_STATUS_BUSY - The CS is still executing (0)
2096 * HL_WAIT_CS_STATUS_TIMEDOUT - The CS has caused a timeout on the device
2098 * HL_WAIT_CS_STATUS_ABORTED - The CS was aborted, usually because the
2107 * - Map host memory to device MMU
2108 * - Unmap host memory from device MMU
2113 * to allocate the memory in user-space (malloc/new). The driver pins the
2125 * - Enable/disable the ETR/ETF/FUNNEL/STM/BMON/SPMU debug traces
2142 * set the device into non-debug mode, i.e. disable debug mode.