mirror of
https://github.com/torvalds/linux.git
synced 2024-11-17 01:22:07 +00:00
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>
This commit is contained in:
parent
79fc7a9fff
commit
af57cb81a6
@ -256,6 +256,10 @@ static int device_early_init(struct hl_device *hdev)
|
|||||||
goya_set_asic_funcs(hdev);
|
goya_set_asic_funcs(hdev);
|
||||||
strlcpy(hdev->asic_name, "GOYA", sizeof(hdev->asic_name));
|
strlcpy(hdev->asic_name, "GOYA", sizeof(hdev->asic_name));
|
||||||
break;
|
break;
|
||||||
|
case ASIC_GAUDI:
|
||||||
|
gaudi_set_asic_funcs(hdev);
|
||||||
|
sprintf(hdev->asic_name, "GAUDI");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
dev_err(hdev->dev, "Unrecognized ASIC type %d\n",
|
dev_err(hdev->dev, "Unrecognized ASIC type %d\n",
|
||||||
hdev->asic_type);
|
hdev->asic_type);
|
||||||
|
@ -276,11 +276,6 @@ int create_hdev(struct hl_device **dev, struct pci_dev *pdev,
|
|||||||
dev_err(&pdev->dev, "Unsupported ASIC\n");
|
dev_err(&pdev->dev, "Unsupported ASIC\n");
|
||||||
rc = -ENODEV;
|
rc = -ENODEV;
|
||||||
goto free_hdev;
|
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 {
|
} else {
|
||||||
hdev->asic_type = asic_type;
|
hdev->asic_type = asic_type;
|
||||||
|
@ -224,6 +224,9 @@ static ssize_t device_type_show(struct device *dev,
|
|||||||
case ASIC_GOYA:
|
case ASIC_GOYA:
|
||||||
str = "GOYA";
|
str = "GOYA";
|
||||||
break;
|
break;
|
||||||
|
case ASIC_GAUDI:
|
||||||
|
str = "GAUDI";
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
dev_err(hdev->dev, "Unrecognized ASIC type %d\n",
|
dev_err(hdev->dev, "Unrecognized ASIC type %d\n",
|
||||||
hdev->asic_type);
|
hdev->asic_type);
|
||||||
|
Loading…
Reference in New Issue
Block a user