Lines Matching refs:hdev

49 static int extract_fw_sub_versions(struct hl_device *hdev, char *preboot_ver)  in extract_fw_sub_versions()  argument
57 rc = kstrtou32(major, 10, &hdev->fw_major_version); in extract_fw_sub_versions()
63 dev_err(hdev->dev, "Error %d parsing preboot major version\n", rc); in extract_fw_sub_versions()
73 rc = kstrtou32(minor, 10, &hdev->fw_minor_version); in extract_fw_sub_versions()
79 dev_err(hdev->dev, "Error %d parsing preboot minor version\n", rc); in extract_fw_sub_versions()
86 static int hl_request_fw(struct hl_device *hdev, in hl_request_fw() argument
93 rc = request_firmware(firmware_p, fw_name, hdev->dev); in hl_request_fw()
95 dev_err(hdev->dev, "Firmware file %s is not found! (error %d)\n", in hl_request_fw()
102 dev_err(hdev->dev, "Illegal %s firmware size %zu\n", in hl_request_fw()
108 dev_dbg(hdev->dev, "%s firmware size == %zu\n", fw_name, fw_size); in hl_request_fw()
111 dev_err(hdev->dev, in hl_request_fw()
150 static int hl_fw_copy_fw_to_device(struct hl_device *hdev, in hl_fw_copy_fw_to_device() argument
161 dev_err(hdev->dev, in hl_fw_copy_fw_to_device()
184 static int hl_fw_copy_msg_to_device(struct hl_device *hdev, in hl_fw_copy_msg_to_device() argument
195 dev_err(hdev->dev, in hl_fw_copy_msg_to_device()
221 int hl_fw_load_fw_to_device(struct hl_device *hdev, const char *fw_name, in hl_fw_load_fw_to_device() argument
227 rc = hl_request_fw(hdev, &fw, fw_name); in hl_fw_load_fw_to_device()
231 rc = hl_fw_copy_fw_to_device(hdev, fw, dst, src_offset, size); in hl_fw_load_fw_to_device()
237 int hl_fw_send_pci_access_msg(struct hl_device *hdev, u32 opcode, u64 value) in hl_fw_send_pci_access_msg() argument
244 return hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), 0, NULL); in hl_fw_send_pci_access_msg()
247 int hl_fw_send_cpu_message(struct hl_device *hdev, u32 hw_queue_id, u32 *msg, in hl_fw_send_cpu_message() argument
250 struct hl_hw_queue *queue = &hdev->kernel_queues[hw_queue_id]; in hl_fw_send_cpu_message()
251 struct asic_fixed_properties *prop = &hdev->asic_prop; in hl_fw_send_cpu_message()
258 pkt = hl_cpu_accessible_dma_pool_alloc(hdev, len, &pkt_dma_addr); in hl_fw_send_cpu_message()
260 dev_err(hdev->dev, in hl_fw_send_cpu_message()
267 mutex_lock(&hdev->send_cpu_message_lock); in hl_fw_send_cpu_message()
270 if (hdev->disabled && !hdev->reset_info.in_compute_reset) { in hl_fw_send_cpu_message()
275 if (hdev->device_cpu_disabled) { in hl_fw_send_cpu_message()
292 hl_hw_queue_submit_bd(hdev, queue, hl_queue_inc_ptr(queue->pi), len, pkt_dma_addr); in hl_fw_send_cpu_message()
299 rc = hl_poll_timeout_memory(hdev, &pkt->fence, tmp, in hl_fw_send_cpu_message()
303 hl_hw_queue_inc_ci_kernel(hdev, hw_queue_id); in hl_fw_send_cpu_message()
309 if (!hl_device_operational(hdev, NULL) && !hdev->reset_info.in_compute_reset) in hl_fw_send_cpu_message()
310 dev_dbg(hdev->dev, "Device CPU packet timeout (0x%x) due to FW reset\n", in hl_fw_send_cpu_message()
313 dev_err(hdev->dev, "Device CPU packet timeout (0x%x)\n", tmp); in hl_fw_send_cpu_message()
314 hdev->device_cpu_disabled = true; in hl_fw_send_cpu_message()
325 dev_dbg(hdev->dev, "F/W ERROR %d for CPU packet %d\n", rc, opcode); in hl_fw_send_cpu_message()
331 dev_err(hdev->dev, in hl_fw_send_cpu_message()
335 dev_err(hdev->dev, in hl_fw_send_cpu_message()
339 dev_dbg(hdev->dev, in hl_fw_send_cpu_message()
343 dev_err(hdev->dev, in hl_fw_send_cpu_message()
348 dev_err(hdev->dev, in hl_fw_send_cpu_message()
372 mutex_unlock(&hdev->send_cpu_message_lock); in hl_fw_send_cpu_message()
374 hl_cpu_accessible_dma_pool_free(hdev, len, pkt); in hl_fw_send_cpu_message()
379 int hl_fw_unmask_irq(struct hl_device *hdev, u16 event_type) in hl_fw_unmask_irq() argument
391 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), in hl_fw_unmask_irq()
395 dev_err(hdev->dev, "failed to unmask RAZWI IRQ %d", event_type); in hl_fw_unmask_irq()
400 int hl_fw_unmask_irq_arr(struct hl_device *hdev, const u32 *irq_arr, in hl_fw_unmask_irq_arr() argument
416 dev_err(hdev->dev, "too many elements in IRQ array\n"); in hl_fw_unmask_irq_arr()
430 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) pkt, in hl_fw_unmask_irq_arr()
434 dev_err(hdev->dev, "failed to unmask IRQ array\n"); in hl_fw_unmask_irq_arr()
441 int hl_fw_test_cpu_queue(struct hl_device *hdev) in hl_fw_test_cpu_queue() argument
451 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &test_pkt, in hl_fw_test_cpu_queue()
456 dev_err(hdev->dev, in hl_fw_test_cpu_queue()
459 dev_err(hdev->dev, "CPU queue test failed, error %d\n", rc); in hl_fw_test_cpu_queue()
465 void *hl_fw_cpu_accessible_dma_pool_alloc(struct hl_device *hdev, size_t size, in hl_fw_cpu_accessible_dma_pool_alloc() argument
470 kernel_addr = gen_pool_alloc(hdev->cpu_accessible_dma_pool, size); in hl_fw_cpu_accessible_dma_pool_alloc()
472 *dma_handle = hdev->cpu_accessible_dma_address + in hl_fw_cpu_accessible_dma_pool_alloc()
473 (kernel_addr - (u64) (uintptr_t) hdev->cpu_accessible_dma_mem); in hl_fw_cpu_accessible_dma_pool_alloc()
478 void hl_fw_cpu_accessible_dma_pool_free(struct hl_device *hdev, size_t size, in hl_fw_cpu_accessible_dma_pool_free() argument
481 gen_pool_free(hdev->cpu_accessible_dma_pool, (u64) (uintptr_t) vaddr, in hl_fw_cpu_accessible_dma_pool_free()
485 int hl_fw_send_device_activity(struct hl_device *hdev, bool open) in hl_fw_send_device_activity() argument
493 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), 0, NULL); in hl_fw_send_device_activity()
495 dev_err(hdev->dev, "failed to send device activity msg(%u)\n", open); in hl_fw_send_device_activity()
500 int hl_fw_send_heartbeat(struct hl_device *hdev) in hl_fw_send_heartbeat() argument
511 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &hb_pkt, in hl_fw_send_heartbeat()
519 dev_warn(hdev->dev, "FW reported EQ fault during heartbeat\n"); in hl_fw_send_heartbeat()
526 static bool fw_report_boot_dev0(struct hl_device *hdev, u32 err_val, in fw_report_boot_dev0() argument
535 dev_err(hdev->dev, in fw_report_boot_dev0()
541 dev_err(hdev->dev, "Device boot error - FIT image corrupted\n"); in fw_report_boot_dev0()
546 dev_err(hdev->dev, in fw_report_boot_dev0()
552 if (hdev->bmc_enable) { in fw_report_boot_dev0()
553 dev_err(hdev->dev, in fw_report_boot_dev0()
557 dev_info(hdev->dev, in fw_report_boot_dev0()
567 dev_err(hdev->dev, in fw_report_boot_dev0()
573 dev_err(hdev->dev, in fw_report_boot_dev0()
579 dev_err(hdev->dev, in fw_report_boot_dev0()
585 dev_err(hdev->dev, "Device boot error - security failure\n"); in fw_report_boot_dev0()
590 dev_err(hdev->dev, "Device boot error - eFuse failure\n"); in fw_report_boot_dev0()
595 dev_err(hdev->dev, "Device boot error - Failed to load preboot secondary image\n"); in fw_report_boot_dev0()
600 dev_err(hdev->dev, "Device boot error - PLL failure\n"); in fw_report_boot_dev0()
606 dev_dbg(hdev->dev, "device unusable status is set\n"); in fw_report_boot_dev0()
611 dev_err(hdev->dev, "Device boot error - binning failure\n"); in fw_report_boot_dev0()
616 dev_dbg(hdev->dev, "Device status0 %#x\n", sts_val); in fw_report_boot_dev0()
620 dev_warn(hdev->dev, in fw_report_boot_dev0()
629 dev_warn(hdev->dev, in fw_report_boot_dev0()
638 dev_warn(hdev->dev, in fw_report_boot_dev0()
647 dev_warn(hdev->dev, in fw_report_boot_dev0()
656 dev_err(hdev->dev, in fw_report_boot_dev0()
663 lower_32_bits(hdev->boot_error_status_mask))) in fw_report_boot_dev0()
670 static bool fw_report_boot_dev1(struct hl_device *hdev, u32 err_val, in fw_report_boot_dev1() argument
684 dev_dbg(hdev->dev, "Device status1 %#x\n", sts_val); in fw_report_boot_dev1()
687 dev_err(hdev->dev, in fw_report_boot_dev1()
695 upper_32_bits(hdev->boot_error_status_mask))) in fw_report_boot_dev1()
701 static int fw_read_errors(struct hl_device *hdev, u32 boot_err0_reg, in fw_read_errors() argument
719 err_exists = fw_report_boot_dev0(hdev, err_val, status_val); in fw_read_errors()
723 err_exists |= fw_report_boot_dev1(hdev, err_val, status_val); in fw_read_errors()
731 int hl_fw_cpucp_info_get(struct hl_device *hdev, in hl_fw_cpucp_info_get() argument
736 struct asic_fixed_properties *prop = &hdev->asic_prop; in hl_fw_cpucp_info_get()
744 cpucp_info_cpu_addr = hl_cpu_accessible_dma_pool_alloc(hdev, sizeof(struct cpucp_info), in hl_fw_cpucp_info_get()
747 dev_err(hdev->dev, in hl_fw_cpucp_info_get()
759 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), in hl_fw_cpucp_info_get()
762 dev_err(hdev->dev, in hl_fw_cpucp_info_get()
767 rc = fw_read_errors(hdev, boot_err0_reg, boot_err1_reg, in hl_fw_cpucp_info_get()
770 dev_err(hdev->dev, "Errors in device boot\n"); in hl_fw_cpucp_info_get()
777 rc = hl_build_hwmon_channel_info(hdev, prop->cpucp_info.sensors); in hl_fw_cpucp_info_get()
779 dev_err(hdev->dev, in hl_fw_cpucp_info_get()
787 dev_info(hdev->dev, "Linux version %s", kernel_ver); in hl_fw_cpucp_info_get()
792 hdev->event_queue.check_eqe_index = false; in hl_fw_cpucp_info_get()
799 hdev->event_queue.check_eqe_index = true; in hl_fw_cpucp_info_get()
806 hl_cpu_accessible_dma_pool_free(hdev, sizeof(struct cpucp_info), cpucp_info_cpu_addr); in hl_fw_cpucp_info_get()
811 static int hl_fw_send_msi_info_msg(struct hl_device *hdev) in hl_fw_send_msi_info_msg() argument
819 if (!hdev->asic_funcs->get_msi_info) in hl_fw_send_msi_info_msg()
830 dev_err(hdev->dev, "CPUCP array data is too big\n"); in hl_fw_send_msi_info_msg()
841 hdev->asic_funcs->get_msi_info(pkt->data); in hl_fw_send_msi_info_msg()
846 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *)pkt, in hl_fw_send_msi_info_msg()
858 dev_err(hdev->dev, "failed to send CPUCP array data\n"); in hl_fw_send_msi_info_msg()
865 int hl_fw_cpucp_handshake(struct hl_device *hdev, in hl_fw_cpucp_handshake() argument
872 rc = hl_fw_cpucp_info_get(hdev, sts_boot_dev_sts0_reg, in hl_fw_cpucp_handshake()
878 return hl_fw_send_msi_info_msg(hdev); in hl_fw_cpucp_handshake()
881 int hl_fw_get_eeprom_data(struct hl_device *hdev, void *data, size_t max_size) in hl_fw_get_eeprom_data() argument
889 eeprom_info_cpu_addr = hl_cpu_accessible_dma_pool_alloc(hdev, max_size, in hl_fw_get_eeprom_data()
892 dev_err(hdev->dev, in hl_fw_get_eeprom_data()
904 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), in hl_fw_get_eeprom_data()
908 dev_err(hdev->dev, in hl_fw_get_eeprom_data()
918 hl_cpu_accessible_dma_pool_free(hdev, max_size, eeprom_info_cpu_addr); in hl_fw_get_eeprom_data()
923 int hl_fw_get_monitor_dump(struct hl_device *hdev, void *data) in hl_fw_get_monitor_dump() argument
935 mon_dump_cpu_addr = hl_cpu_accessible_dma_pool_alloc(hdev, data_size, &mon_dump_dma_addr); in hl_fw_get_monitor_dump()
937 dev_err(hdev->dev, in hl_fw_get_monitor_dump()
948 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), in hl_fw_get_monitor_dump()
951 dev_err(hdev->dev, "Failed to handle CPU-CP monitor-dump packet, error %d\n", rc); in hl_fw_get_monitor_dump()
965 hl_cpu_accessible_dma_pool_free(hdev, data_size, mon_dump_cpu_addr); in hl_fw_get_monitor_dump()
970 int hl_fw_cpucp_pci_counters_get(struct hl_device *hdev, in hl_fw_cpucp_pci_counters_get() argument
982 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), in hl_fw_cpucp_pci_counters_get()
985 dev_err(hdev->dev, in hl_fw_cpucp_pci_counters_get()
997 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), in hl_fw_cpucp_pci_counters_get()
1000 dev_err(hdev->dev, in hl_fw_cpucp_pci_counters_get()
1011 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), in hl_fw_cpucp_pci_counters_get()
1014 dev_err(hdev->dev, in hl_fw_cpucp_pci_counters_get()
1023 int hl_fw_cpucp_total_energy_get(struct hl_device *hdev, u64 *total_energy) in hl_fw_cpucp_total_energy_get() argument
1032 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), in hl_fw_cpucp_total_energy_get()
1035 dev_err(hdev->dev, in hl_fw_cpucp_total_energy_get()
1046 int get_used_pll_index(struct hl_device *hdev, u32 input_pll_index, in get_used_pll_index() argument
1049 struct asic_fixed_properties *prop = &hdev->asic_prop; in get_used_pll_index()
1070 fw_pll_idx = hdev->asic_funcs->map_pll_idx_to_fw_idx(input_pll_index); in get_used_pll_index()
1072 dev_err(hdev->dev, "Invalid PLL index (%u) error %d\n", in get_used_pll_index()
1082 dev_err(hdev->dev, "PLL index %d is not supported\n", in get_used_pll_index()
1092 int hl_fw_cpucp_pll_info_get(struct hl_device *hdev, u32 pll_index, in hl_fw_cpucp_pll_info_get() argument
1100 rc = get_used_pll_index(hdev, pll_index, &used_pll_idx); in hl_fw_cpucp_pll_info_get()
1110 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), in hl_fw_cpucp_pll_info_get()
1113 dev_err(hdev->dev, "Failed to read PLL info, error %d\n", rc); in hl_fw_cpucp_pll_info_get()
1125 int hl_fw_cpucp_power_get(struct hl_device *hdev, u64 *power) in hl_fw_cpucp_power_get() argument
1137 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), in hl_fw_cpucp_power_get()
1140 dev_err(hdev->dev, "Failed to read power, error %d\n", rc); in hl_fw_cpucp_power_get()
1149 int hl_fw_dram_replaced_row_get(struct hl_device *hdev, in hl_fw_dram_replaced_row_get() argument
1158 cpucp_repl_rows_info_cpu_addr = hl_cpu_accessible_dma_pool_alloc(hdev, in hl_fw_dram_replaced_row_get()
1162 dev_err(hdev->dev, in hl_fw_dram_replaced_row_get()
1174 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), in hl_fw_dram_replaced_row_get()
1177 dev_err(hdev->dev, in hl_fw_dram_replaced_row_get()
1185 hl_cpu_accessible_dma_pool_free(hdev, sizeof(struct cpucp_hbm_row_info), in hl_fw_dram_replaced_row_get()
1191 int hl_fw_dram_pending_row_get(struct hl_device *hdev, u32 *pend_rows_num) in hl_fw_dram_pending_row_get() argument
1201 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), 0, &result); in hl_fw_dram_pending_row_get()
1203 dev_err(hdev->dev, in hl_fw_dram_pending_row_get()
1213 int hl_fw_cpucp_engine_core_asid_set(struct hl_device *hdev, u32 asid) in hl_fw_cpucp_engine_core_asid_set() argument
1223 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), in hl_fw_cpucp_engine_core_asid_set()
1226 dev_err(hdev->dev, in hl_fw_cpucp_engine_core_asid_set()
1233 void hl_fw_ask_hard_reset_without_linux(struct hl_device *hdev) in hl_fw_ask_hard_reset_without_linux() argument
1236 &hdev->fw_loader.static_loader; in hl_fw_ask_hard_reset_without_linux()
1239 if (hdev->asic_prop.dynamic_fw_load) { in hl_fw_ask_hard_reset_without_linux()
1240 rc = hl_fw_dynamic_send_protocol_cmd(hdev, &hdev->fw_loader, in hl_fw_ask_hard_reset_without_linux()
1242 hdev->fw_loader.cpu_timeout); in hl_fw_ask_hard_reset_without_linux()
1244 dev_warn(hdev->dev, "Failed sending COMMS_RST_DEV\n"); in hl_fw_ask_hard_reset_without_linux()
1250 void hl_fw_ask_halt_machine_without_linux(struct hl_device *hdev) in hl_fw_ask_halt_machine_without_linux() argument
1253 &hdev->fw_loader.static_loader; in hl_fw_ask_halt_machine_without_linux()
1256 if (hdev->device_cpu_is_halted) in hl_fw_ask_halt_machine_without_linux()
1260 if (hdev->asic_prop.dynamic_fw_load) { in hl_fw_ask_halt_machine_without_linux()
1261 rc = hl_fw_dynamic_send_protocol_cmd(hdev, &hdev->fw_loader, in hl_fw_ask_halt_machine_without_linux()
1263 hdev->fw_loader.cpu_timeout); in hl_fw_ask_halt_machine_without_linux()
1265 dev_warn(hdev->dev, "Failed sending COMMS_GOTO_WFE\n"); in hl_fw_ask_halt_machine_without_linux()
1276 hdev->device_cpu_is_halted = true; in hl_fw_ask_halt_machine_without_linux()
1279 static void detect_cpu_boot_status(struct hl_device *hdev, u32 status) in detect_cpu_boot_status() argument
1286 dev_err(hdev->dev, in detect_cpu_boot_status()
1290 dev_err(hdev->dev, in detect_cpu_boot_status()
1294 dev_err(hdev->dev, in detect_cpu_boot_status()
1298 dev_err(hdev->dev, in detect_cpu_boot_status()
1302 dev_err(hdev->dev, in detect_cpu_boot_status()
1306 dev_err(hdev->dev, in detect_cpu_boot_status()
1310 dev_err(hdev->dev, in detect_cpu_boot_status()
1314 dev_err(hdev->dev, in detect_cpu_boot_status()
1318 dev_err(hdev->dev, in detect_cpu_boot_status()
1322 dev_err(hdev->dev, in detect_cpu_boot_status()
1326 dev_err(hdev->dev, in detect_cpu_boot_status()
1333 static int hl_fw_wait_preboot_ready(struct hl_device *hdev) in hl_fw_wait_preboot_ready() argument
1335 struct pre_fw_load_props *pre_fw_load = &hdev->fw_loader.pre_fw_load; in hl_fw_wait_preboot_ready()
1348 hdev, in hl_fw_wait_preboot_ready()
1354 hdev->fw_poll_interval_usec, in hl_fw_wait_preboot_ready()
1358 dev_err(hdev->dev, "CPU boot ready status timeout\n"); in hl_fw_wait_preboot_ready()
1359 detect_cpu_boot_status(hdev, status); in hl_fw_wait_preboot_ready()
1365 fw_read_errors(hdev, pre_fw_load->boot_err0_reg, in hl_fw_wait_preboot_ready()
1372 hdev->fw_loader.fw_comp_loaded |= FW_TYPE_PREBOOT_CPU; in hl_fw_wait_preboot_ready()
1377 static int hl_fw_read_preboot_caps(struct hl_device *hdev) in hl_fw_read_preboot_caps() argument
1384 prop = &hdev->asic_prop; in hl_fw_read_preboot_caps()
1385 pre_fw_load = &hdev->fw_loader.pre_fw_load; in hl_fw_read_preboot_caps()
1387 rc = hl_fw_wait_preboot_ready(hdev); in hl_fw_read_preboot_caps()
1417 hdev->asic_funcs->init_firmware_loader(hdev); in hl_fw_read_preboot_caps()
1419 dev_dbg(hdev->dev, "Attempting %s FW load\n", in hl_fw_read_preboot_caps()
1424 static int hl_fw_static_read_device_fw_version(struct hl_device *hdev, in hl_fw_static_read_device_fw_version() argument
1427 struct asic_fixed_properties *prop = &hdev->asic_prop; in hl_fw_static_read_device_fw_version()
1428 struct fw_load_mgr *fw_loader = &hdev->fw_loader; in hl_fw_static_read_device_fw_version()
1435 static_loader = &hdev->fw_loader.static_loader; in hl_fw_static_read_device_fw_version()
1451 dev_warn(hdev->dev, "Undefined FW component: %d\n", fwc); in hl_fw_static_read_device_fw_version()
1459 hdev->pcie_bar[fw_loader->sram_bar_id] + ver_off, in hl_fw_static_read_device_fw_version()
1462 dev_err(hdev->dev, "%s version offset (0x%x) is above SRAM\n", in hl_fw_static_read_device_fw_version()
1471 dev_info(hdev->dev, "boot-fit version %s\n", boot_ver); in hl_fw_static_read_device_fw_version()
1481 dev_info(hdev->dev, "%s\n", btl_ver); in hl_fw_static_read_device_fw_version()
1486 dev_info(hdev->dev, "preboot version %s\n", in hl_fw_static_read_device_fw_version()
1504 static void hl_fw_preboot_update_state(struct hl_device *hdev) in hl_fw_preboot_update_state() argument
1506 struct asic_fixed_properties *prop = &hdev->asic_prop; in hl_fw_preboot_update_state()
1525 dev_dbg(hdev->dev, "Firmware preboot boot device status0 %#x\n", in hl_fw_preboot_update_state()
1528 dev_dbg(hdev->dev, "Firmware preboot boot device status1 %#x\n", in hl_fw_preboot_update_state()
1531 dev_dbg(hdev->dev, "Firmware preboot hard-reset is %s\n", in hl_fw_preboot_update_state()
1534 dev_dbg(hdev->dev, "firmware-level security is %s\n", in hl_fw_preboot_update_state()
1537 dev_dbg(hdev->dev, "GIC controller is %s\n", in hl_fw_preboot_update_state()
1541 static int hl_fw_static_read_preboot_status(struct hl_device *hdev) in hl_fw_static_read_preboot_status() argument
1545 rc = hl_fw_static_read_device_fw_version(hdev, FW_COMP_PREBOOT); in hl_fw_static_read_preboot_status()
1552 int hl_fw_read_preboot_status(struct hl_device *hdev) in hl_fw_read_preboot_status() argument
1556 if (!(hdev->fw_components & FW_TYPE_PREBOOT_CPU)) in hl_fw_read_preboot_status()
1560 hdev->asic_funcs->init_firmware_preload_params(hdev); in hl_fw_read_preboot_status()
1566 rc = hl_fw_read_preboot_caps(hdev); in hl_fw_read_preboot_status()
1570 hl_fw_preboot_update_state(hdev); in hl_fw_read_preboot_status()
1573 if (hdev->asic_prop.dynamic_fw_load) in hl_fw_read_preboot_status()
1576 return hl_fw_static_read_preboot_status(hdev); in hl_fw_read_preboot_status()
1596 static void hl_fw_dynamic_report_error_status(struct hl_device *hdev, in hl_fw_dynamic_report_error_status() argument
1604 dev_err(hdev->dev, "Device status %s, expected status: %s\n", in hl_fw_dynamic_report_error_status()
1608 dev_err(hdev->dev, "Device status unknown %d, expected status: %s\n", in hl_fw_dynamic_report_error_status()
1627 static void hl_fw_dynamic_send_cmd(struct hl_device *hdev, in hl_fw_dynamic_send_cmd() argument
1652 static int hl_fw_dynamic_extract_fw_response(struct hl_device *hdev, in hl_fw_dynamic_extract_fw_response() argument
1664 dev_err(hdev->dev, "FW status: invalid RAM type %u\n", in hl_fw_dynamic_extract_fw_response()
1685 static int hl_fw_dynamic_wait_for_status(struct hl_device *hdev, in hl_fw_dynamic_wait_for_status() argument
1698 hdev, in hl_fw_dynamic_wait_for_status()
1702 hdev->fw_comms_poll_interval_usec, in hl_fw_dynamic_wait_for_status()
1706 hl_fw_dynamic_report_error_status(hdev, status, in hl_fw_dynamic_wait_for_status()
1718 rc = hl_fw_dynamic_extract_fw_response(hdev, fw_loader, in hl_fw_dynamic_wait_for_status()
1738 static int hl_fw_dynamic_send_clear_cmd(struct hl_device *hdev, in hl_fw_dynamic_send_clear_cmd() argument
1741 hl_fw_dynamic_send_cmd(hdev, fw_loader, COMMS_CLR_STS, 0); in hl_fw_dynamic_send_clear_cmd()
1743 return hl_fw_dynamic_wait_for_status(hdev, fw_loader, COMMS_STS_NOOP, in hl_fw_dynamic_send_clear_cmd()
1776 int hl_fw_dynamic_send_protocol_cmd(struct hl_device *hdev, in hl_fw_dynamic_send_protocol_cmd() argument
1784 rc = hl_fw_dynamic_send_clear_cmd(hdev, fw_loader); in hl_fw_dynamic_send_protocol_cmd()
1787 hl_fw_dynamic_send_cmd(hdev, fw_loader, cmd, size); in hl_fw_dynamic_send_protocol_cmd()
1790 rc = hl_fw_dynamic_wait_for_status(hdev, fw_loader, COMMS_STS_ACK, in hl_fw_dynamic_send_protocol_cmd()
1796 rc = hl_fw_dynamic_send_clear_cmd(hdev, fw_loader); in hl_fw_dynamic_send_protocol_cmd()
1801 hl_fw_dynamic_send_cmd(hdev, fw_loader, COMMS_NOOP, 0); in hl_fw_dynamic_send_protocol_cmd()
1806 rc = hl_fw_dynamic_wait_for_status(hdev, fw_loader, COMMS_STS_OK, in hl_fw_dynamic_send_protocol_cmd()
1812 rc = hl_fw_dynamic_send_clear_cmd(hdev, fw_loader); in hl_fw_dynamic_send_protocol_cmd()
1817 hl_fw_dynamic_send_cmd(hdev, fw_loader, COMMS_NOOP, 0); in hl_fw_dynamic_send_protocol_cmd()
1852 static int hl_fw_dynamic_validate_memory_bound(struct hl_device *hdev, in hl_fw_dynamic_validate_memory_bound() argument
1861 dev_err(hdev->dev, in hl_fw_dynamic_validate_memory_bound()
1874 dev_err(hdev->dev, in hl_fw_dynamic_validate_memory_bound()
1891 static int hl_fw_dynamic_validate_descriptor(struct hl_device *hdev, in hl_fw_dynamic_validate_descriptor() argument
1904 dev_warn(hdev->dev, "Invalid magic for dynamic FW descriptor (%x)\n", in hl_fw_dynamic_validate_descriptor()
1908 dev_warn(hdev->dev, "Invalid version for dynamic FW descriptor (%x)\n", in hl_fw_dynamic_validate_descriptor()
1923 dev_err(hdev->dev, "CRC32 mismatch for dynamic FW descriptor (%x:%x)\n", in hl_fw_dynamic_validate_descriptor()
1930 region_id = hl_get_pci_memory_region(hdev, addr); in hl_fw_dynamic_validate_descriptor()
1932 dev_err(hdev->dev, "Invalid region to copy FW image address=%llx\n", addr); in hl_fw_dynamic_validate_descriptor()
1936 region = &hdev->pci_mem_region[region_id]; in hl_fw_dynamic_validate_descriptor()
1945 rc = hl_fw_dynamic_validate_memory_bound(hdev, addr, in hl_fw_dynamic_validate_descriptor()
1949 dev_err(hdev->dev, "invalid mem transfer request for FW image\n"); in hl_fw_dynamic_validate_descriptor()
1959 static int hl_fw_dynamic_validate_response(struct hl_device *hdev, in hl_fw_dynamic_validate_response() argument
1973 rc = hl_fw_dynamic_validate_memory_bound(hdev, device_addr, in hl_fw_dynamic_validate_response()
1987 static int hl_fw_dynamic_read_and_validate_descriptor(struct hl_device *hdev, in hl_fw_dynamic_read_and_validate_descriptor() argument
2003 region = &hdev->pci_mem_region[region_id]; in hl_fw_dynamic_read_and_validate_descriptor()
2005 rc = hl_fw_dynamic_validate_response(hdev, response, region); in hl_fw_dynamic_read_and_validate_descriptor()
2007 dev_err(hdev->dev, in hl_fw_dynamic_read_and_validate_descriptor()
2019 src = hdev->pcie_bar[region->bar_id] + region->offset_in_bar + in hl_fw_dynamic_read_and_validate_descriptor()
2023 return hl_fw_dynamic_validate_descriptor(hdev, fw_loader, fw_desc); in hl_fw_dynamic_read_and_validate_descriptor()
2035 static int hl_fw_dynamic_request_descriptor(struct hl_device *hdev, in hl_fw_dynamic_request_descriptor() argument
2041 rc = hl_fw_dynamic_send_protocol_cmd(hdev, fw_loader, COMMS_PREP_DESC, in hl_fw_dynamic_request_descriptor()
2047 return hl_fw_dynamic_read_and_validate_descriptor(hdev, fw_loader); in hl_fw_dynamic_request_descriptor()
2057 static int hl_fw_dynamic_read_device_fw_version(struct hl_device *hdev, in hl_fw_dynamic_read_device_fw_version() argument
2061 struct asic_fixed_properties *prop = &hdev->asic_prop; in hl_fw_dynamic_read_device_fw_version()
2070 dev_info(hdev->dev, "boot-fit version %s\n", boot_ver); in hl_fw_dynamic_read_device_fw_version()
2082 dev_info(hdev->dev, "%s\n", btl_ver); in hl_fw_dynamic_read_device_fw_version()
2089 dev_info(hdev->dev, "preboot version %s\n", preboot_ver); in hl_fw_dynamic_read_device_fw_version()
2092 rc = extract_fw_sub_versions(hdev, preboot_ver); in hl_fw_dynamic_read_device_fw_version()
2099 dev_warn(hdev->dev, "Undefined FW component: %d\n", fwc); in hl_fw_dynamic_read_device_fw_version()
2113 static int hl_fw_dynamic_copy_image(struct hl_device *hdev, in hl_fw_dynamic_copy_image() argument
2129 dest = hdev->pcie_bar[region->bar_id] + region->offset_in_bar + in hl_fw_dynamic_copy_image()
2132 rc = hl_fw_copy_fw_to_device(hdev, fw, dest, in hl_fw_dynamic_copy_image()
2146 static int hl_fw_dynamic_copy_msg(struct hl_device *hdev, in hl_fw_dynamic_copy_msg() argument
2161 dest = hdev->pcie_bar[region->bar_id] + region->offset_in_bar + in hl_fw_dynamic_copy_msg()
2164 rc = hl_fw_copy_msg_to_device(hdev, msg, dest, 0, 0); in hl_fw_dynamic_copy_msg()
2179 static void hl_fw_boot_fit_update_state(struct hl_device *hdev, in hl_fw_boot_fit_update_state() argument
2183 struct asic_fixed_properties *prop = &hdev->asic_prop; in hl_fw_boot_fit_update_state()
2185 hdev->fw_loader.fw_comp_loaded |= FW_TYPE_BOOT_CPU; in hl_fw_boot_fit_update_state()
2195 dev_dbg(hdev->dev, "Firmware boot CPU status0 %#x\n", in hl_fw_boot_fit_update_state()
2203 dev_dbg(hdev->dev, "Firmware boot CPU status1 %#x\n", in hl_fw_boot_fit_update_state()
2207 dev_dbg(hdev->dev, "Firmware boot CPU hard-reset is %s\n", in hl_fw_boot_fit_update_state()
2211 static void hl_fw_dynamic_update_linux_interrupt_if(struct hl_device *hdev) in hl_fw_dynamic_update_linux_interrupt_if() argument
2214 &hdev->fw_loader.dynamic_loader.comm_desc.cpu_dyn_regs; in hl_fw_dynamic_update_linux_interrupt_if()
2219 if (!hdev->asic_prop.gic_interrupts_enable && in hl_fw_dynamic_update_linux_interrupt_if()
2220 !(hdev->asic_prop.fw_app_cpu_boot_dev_sts0 & in hl_fw_dynamic_update_linux_interrupt_if()
2225 dev_warn(hdev->dev, in hl_fw_dynamic_update_linux_interrupt_if()
2239 static int hl_fw_dynamic_load_image(struct hl_device *hdev, in hl_fw_dynamic_load_image() argument
2263 rc = hl_request_fw(hdev, &fw, fw_name); in hl_fw_dynamic_load_image()
2270 rc = hl_fw_dynamic_request_descriptor(hdev, fw_loader, fw->size); in hl_fw_dynamic_load_image()
2275 rc = hl_fw_dynamic_read_device_fw_version(hdev, cur_fwc, in hl_fw_dynamic_load_image()
2285 hl_fw_boot_fit_update_state(hdev, in hl_fw_dynamic_load_image()
2291 rc = hl_fw_dynamic_copy_image(hdev, fw, fw_loader); in hl_fw_dynamic_load_image()
2295 rc = hl_fw_dynamic_send_protocol_cmd(hdev, fw_loader, COMMS_DATA_RDY, in hl_fw_dynamic_load_image()
2301 rc = hl_fw_dynamic_send_protocol_cmd(hdev, fw_loader, COMMS_EXEC, in hl_fw_dynamic_load_image()
2310 static int hl_fw_dynamic_wait_for_boot_fit_active(struct hl_device *hdev, in hl_fw_dynamic_wait_for_boot_fit_active() argument
2328 hdev, in hl_fw_dynamic_wait_for_boot_fit_active()
2333 hdev->fw_poll_interval_usec, in hl_fw_dynamic_wait_for_boot_fit_active()
2336 dev_err(hdev->dev, "failed to wait for boot\n"); in hl_fw_dynamic_wait_for_boot_fit_active()
2340 dev_dbg(hdev->dev, "uboot status = %d\n", status); in hl_fw_dynamic_wait_for_boot_fit_active()
2344 static int hl_fw_dynamic_wait_for_linux_active(struct hl_device *hdev, in hl_fw_dynamic_wait_for_linux_active() argument
2356 hdev, in hl_fw_dynamic_wait_for_linux_active()
2360 hdev->fw_poll_interval_usec, in hl_fw_dynamic_wait_for_linux_active()
2363 dev_err(hdev->dev, "failed to wait for Linux\n"); in hl_fw_dynamic_wait_for_linux_active()
2367 dev_dbg(hdev->dev, "Boot status = %d\n", status); in hl_fw_dynamic_wait_for_linux_active()
2386 static void hl_fw_linux_update_state(struct hl_device *hdev, in hl_fw_linux_update_state() argument
2390 struct asic_fixed_properties *prop = &hdev->asic_prop; in hl_fw_linux_update_state()
2392 hdev->fw_loader.fw_comp_loaded |= FW_TYPE_LINUX; in hl_fw_linux_update_state()
2405 dev_dbg(hdev->dev, in hl_fw_linux_update_state()
2409 dev_dbg(hdev->dev, "GIC controller is %s\n", in hl_fw_linux_update_state()
2417 dev_dbg(hdev->dev, in hl_fw_linux_update_state()
2422 dev_dbg(hdev->dev, "Firmware application CPU hard-reset is %s\n", in hl_fw_linux_update_state()
2425 dev_info(hdev->dev, "Successfully loaded firmware to device\n"); in hl_fw_linux_update_state()
2438 static int hl_fw_dynamic_send_msg(struct hl_device *hdev, in hl_fw_dynamic_send_msg() argument
2457 dev_err(hdev->dev, in hl_fw_dynamic_send_msg()
2463 rc = hl_fw_dynamic_request_descriptor(hdev, fw_loader, in hl_fw_dynamic_send_msg()
2469 rc = hl_fw_dynamic_copy_msg(hdev, &msg, fw_loader); in hl_fw_dynamic_send_msg()
2473 rc = hl_fw_dynamic_send_protocol_cmd(hdev, fw_loader, COMMS_DATA_RDY, in hl_fw_dynamic_send_msg()
2479 rc = hl_fw_dynamic_send_protocol_cmd(hdev, fw_loader, COMMS_EXEC, in hl_fw_dynamic_send_msg()
2506 static int hl_fw_dynamic_init_cpu(struct hl_device *hdev, in hl_fw_dynamic_init_cpu() argument
2512 dev_info(hdev->dev, in hl_fw_dynamic_init_cpu()
2514 hdev->asic_prop.fw_security_enabled ? "secured " : ""); in hl_fw_dynamic_init_cpu()
2525 rc = hl_fw_dynamic_send_protocol_cmd(hdev, fw_loader, COMMS_RST_STATE, in hl_fw_dynamic_init_cpu()
2531 if (hdev->reset_info.curr_reset_cause) { in hl_fw_dynamic_init_cpu()
2532 rc = hl_fw_dynamic_send_msg(hdev, fw_loader, in hl_fw_dynamic_init_cpu()
2533 HL_COMMS_RESET_CAUSE_TYPE, &hdev->reset_info.curr_reset_cause); in hl_fw_dynamic_init_cpu()
2538 hdev->reset_info.curr_reset_cause = HL_RESET_CAUSE_UNKNOWN; in hl_fw_dynamic_init_cpu()
2541 if (!(hdev->fw_components & FW_TYPE_BOOT_CPU)) { in hl_fw_dynamic_init_cpu()
2542 rc = hl_fw_dynamic_request_descriptor(hdev, fw_loader, 0); in hl_fw_dynamic_init_cpu()
2547 return hl_fw_dynamic_read_device_fw_version(hdev, FW_COMP_PREBOOT, in hl_fw_dynamic_init_cpu()
2552 rc = hl_fw_dynamic_load_image(hdev, fw_loader, FW_COMP_BOOT_FIT, in hl_fw_dynamic_init_cpu()
2555 dev_err(hdev->dev, "failed to load boot fit\n"); in hl_fw_dynamic_init_cpu()
2565 if (hdev->pldm && !(hdev->fw_components & FW_TYPE_LINUX)) in hl_fw_dynamic_init_cpu()
2568 rc = hl_fw_dynamic_wait_for_boot_fit_active(hdev, fw_loader); in hl_fw_dynamic_init_cpu()
2575 hdev->asic_funcs->init_cpu_scrambler_dram(hdev); in hl_fw_dynamic_init_cpu()
2577 if (!(hdev->fw_components & FW_TYPE_LINUX)) { in hl_fw_dynamic_init_cpu()
2578 dev_info(hdev->dev, "Skip loading Linux F/W\n"); in hl_fw_dynamic_init_cpu()
2583 rc = hl_fw_dynamic_send_protocol_cmd(hdev, fw_loader, in hl_fw_dynamic_init_cpu()
2588 dev_err(hdev->dev, "failed to load boot fit\n"); in hl_fw_dynamic_init_cpu()
2594 rc = hl_fw_dynamic_load_image(hdev, fw_loader, FW_COMP_LINUX, in hl_fw_dynamic_init_cpu()
2597 dev_err(hdev->dev, "failed to load Linux\n"); in hl_fw_dynamic_init_cpu()
2601 rc = hl_fw_dynamic_wait_for_linux_active(hdev, fw_loader); in hl_fw_dynamic_init_cpu()
2605 hl_fw_linux_update_state(hdev, le32_to_cpu(dyn_regs->cpu_boot_dev_sts0), in hl_fw_dynamic_init_cpu()
2608 hl_fw_dynamic_update_linux_interrupt_if(hdev); in hl_fw_dynamic_init_cpu()
2614 fw_read_errors(hdev, le32_to_cpu(dyn_regs->cpu_boot_err0), in hl_fw_dynamic_init_cpu()
2629 static int hl_fw_static_init_cpu(struct hl_device *hdev, in hl_fw_static_init_cpu() argument
2638 if (!(hdev->fw_components & FW_TYPE_BOOT_CPU)) in hl_fw_static_init_cpu()
2652 dev_info(hdev->dev, "Going to wait for device boot (up to %lds)\n", in hl_fw_static_init_cpu()
2657 hdev, in hl_fw_static_init_cpu()
2661 hdev->fw_poll_interval_usec, in hl_fw_static_init_cpu()
2665 dev_dbg(hdev->dev, in hl_fw_static_init_cpu()
2668 rc = hdev->asic_funcs->load_boot_fit_to_device(hdev); in hl_fw_static_init_cpu()
2680 hdev, in hl_fw_static_init_cpu()
2684 hdev->fw_poll_interval_usec, in hl_fw_static_init_cpu()
2688 dev_err(hdev->dev, in hl_fw_static_init_cpu()
2706 hdev, in hl_fw_static_init_cpu()
2713 hdev->fw_poll_interval_usec, in hl_fw_static_init_cpu()
2716 dev_dbg(hdev->dev, "uboot status = %d\n", status); in hl_fw_static_init_cpu()
2719 hl_fw_static_read_device_fw_version(hdev, FW_COMP_BOOT_FIT); in hl_fw_static_init_cpu()
2722 hl_fw_boot_fit_update_state(hdev, cpu_boot_dev_status0_reg, in hl_fw_static_init_cpu()
2726 detect_cpu_boot_status(hdev, status); in hl_fw_static_init_cpu()
2734 hdev->asic_funcs->init_cpu_scrambler_dram(hdev); in hl_fw_static_init_cpu()
2736 if (!(hdev->fw_components & FW_TYPE_LINUX)) { in hl_fw_static_init_cpu()
2737 dev_info(hdev->dev, "Skip loading Linux F/W\n"); in hl_fw_static_init_cpu()
2747 dev_info(hdev->dev, in hl_fw_static_init_cpu()
2750 rc = hdev->asic_funcs->load_firmware_to_device(hdev); in hl_fw_static_init_cpu()
2758 hdev, in hl_fw_static_init_cpu()
2762 hdev->fw_poll_interval_usec, in hl_fw_static_init_cpu()
2766 dev_err(hdev->dev, in hl_fw_static_init_cpu()
2778 hdev, in hl_fw_static_init_cpu()
2782 hdev->fw_poll_interval_usec, in hl_fw_static_init_cpu()
2790 dev_err(hdev->dev, in hl_fw_static_init_cpu()
2793 dev_err(hdev->dev, in hl_fw_static_init_cpu()
2801 rc = fw_read_errors(hdev, fw_loader->static_loader.boot_err0_reg, in hl_fw_static_init_cpu()
2808 hl_fw_linux_update_state(hdev, cpu_boot_dev_status0_reg, in hl_fw_static_init_cpu()
2814 fw_read_errors(hdev, fw_loader->static_loader.boot_err0_reg, in hl_fw_static_init_cpu()
2832 int hl_fw_init_cpu(struct hl_device *hdev) in hl_fw_init_cpu() argument
2834 struct asic_fixed_properties *prop = &hdev->asic_prop; in hl_fw_init_cpu()
2835 struct fw_load_mgr *fw_loader = &hdev->fw_loader; in hl_fw_init_cpu()
2838 hl_fw_dynamic_init_cpu(hdev, fw_loader) : in hl_fw_init_cpu()
2839 hl_fw_static_init_cpu(hdev, fw_loader); in hl_fw_init_cpu()
2842 void hl_fw_set_pll_profile(struct hl_device *hdev) in hl_fw_set_pll_profile() argument
2844 hl_fw_set_frequency(hdev, hdev->asic_prop.clk_pll_index, in hl_fw_set_pll_profile()
2845 hdev->asic_prop.max_freq_value); in hl_fw_set_pll_profile()
2848 int hl_fw_get_clk_rate(struct hl_device *hdev, u32 *cur_clk, u32 *max_clk) in hl_fw_get_clk_rate() argument
2852 if (!hl_device_operational(hdev, NULL)) in hl_fw_get_clk_rate()
2855 if (!hdev->pdev) { in hl_fw_get_clk_rate()
2861 value = hl_fw_get_frequency(hdev, hdev->asic_prop.clk_pll_index, false); in hl_fw_get_clk_rate()
2864 dev_err(hdev->dev, "Failed to retrieve device max clock %ld\n", value); in hl_fw_get_clk_rate()
2870 value = hl_fw_get_frequency(hdev, hdev->asic_prop.clk_pll_index, true); in hl_fw_get_clk_rate()
2873 dev_err(hdev->dev, "Failed to retrieve device current clock %ld\n", value); in hl_fw_get_clk_rate()
2882 long hl_fw_get_frequency(struct hl_device *hdev, u32 pll_index, bool curr) in hl_fw_get_frequency() argument
2889 rc = get_used_pll_index(hdev, pll_index, &used_pll_idx); in hl_fw_get_frequency()
2903 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), 0, &result); in hl_fw_get_frequency()
2906 dev_err(hdev->dev, "Failed to get frequency of PLL %d, error %d\n", in hl_fw_get_frequency()
2914 void hl_fw_set_frequency(struct hl_device *hdev, u32 pll_index, u64 freq) in hl_fw_set_frequency() argument
2920 rc = get_used_pll_index(hdev, pll_index, &used_pll_idx); in hl_fw_set_frequency()
2930 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), 0, NULL); in hl_fw_set_frequency()
2933 dev_err(hdev->dev, "Failed to set frequency to PLL %d, error %d\n", in hl_fw_set_frequency()
2937 long hl_fw_get_max_power(struct hl_device *hdev) in hl_fw_get_max_power() argument
2947 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), 0, &result); in hl_fw_get_max_power()
2950 dev_err(hdev->dev, "Failed to get max power, error %d\n", rc); in hl_fw_get_max_power()
2957 void hl_fw_set_max_power(struct hl_device *hdev) in hl_fw_set_max_power() argument
2963 if (!hdev->pdev) in hl_fw_set_max_power()
2969 pkt.value = cpu_to_le64(hdev->max_power); in hl_fw_set_max_power()
2971 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), 0, NULL); in hl_fw_set_max_power()
2974 dev_err(hdev->dev, "Failed to set max power, error %d\n", rc); in hl_fw_set_max_power()
2977 static int hl_fw_get_sec_attest_data(struct hl_device *hdev, u32 packet_id, void *data, u32 size, in hl_fw_get_sec_attest_data() argument
2985 req_cpu_addr = hl_cpu_accessible_dma_pool_alloc(hdev, size, &req_dma_addr); in hl_fw_get_sec_attest_data()
2987 dev_err(hdev->dev, in hl_fw_get_sec_attest_data()
2999 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), in hl_fw_get_sec_attest_data()
3002 dev_err(hdev->dev, in hl_fw_get_sec_attest_data()
3010 hl_cpu_accessible_dma_pool_free(hdev, size, req_cpu_addr); in hl_fw_get_sec_attest_data()
3015 int hl_fw_get_sec_attest_info(struct hl_device *hdev, struct cpucp_sec_attest_info *sec_attest_info, in hl_fw_get_sec_attest_info() argument
3018 return hl_fw_get_sec_attest_data(hdev, CPUCP_PACKET_SEC_ATTEST_GET, sec_attest_info, in hl_fw_get_sec_attest_info()