Lines Matching +full:max +full:- +full:outbound +full:- +full:regions
1 /* SPDX-License-Identifier: GPL-2.0
3 * Copyright 2016-2019 HabanaLabs, Ltd.
19 #include <linux/dma-direction.h>
27 #include <linux/io-64-nonatomic-lo-hi.h>
33 * bits[63:61] - Encode mmap type
34 * bits[45:0] - mmap offset value
39 #define HL_MMAP_TYPE_SHIFT (61 - PAGE_SHIFT)
81 * enum hl_mmu_page_table_locaion - mmu page table location
82 * @MMU_DR_PGT: page-table is located on device DRAM.
83 * @MMU_HR_PGT: page-table is located on host memory.
84 * @MMU_NUM_PGT_LOCATIONS: number of page-table locations currently supported.
87 MMU_DR_PGT = 0, /* device-dram-resident MMU PGT */
106 #define IS_POWER_OF_2(n) (n != 0 && ((n & (n - 1)) == 0))
116 * - HL_RESET_HARD
120 * - HL_RESET_FROM_RESET_THREAD
121 * Set if the caller is the hard-reset thread
123 * - HL_RESET_HEARTBEAT
126 * - HL_RESET_TDR
129 * - HL_RESET_DEVICE_RELEASE
132 * - HL_RESET_FW
146 * struct hl_gen_wait_properties - properties for generating a wait CB
166 * struct pgt_info - MMU hop page info.
167 * @node: hash linked-list node for the pgts shadow hash of pgts.
190 * enum hl_pci_match_mode - pci match mode per region
200 * enum hl_fw_component - F/W components to read version through registers.
212 * enum hl_fw_types - F/W types present in the system
215 * @FW_TYPE_PREBOOT_CPU: Indicates pre-loaded CPUs are present in the system
228 * enum hl_queue_type - Supported QUEUE types.
256 * struct hl_inbound_pci_region - inbound region descriptor
272 * struct hl_outbound_pci_region - outbound region descriptor
282 * enum queue_cb_alloc_flags - Indicates queue support for CBs that
293 * struct hl_hw_sob - H/W SOB info.
317 * struct hw_queue_properties - queue information.
337 * enum vm_type - virtual memory mapping request information.
347 * enum hl_device_hw_state - H/W device state. use this to understand whether
361 * struct hl_mmu_properties - ASIC specific MMU address translation properties.
402 * struct hl_hints_range - hint addresses reserved va range.
412 * struct asic_fixed_properties - ASIC specific immutable properties.
414 * @cpucp_info: received various information from CPU-CP regarding the H/W, e.g.
416 * @uboot_ver: F/W U-boot version.
428 * @sram_user_base_address - SRAM physical start address for user access.
434 * @max_power_default: max power of the device after reset
596 * struct hl_fence - software synchronization primitive
615 * struct hl_cs_compl - command submission completion object.
622 * @type: type of the CS - signal/wait.
646 * struct hl_cb_mgr - describes a Command Buffer Manager.
656 * struct hl_cb - describes a Command Buffer.
720 /* Host <-> CPU-CP shared memory size */
724 * struct hl_sync_stream_properties -
751 * struct hl_encaps_signals_mgr - describes sync stream encapsulated signals
762 * struct hl_hw_queue - describes a H/W transport queue.
797 * struct hl_cq - describes a completion queue
819 * struct hl_user_interrupt - holds user interrupt information
833 * struct hl_user_pending_interrupt - holds a context to a user thread
844 * struct hl_eq - describes the event queue (single one per device)
870 * enum hl_asic_type - supported ASIC types.
874 * @ASIC_GAUDI_SEC: Gaudi secured device (HL-2000).
886 * enum hl_pm_mng_profile - power management profile.
898 * enum hl_pll_frequency - PLL frequency.
927 * struct pci_mem_region - describe memory region in a PCI bar
945 * struct static_fw_load_mgr - static FW load manager
946 * @preboot_version_max_off: max offset to preboot version
947 * @boot_fit_version_max_off: max offset to boot fit version
948 * @kmd_msg_to_cpu_reg: register address for KDM->CPU messages
977 * struct fw_response - FW response to LKD command
989 * struct dynamic_fw_load_mgr - dynamic FW load manager
1005 * struct fw_image_props - properties of FW image
1017 * struct fw_load_mgr - manager FW loading process
1045 * struct hl_asic_funcs - ASIC specific functions that are can be called from
1049 * @late_init: sets up late driver/hw state (post hw_init) - Optional.
1050 * @late_fini: tears down what was done in late_init (pre hw_fini) - Optional.
1062 * @pqe_write: Write the PQ entry to the PQ. This is ASIC-specific
1083 * @hl_dma_unmap_sg: DMA unmap scatter-gather list.
1085 * @asic_dma_map_sg: DMA map scatter-gather list.
1098 * @handle_eqe: handle event queue entry (IRQ) from CPU-CP.
1106 * ASID-VA-size mask.
1107 * @send_heartbeat: send is-alive packet to CPU-CP and verify response.
1149 * @descramble_addr: Routine to de-scramble the address prior of
1159 * after every hard-reset of the device
1160 * @get_msi_info: Retrieve asic-specific MSI ID of the f/w async event
1167 * @set_pci_memory_regions: setting properties of PCI memory regions
1309 * enum hl_va_range_type - virtual address range type.
1322 * struct hl_va_range - virtual addresses range.
1338 * struct hl_cs_counters_atomic - command submission counters
1343 * @max_cs_in_flight_drop_cnt: dropped due to maximum CS in-flight
1356 * struct hl_ctx - user/kernel context.
1420 * struct hl_ctx_mgr - for handling multiple contexts.
1436 * struct hl_userptr - memory mapping chunk information
1438 * @job_node: linked-list node for hanging the object on the Job's list.
1441 * @sgt: pointer to the scatter-gather table that holds the pages.
1445 * @addr: user-space virtual address of the start of the memory area.
1464 * struct hl_cs - command submission.
1535 * struct hl_cs_job - command submission job.
1542 * @userptr_list: linked-list of userptr mappings that belong to this job and
1554 * handle to a kernel-allocated CB object, false
1583 * struct hl_cs_parser - command submission parser properties.
1587 * @job_userptr_list: linked-list of userptr mappings that belong to the related
1597 * handle to a kernel-allocated CB object, false
1628 * struct hl_vm_hash_node - hash element from virtual address to virtual
1642 * struct hl_vm_hw_block_list_node - list element from user virtual address to
1659 * struct hl_vm_phys_pg_pack - physical page pack.
1689 * struct hl_vm_va_block - virtual range block information.
1703 * struct hl_vm - virtual memory manager for MMU.
1725 * struct hl_debug_params - Coresight debug parameters.
1747 * struct hl_fpriv - process information stored in FD private data.
1780 * struct hl_info_list - debugfs file ops.
1793 * struct hl_debugfs_entry - debugfs dentry wrapper.
1803 * struct hl_dbg_device_entry - ASIC specific debugfs manager.
1861 * struct hl_hw_obj_name_entry - single hw object name, member of
1914 * struct hl_mon_state_dump - represents a state dump of a single monitor
1932 * struct hl_sync_to_engine_map_entry - sync object id to engine mapping entry
1945 * struct hl_sync_to_engine_map - maps sync object id to associated engine id
1954 * struct hl_state_dump_specs_funcs - virtual functions used by the state dump
1976 * struct hl_state_dump_specs - defines ASIC known hw objects names
2012 #define RREG32(reg) hdev->asic_funcs->rreg(hdev, (reg))
2013 #define WREG32(reg, v) hdev->asic_funcs->wreg(hdev, (reg), (v))
2015 hdev->asic_funcs->rreg(hdev, (reg)))
2050 if (hdev->pdev) \
2068 (cond) ? 0 : -ETIMEDOUT; \
2081 * might need to be byte-swapped before returning value to caller.
2087 if (hdev->pdev) \
2111 (cond) ? 0 : -ETIMEDOUT; \
2118 if (hdev->pdev) \
2136 (cond) ? 0 : -ETIMEDOUT; \
2142 * struct hl_device_reset_work - reset workqueue task wrapper.
2156 * struct hr_mmu_hop_addrs - used for holding per-device host-resident mmu hop
2159 * @phys-addr: the physical address of the hop (used by the device-mmu).
2169 * struct hl_mmu_hr_pgt_priv - used for holding per-device mmu host-resident
2170 * page-table internal information.
2180 * struct hl_mmu_dr_pgt_priv - used for holding per-device mmu device-resident
2181 * page-table internal information.
2191 * struct hl_mmu_priv - used for holding per-device mmu internal information.
2192 * @dr: information on the device-resident MMU, when exists.
2193 * @hr: information on the host-resident MMU, when exists.
2201 * struct hl_mmu_per_hop_info - A structure describing one TLB HOP and its entry
2215 * struct hl_mmu_hop_info - A structure describing the TLB hops and their
2216 * hop-entries that were created in order to translate a virtual address to a
2219 * address replaces the original virtual-address when mapped
2221 * @unscrambled_paddr: The un-scrambled physical address.
2222 * @hop_info: Array holding the per-hop information used for the translation.
2235 * struct hl_mmu_funcs - Device related MMU functions.
2245 * @get_tlb_info: returns the list of hops and hop-entries used that were
2273 * struct multi_cs_completion - multi CS wait completion.
2276 * @timestamp: timestamp for the multi-CS completion
2277 * @stream_master_qid_map: bitmap of all stream masters on which the multi-CS
2290 * struct multi_cs_data - internal data for multi CS call
2297 * @completion_bitmap: bitmap of completed CSs (1- completed, otherwise 0)
2299 * multi-CS is waiting
2301 * @gone_cs: indication of gone CS (1- there was gone CS, otherwise 0)
2302 * @update_ts: update timestamp. 1- update the timestamp, otherwise 0.
2319 * struct hl_device - habanalabs device structure.
2330 * @work_heartbeat: delayed work for CPU-CP is-alive check.
2350 * @event_queue: event queue for IRQ from CPU-CP.
2352 * @cpu_accessible_dma_mem: Host <-> CPU-CP shared memory CPU address.
2353 * @cpu_accessible_dma_address: Host <-> CPU-CP shared memory DMA address.
2354 * @cpu_accessible_dma_pool: Host <-> CPU-CP shared memory pool.
2357 * @send_cpu_message_lock: enforces only one message in Host <-> CPU-CP queue.
2379 * @mmu_priv: device-specific MMU data.
2380 * @mmu_func: device-related MMU functions.
2382 * @pci_mem_region: array of memory regions in the PCI
2384 * @multi_cs_completion: array of multi-CS completion.
2387 * @max_power: the max power of the device, as configured by the sysadmin. This
2388 * value is saved so in case of hard-reset, the driver will restore
2389 * this value and update the F/W after the re-initialization
2391 * different engines. See debugfs-driver-habanalabs for
2415 * @cpu_pci_msb_addr: 50-bit extension bits for the device CPU's 40-bit
2421 * @heartbeat: is heartbeat sanity check towards CPU-CP enabled.
2426 * such as context-switch, context close, page free, etc.
2434 * @power9_64bit_dma_enable: true to enable 64-bit DMA mask support. Relevant
2587 /* Parameters for bring-up */
2608 * struct hl_cs_encaps_sig_handle - encapsulated signals handle structure
2635 * typedef hl_ioctl_t - typedef for ioctl function in the driver
2645 * struct hl_ioctl_desc - describes an IOCTL entry of the driver.
2660 * hl_get_sg_info() - get number of pages and the DMA address from SG list.
2672 return ((((*dma_addr) & (PAGE_SIZE - 1)) + sg_dma_len(sg)) + in hl_get_sg_info()
2673 (PAGE_SIZE - 1)) >> PAGE_SHIFT; in hl_get_sg_info()
2677 * hl_mem_area_inside_range() - Checks whether address+size are inside a range.
2699 * hl_mem_area_crosses_range() - Checks whether address+size crossing a range.
2750 #define hl_pi_2_offset(pi) ((pi) & (HL_QUEUE_LENGTH - 1))