]> git.baikalelectronics.ru Git - kernel.git/commitdiff
habanalabs: enable gaudi code in driver
authorOded Gabbay <oded.gabbay@gmail.com>
Mon, 11 May 2020 07:47:05 +0000 (10:47 +0300)
committerOded Gabbay <oded.gabbay@gmail.com>
Tue, 19 May 2020 11:48:41 +0000 (14:48 +0300)
Enable the GAUDI ASIC code in the pci probe callback of the driver so the
driver will handle GAUDI ASICs.

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/misc/habanalabs/device.c
drivers/misc/habanalabs/habanalabs_drv.c
drivers/misc/habanalabs/sysfs.c

index 7ce4540648cf6b53255acb44bf3d1543fb0a2634..4b6c8de46dd8645158d808d88614de675bd55a15 100644 (file)
@@ -256,6 +256,10 @@ static int device_early_init(struct hl_device *hdev)
                goya_set_asic_funcs(hdev);
                strlcpy(hdev->asic_name, "GOYA", sizeof(hdev->asic_name));
                break;
+       case ASIC_GAUDI:
+               gaudi_set_asic_funcs(hdev);
+               sprintf(hdev->asic_name, "GAUDI");
+               break;
        default:
                dev_err(hdev->dev, "Unrecognized ASIC type %d\n",
                        hdev->asic_type);
index 9d009b50aa0ddc66507667c57977273056af6aac..8652c7e5d7f1071b81069a742cd8cc93909d7c9c 100644 (file)
@@ -276,11 +276,6 @@ int create_hdev(struct hl_device **dev, struct pci_dev *pdev,
                        dev_err(&pdev->dev, "Unsupported ASIC\n");
                        rc = -ENODEV;
                        goto free_hdev;
-               } else if (hdev->asic_type == ASIC_GAUDI) {
-                       dev_err(&pdev->dev,
-                               "GAUDI is not supported by the current kernel\n");
-                       rc = -ENODEV;
-                       goto free_hdev;
                }
        } else {
                hdev->asic_type = asic_type;
index 36f4f68c8cefa645db2abce4d4281dbd5d7b7aaf..e4454414d0e10d00b754fdeda2f8eb81cbd4521d 100644 (file)
@@ -224,6 +224,9 @@ static ssize_t device_type_show(struct device *dev,
        case ASIC_GOYA:
                str = "GOYA";
                break;
+       case ASIC_GAUDI:
+               str = "GAUDI";
+               break;
        default:
                dev_err(hdev->dev, "Unrecognized ASIC type %d\n",
                                hdev->asic_type);