Lines Matching refs:hdev

22 int hl_fw_push_fw_to_device(struct hl_device *hdev, const char *fw_name,  in hl_fw_push_fw_to_device()  argument
30 rc = request_firmware(&fw, fw_name, hdev->dev); in hl_fw_push_fw_to_device()
32 dev_err(hdev->dev, "Firmware file %s is not found!\n", fw_name); in hl_fw_push_fw_to_device()
38 dev_err(hdev->dev, "Illegal %s firmware size %zu\n", in hl_fw_push_fw_to_device()
44 dev_dbg(hdev->dev, "%s firmware size == %zu\n", fw_name, fw_size); in hl_fw_push_fw_to_device()
55 int hl_fw_send_pci_access_msg(struct hl_device *hdev, u32 opcode) in hl_fw_send_pci_access_msg() argument
61 return hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, in hl_fw_send_pci_access_msg()
65 int hl_fw_send_cpu_message(struct hl_device *hdev, u32 hw_queue_id, u32 *msg, in hl_fw_send_cpu_message() argument
73 pkt = hdev->asic_funcs->cpu_accessible_dma_pool_alloc(hdev, len, in hl_fw_send_cpu_message()
76 dev_err(hdev->dev, in hl_fw_send_cpu_message()
83 mutex_lock(&hdev->send_cpu_message_lock); in hl_fw_send_cpu_message()
85 if (hdev->disabled) in hl_fw_send_cpu_message()
88 if (hdev->device_cpu_disabled) { in hl_fw_send_cpu_message()
93 rc = hl_hw_queue_send_cb_no_cmpl(hdev, hw_queue_id, len, pkt_dma_addr); in hl_fw_send_cpu_message()
95 dev_err(hdev->dev, "Failed to send CB on CPU PQ (%d)\n", rc); in hl_fw_send_cpu_message()
99 rc = hl_poll_timeout_memory(hdev, &pkt->fence, tmp, in hl_fw_send_cpu_message()
103 hl_hw_queue_inc_ci_kernel(hdev, hw_queue_id); in hl_fw_send_cpu_message()
106 dev_err(hdev->dev, "Device CPU packet timeout (0x%x)\n", tmp); in hl_fw_send_cpu_message()
107 hdev->device_cpu_disabled = true; in hl_fw_send_cpu_message()
115 dev_err(hdev->dev, "F/W ERROR %d for CPU packet %d\n", in hl_fw_send_cpu_message()
125 mutex_unlock(&hdev->send_cpu_message_lock); in hl_fw_send_cpu_message()
127 hdev->asic_funcs->cpu_accessible_dma_pool_free(hdev, len, pkt); in hl_fw_send_cpu_message()
132 int hl_fw_test_cpu_queue(struct hl_device *hdev) in hl_fw_test_cpu_queue() argument
142 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &test_pkt, in hl_fw_test_cpu_queue()
147 dev_info(hdev->dev, in hl_fw_test_cpu_queue()
150 dev_err(hdev->dev, in hl_fw_test_cpu_queue()
153 dev_err(hdev->dev, "CPU queue test failed, error %d\n", rc); in hl_fw_test_cpu_queue()
159 void *hl_fw_cpu_accessible_dma_pool_alloc(struct hl_device *hdev, size_t size, in hl_fw_cpu_accessible_dma_pool_alloc() argument
164 kernel_addr = gen_pool_alloc(hdev->cpu_accessible_dma_pool, size); in hl_fw_cpu_accessible_dma_pool_alloc()
166 *dma_handle = hdev->cpu_accessible_dma_address + in hl_fw_cpu_accessible_dma_pool_alloc()
167 (kernel_addr - (u64) (uintptr_t) hdev->cpu_accessible_dma_mem); in hl_fw_cpu_accessible_dma_pool_alloc()
172 void hl_fw_cpu_accessible_dma_pool_free(struct hl_device *hdev, size_t size, in hl_fw_cpu_accessible_dma_pool_free() argument
175 gen_pool_free(hdev->cpu_accessible_dma_pool, (u64) (uintptr_t) vaddr, in hl_fw_cpu_accessible_dma_pool_free()
179 int hl_fw_send_heartbeat(struct hl_device *hdev) in hl_fw_send_heartbeat() argument
189 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &hb_pkt, in hl_fw_send_heartbeat()
198 int hl_fw_armcp_info_get(struct hl_device *hdev) in hl_fw_armcp_info_get() argument
200 struct asic_fixed_properties *prop = &hdev->asic_prop; in hl_fw_armcp_info_get()
208 hdev->asic_funcs->cpu_accessible_dma_pool_alloc(hdev, in hl_fw_armcp_info_get()
212 dev_err(hdev->dev, in hl_fw_armcp_info_get()
224 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), in hl_fw_armcp_info_get()
227 dev_err(hdev->dev, in hl_fw_armcp_info_get()
235 rc = hl_build_hwmon_channel_info(hdev, prop->armcp_info.sensors); in hl_fw_armcp_info_get()
237 dev_err(hdev->dev, in hl_fw_armcp_info_get()
244 hdev->asic_funcs->cpu_accessible_dma_pool_free(hdev, in hl_fw_armcp_info_get()
250 int hl_fw_get_eeprom_data(struct hl_device *hdev, void *data, size_t max_size) in hl_fw_get_eeprom_data() argument
259 hdev->asic_funcs->cpu_accessible_dma_pool_alloc(hdev, in hl_fw_get_eeprom_data()
262 dev_err(hdev->dev, in hl_fw_get_eeprom_data()
274 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), in hl_fw_get_eeprom_data()
278 dev_err(hdev->dev, in hl_fw_get_eeprom_data()
287 hdev->asic_funcs->cpu_accessible_dma_pool_free(hdev, max_size, in hl_fw_get_eeprom_data()