gpu: nvgpu: add disable nvlink option in gk20a_platform

Add option to disable nvlink in struct gk20a_platform so that chips that
do not support nvlink can work with pcie without compiling out nvlink
code.

Jira NVGPU-5870

Change-Id: Idc60418b5cf322ac81b241a4e59d25f5d8e6b9ca
Signed-off-by: Shashank Singh <shashsingh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2332162
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Shashank Singh
2020-04-21 12:54:16 +00:00
committed by Alex Waterman
parent c99afa1766
commit 2fecf71e45
2 changed files with 13 additions and 1 deletions

View File

@@ -96,6 +96,7 @@ static struct gk20a_platform nvgpu_pci_device[] = {
.can_elcg = false,
.disable_aspm = true,
.disable_nvlink = false,
.pstate = true,
/* power management callbacks */
@@ -138,6 +139,7 @@ static struct gk20a_platform nvgpu_pci_device[] = {
.can_elcg = false,
.disable_aspm = true,
.disable_nvlink = false,
.pstate = true,
/* power management callbacks */
@@ -178,6 +180,7 @@ static struct gk20a_platform nvgpu_pci_device[] = {
.can_elcg = false,
.disable_aspm = true,
.disable_nvlink = false,
/* power management callbacks */
.is_railgated = nvgpu_pci_tegra_is_railgated,
@@ -216,6 +219,7 @@ static struct gk20a_platform nvgpu_pci_device[] = {
.can_elcg = false,
.disable_aspm = true,
.disable_nvlink = true,
.pstate = false,
/* power management callbacks */
@@ -651,7 +655,12 @@ static int nvgpu_pci_probe(struct pci_dev *pdev,
goto err_free_irq;
}
err = nvgpu_nvlink_probe(g);
if (!platform->disable_nvlink) {
err = nvgpu_nvlink_probe(g);
} else {
err = -ENODEV;
}
/*
* ENODEV is a legal error which means there is no NVLINK
* any other error is fatal

View File

@@ -151,6 +151,9 @@ struct gk20a_platform {
/* Disable big page support */
bool disable_bigpage;
/* Disable nvlink support */
bool disable_nvlink;
/*
* gk20a_do_idle() API can take GPU either into rail gate or CAR reset
* This flag can be used to force CAR reset case instead of rail gate