summaryrefslogtreecommitdiff
path: root/drivers/misc/habanalabs/habanalabs_drv.c
diff options
context:
space:
mode:
authorOded Gabbay <oded.gabbay@gmail.com>2019-02-16 01:39:16 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-02-18 11:46:44 +0300
commit839c48030d27a690cc85f0762f9f6f07a3349fb3 (patch)
treeaf6f7b6596f8292781caac546953c8e418e0f2ae /drivers/misc/habanalabs/habanalabs_drv.c
parentbe5d926b5c10430671ae975b80efb7a5652e3f9a (diff)
downloadlinux-839c48030d27a690cc85f0762f9f6f07a3349fb3.tar.xz
habanalabs: add basic Goya h/w initialization
This patch adds the basic part of Goya's H/W initialization. It adds code that initializes Goya's internal CPU, various registers that are related to internal routing, scrambling, workarounds for H/W bugs, etc. It also initializes Goya's security scheme that prevents the user from abusing Goya to steal data from the host, crash the host, change Goya's F/W, etc. Reviewed-by: Mike Rapoport <rppt@linux.ibm.com> Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/habanalabs/habanalabs_drv.c')
-rw-r--r--drivers/misc/habanalabs/habanalabs_drv.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/misc/habanalabs/habanalabs_drv.c b/drivers/misc/habanalabs/habanalabs_drv.c
index 8628d1d8f037..59c2fd196659 100644
--- a/drivers/misc/habanalabs/habanalabs_drv.c
+++ b/drivers/misc/habanalabs/habanalabs_drv.c
@@ -167,7 +167,14 @@ int create_hdev(struct hl_device **dev, struct pci_dev *pdev,
hdev->major = hl_major;
/* Parameters for bring-up - set them to defaults */
+ hdev->cpu_enable = 1;
hdev->reset_pcilink = 0;
+ hdev->fw_loading = 1;
+ hdev->pldm = 0;
+
+ /* If CPU is disabled, no point in loading FW */
+ if (!hdev->cpu_enable)
+ hdev->fw_loading = 0;
hdev->disabled = true;
hdev->pdev = pdev; /* can be NULL in case of simulator device */