diff options
author | Oded Gabbay <oded.gabbay@gmail.com> | 2020-05-11 10:47:05 +0300 |
---|---|---|
committer | Oded Gabbay <oded.gabbay@gmail.com> | 2020-05-19 14:48:41 +0300 |
commit | af57cb81a6df58a3085fbe91f597f69efd4dea37 (patch) | |
tree | 24fe299180192e7d34bbd762b5a22d282f9e6849 /drivers/misc | |
parent | 79fc7a9fffa8f6166315df6929c0cef5c9a04580 (diff) | |
download | linux-af57cb81a6df58a3085fbe91f597f69efd4dea37.tar.bz2 |
habanalabs: enable gaudi code in driver
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>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/habanalabs/device.c | 4 | ||||
-rw-r--r-- | drivers/misc/habanalabs/habanalabs_drv.c | 5 | ||||
-rw-r--r-- | drivers/misc/habanalabs/sysfs.c | 3 |
3 files changed, 7 insertions, 5 deletions
diff --git a/drivers/misc/habanalabs/device.c b/drivers/misc/habanalabs/device.c index 7ce4540648cf..4b6c8de46dd8 100644 --- a/drivers/misc/habanalabs/device.c +++ b/drivers/misc/habanalabs/device.c @@ -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); diff --git a/drivers/misc/habanalabs/habanalabs_drv.c b/drivers/misc/habanalabs/habanalabs_drv.c index 9d009b50aa0d..8652c7e5d7f1 100644 --- a/drivers/misc/habanalabs/habanalabs_drv.c +++ b/drivers/misc/habanalabs/habanalabs_drv.c @@ -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; diff --git a/drivers/misc/habanalabs/sysfs.c b/drivers/misc/habanalabs/sysfs.c index 36f4f68c8cef..e4454414d0e1 100644 --- a/drivers/misc/habanalabs/sysfs.c +++ b/drivers/misc/habanalabs/sysfs.c @@ -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); |