Lines Matching refs:hdev

15 	struct hl_device *hdev = dev_get_drvdata(dev);  in clk_max_freq_mhz_show()  local
18 if (!hl_device_operational(hdev, NULL)) in clk_max_freq_mhz_show()
21 value = hl_fw_get_frequency(hdev, hdev->asic_prop.clk_pll_index, false); in clk_max_freq_mhz_show()
25 hdev->asic_prop.max_freq_value = value; in clk_max_freq_mhz_show()
33 struct hl_device *hdev = dev_get_drvdata(dev); in clk_max_freq_mhz_store() local
37 if (!hl_device_operational(hdev, NULL)) { in clk_max_freq_mhz_store()
48 hdev->asic_prop.max_freq_value = value * 1000 * 1000; in clk_max_freq_mhz_store()
50 hl_fw_set_frequency(hdev, hdev->asic_prop.clk_pll_index, hdev->asic_prop.max_freq_value); in clk_max_freq_mhz_store()
58 struct hl_device *hdev = dev_get_drvdata(dev); in clk_cur_freq_mhz_show() local
61 if (!hl_device_operational(hdev, NULL)) in clk_cur_freq_mhz_show()
64 value = hl_fw_get_frequency(hdev, hdev->asic_prop.clk_pll_index, true); in clk_cur_freq_mhz_show()
82 struct hl_device *hdev = dev_get_drvdata(dev); in vrm_ver_show() local
90 cpucp_info = &hdev->asic_prop.cpucp_info; in vrm_ver_show()
119 struct hl_device *hdev = dev_get_drvdata(dev); in uboot_ver_show() local
121 return sprintf(buf, "%s\n", hdev->asic_prop.uboot_ver); in uboot_ver_show()
127 struct hl_device *hdev = dev_get_drvdata(dev); in armcp_kernel_ver_show() local
129 return sprintf(buf, "%s", hdev->asic_prop.cpucp_info.kernel_version); in armcp_kernel_ver_show()
135 struct hl_device *hdev = dev_get_drvdata(dev); in armcp_ver_show() local
137 return sprintf(buf, "%s\n", hdev->asic_prop.cpucp_info.cpucp_version); in armcp_ver_show()
143 struct hl_device *hdev = dev_get_drvdata(dev); in cpld_ver_show() local
146 le32_to_cpu(hdev->asic_prop.cpucp_info.cpld_timestamp), in cpld_ver_show()
147 le32_to_cpu(hdev->asic_prop.cpucp_info.cpld_version)); in cpld_ver_show()
153 struct hl_device *hdev = dev_get_drvdata(dev); in cpucp_kernel_ver_show() local
155 return sprintf(buf, "%s", hdev->asic_prop.cpucp_info.kernel_version); in cpucp_kernel_ver_show()
161 struct hl_device *hdev = dev_get_drvdata(dev); in cpucp_ver_show() local
163 return sprintf(buf, "%s\n", hdev->asic_prop.cpucp_info.cpucp_version); in cpucp_ver_show()
169 struct hl_device *hdev = dev_get_drvdata(dev); in fuse_ver_show() local
171 return sprintf(buf, "%s\n", hdev->asic_prop.cpucp_info.fuse_version); in fuse_ver_show()
177 struct hl_device *hdev = dev_get_drvdata(dev); in thermal_ver_show() local
179 return sprintf(buf, "%s", hdev->asic_prop.cpucp_info.thermal_version); in thermal_ver_show()
185 struct hl_device *hdev = dev_get_drvdata(dev); in fw_os_ver_show() local
187 return sprintf(buf, "%s", hdev->asic_prop.cpucp_info.fw_os_version); in fw_os_ver_show()
193 struct hl_device *hdev = dev_get_drvdata(dev); in preboot_btl_ver_show() local
195 return sprintf(buf, "%s\n", hdev->asic_prop.preboot_ver); in preboot_btl_ver_show()
202 struct hl_device *hdev = dev_get_drvdata(dev); in soft_reset_store() local
213 if (!hdev->asic_prop.allow_inference_soft_reset) { in soft_reset_store()
214 dev_err(hdev->dev, "Device does not support inference soft-reset\n"); in soft_reset_store()
218 dev_warn(hdev->dev, "Inference Soft-Reset requested through sysfs\n"); in soft_reset_store()
220 hl_device_reset(hdev, 0); in soft_reset_store()
230 struct hl_device *hdev = dev_get_drvdata(dev); in hard_reset_store() local
241 dev_warn(hdev->dev, "Hard-Reset requested through sysfs\n"); in hard_reset_store()
243 hl_device_reset(hdev, HL_DRV_RESET_HARD); in hard_reset_store()
252 struct hl_device *hdev = dev_get_drvdata(dev); in device_type_show() local
255 switch (hdev->asic_type) { in device_type_show()
278 dev_err(hdev->dev, "Unrecognized ASIC type %d\n", in device_type_show()
279 hdev->asic_type); in device_type_show()
289 struct hl_device *hdev = dev_get_drvdata(dev); in pci_addr_show() local
292 pci_domain_nr(hdev->pdev->bus), in pci_addr_show()
293 hdev->pdev->bus->number, in pci_addr_show()
294 PCI_SLOT(hdev->pdev->devfn), in pci_addr_show()
295 PCI_FUNC(hdev->pdev->devfn)); in pci_addr_show()
301 struct hl_device *hdev = dev_get_drvdata(dev); in status_show() local
304 strscpy(str, hdev->status[hl_device_status(hdev)], HL_STR_MAX); in status_show()
315 struct hl_device *hdev = dev_get_drvdata(dev); in soft_reset_cnt_show() local
317 return sprintf(buf, "%d\n", hdev->reset_info.compute_reset_cnt); in soft_reset_cnt_show()
323 struct hl_device *hdev = dev_get_drvdata(dev); in hard_reset_cnt_show() local
325 return sprintf(buf, "%d\n", hdev->reset_info.hard_reset_cnt); in hard_reset_cnt_show()
331 struct hl_device *hdev = dev_get_drvdata(dev); in max_power_show() local
334 if (!hl_device_operational(hdev, NULL)) in max_power_show()
337 val = hl_fw_get_max_power(hdev); in max_power_show()
347 struct hl_device *hdev = dev_get_drvdata(dev); in max_power_store() local
351 if (!hl_device_operational(hdev, NULL)) { in max_power_store()
363 hdev->max_power = value; in max_power_store()
364 hl_fw_set_max_power(hdev); in max_power_store()
375 struct hl_device *hdev = dev_get_drvdata(dev); in eeprom_read_handler() local
379 if (!hl_device_operational(hdev, NULL)) in eeprom_read_handler()
389 rc = hdev->asic_funcs->get_eeprom_data(hdev, data, max_size); in eeprom_read_handler()
404 struct hl_device *hdev = dev_get_drvdata(dev); in security_enabled_show() local
406 return sprintf(buf, "%d\n", hdev->asic_prop.fw_security_enabled); in security_enabled_show()
412 struct hl_device *hdev = dev_get_drvdata(dev); in module_id_show() local
414 return sprintf(buf, "%u\n", le32_to_cpu(hdev->asic_prop.cpucp_info.card_location)); in module_id_show()
419 struct hl_device *hdev = dev_get_drvdata(dev); in parent_device_show() local
421 return sprintf(buf, "%s\n", HL_DEV_NAME(hdev)); in parent_device_show()
510 void hl_sysfs_add_dev_clk_attr(struct hl_device *hdev, struct attribute_group *dev_clk_attr_grp) in hl_sysfs_add_dev_clk_attr() argument
515 void hl_sysfs_add_dev_vrm_attr(struct hl_device *hdev, struct attribute_group *dev_vrm_attr_grp) in hl_sysfs_add_dev_vrm_attr() argument
520 int hl_sysfs_init(struct hl_device *hdev) in hl_sysfs_init() argument
524 hdev->max_power = hdev->asic_prop.max_power_default; in hl_sysfs_init()
526 hdev->asic_funcs->add_device_attr(hdev, &hl_dev_clks_attr_group, &hl_dev_vrm_attr_group); in hl_sysfs_init()
528 rc = device_add_groups(hdev->dev, hl_dev_attr_groups); in hl_sysfs_init()
530 dev_err(hdev->dev, in hl_sysfs_init()
535 if (!hdev->asic_prop.allow_inference_soft_reset) in hl_sysfs_init()
538 rc = device_add_groups(hdev->dev, hl_dev_inference_attr_groups); in hl_sysfs_init()
540 dev_err(hdev->dev, in hl_sysfs_init()
548 device_remove_groups(hdev->dev, hl_dev_attr_groups); in hl_sysfs_init()
552 void hl_sysfs_fini(struct hl_device *hdev) in hl_sysfs_fini() argument
554 device_remove_groups(hdev->dev, hl_dev_attr_groups); in hl_sysfs_fini()
556 if (!hdev->asic_prop.allow_inference_soft_reset) in hl_sysfs_fini()
559 device_remove_groups(hdev->dev, hl_dev_inference_attr_groups); in hl_sysfs_fini()