Lines Matching defs:hdev

14 	struct hl_device *hdev = dev_get_drvdata(dev);
17 if (!hl_device_operational(hdev, NULL))
20 value = hl_fw_get_frequency(hdev, hdev->asic_prop.clk_pll_index, false);
24 hdev->asic_prop.max_freq_value = value;
32 struct hl_device *hdev = dev_get_drvdata(dev);
36 if (!hl_device_operational(hdev, NULL)) {
47 hdev->asic_prop.max_freq_value = value * 1000 * 1000;
49 hl_fw_set_frequency(hdev, hdev->asic_prop.clk_pll_index, hdev->asic_prop.max_freq_value);
57 struct hl_device *hdev = dev_get_drvdata(dev);
60 if (!hl_device_operational(hdev, NULL))
63 value = hl_fw_get_frequency(hdev, hdev->asic_prop.clk_pll_index, true);
81 struct hl_device *hdev = dev_get_drvdata(dev);
84 cpucp_info = &hdev->asic_prop.cpucp_info;
103 struct hl_device *hdev = dev_get_drvdata(dev);
105 return sprintf(buf, "%s\n", hdev->asic_prop.uboot_ver);
111 struct hl_device *hdev = dev_get_drvdata(dev);
113 return sprintf(buf, "%s", hdev->asic_prop.cpucp_info.kernel_version);
119 struct hl_device *hdev = dev_get_drvdata(dev);
121 return sprintf(buf, "%s\n", hdev->asic_prop.cpucp_info.cpucp_version);
127 struct hl_device *hdev = dev_get_drvdata(dev);
130 le32_to_cpu(hdev->asic_prop.cpucp_info.cpld_version));
136 struct hl_device *hdev = dev_get_drvdata(dev);
138 return sprintf(buf, "%s", hdev->asic_prop.cpucp_info.kernel_version);
144 struct hl_device *hdev = dev_get_drvdata(dev);
146 return sprintf(buf, "%s\n", hdev->asic_prop.cpucp_info.cpucp_version);
152 struct hl_device *hdev = dev_get_drvdata(dev);
154 return sprintf(buf, "%s\n", hdev->asic_prop.cpucp_info.fuse_version);
160 struct hl_device *hdev = dev_get_drvdata(dev);
162 return sprintf(buf, "%s", hdev->asic_prop.cpucp_info.thermal_version);
168 struct hl_device *hdev = dev_get_drvdata(dev);
170 return sprintf(buf, "%s", hdev->asic_prop.cpucp_info.fw_os_version);
176 struct hl_device *hdev = dev_get_drvdata(dev);
178 return sprintf(buf, "%s\n", hdev->asic_prop.preboot_ver);
185 struct hl_device *hdev = dev_get_drvdata(dev);
196 if (!hdev->asic_prop.allow_inference_soft_reset) {
197 dev_err(hdev->dev, "Device does not support inference soft-reset\n");
201 dev_warn(hdev->dev, "Inference Soft-Reset requested through sysfs\n");
203 hl_device_reset(hdev, 0);
213 struct hl_device *hdev = dev_get_drvdata(dev);
224 dev_warn(hdev->dev, "Hard-Reset requested through sysfs\n");
226 hl_device_reset(hdev, HL_DRV_RESET_HARD);
235 struct hl_device *hdev = dev_get_drvdata(dev);
238 switch (hdev->asic_type) {
258 dev_err(hdev->dev, "Unrecognized ASIC type %d\n",
259 hdev->asic_type);
269 struct hl_device *hdev = dev_get_drvdata(dev);
272 pci_domain_nr(hdev->pdev->bus),
273 hdev->pdev->bus->number,
274 PCI_SLOT(hdev->pdev->devfn),
275 PCI_FUNC(hdev->pdev->devfn));
281 struct hl_device *hdev = dev_get_drvdata(dev);
284 strscpy(str, hdev->status[hl_device_status(hdev)], HL_STR_MAX);
295 struct hl_device *hdev = dev_get_drvdata(dev);
297 return sprintf(buf, "%d\n", hdev->reset_info.compute_reset_cnt);
303 struct hl_device *hdev = dev_get_drvdata(dev);
305 return sprintf(buf, "%d\n", hdev->reset_info.hard_reset_cnt);
311 struct hl_device *hdev = dev_get_drvdata(dev);
314 if (!hl_device_operational(hdev, NULL))
317 val = hl_fw_get_max_power(hdev);
327 struct hl_device *hdev = dev_get_drvdata(dev);
331 if (!hl_device_operational(hdev, NULL)) {
343 hdev->max_power = value;
344 hl_fw_set_max_power(hdev);
355 struct hl_device *hdev = dev_get_drvdata(dev);
359 if (!hl_device_operational(hdev, NULL))
369 rc = hdev->asic_funcs->get_eeprom_data(hdev, data, max_size);
384 struct hl_device *hdev = dev_get_drvdata(dev);
386 return sprintf(buf, "%d\n", hdev->asic_prop.fw_security_enabled);
471 void hl_sysfs_add_dev_clk_attr(struct hl_device *hdev, struct attribute_group *dev_clk_attr_grp)
476 void hl_sysfs_add_dev_vrm_attr(struct hl_device *hdev, struct attribute_group *dev_vrm_attr_grp)
481 int hl_sysfs_init(struct hl_device *hdev)
485 hdev->max_power = hdev->asic_prop.max_power_default;
487 hdev->asic_funcs->add_device_attr(hdev, &hl_dev_clks_attr_group, &hl_dev_vrm_attr_group);
489 rc = device_add_groups(hdev->dev, hl_dev_attr_groups);
491 dev_err(hdev->dev,
496 if (!hdev->asic_prop.allow_inference_soft_reset)
499 rc = device_add_groups(hdev->dev, hl_dev_inference_attr_groups);
501 dev_err(hdev->dev,
509 device_remove_groups(hdev->dev, hl_dev_attr_groups);
513 void hl_sysfs_fini(struct hl_device *hdev)
515 device_remove_groups(hdev->dev, hl_dev_attr_groups);
517 if (!hdev->asic_prop.allow_inference_soft_reset)
520 device_remove_groups(hdev->dev, hl_dev_inference_attr_groups);