mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 01:50:07 +03:00
gpu: nvgpu: sim init for iGPU-PCIe
Implement the sim init for the iGPU-PCIe devices. JIRA NVGPU-9348 Change-Id: I9088308b96c57bb1cea01959326446ccad0a8c24 Signed-off-by: Ramalingam C <ramalingamc@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2851163 Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: Sagar Kamble <skamble@nvidia.com> Reviewed-by: Seema Khowala <seemaj@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
d0ed86ab1e
commit
b2c4cdb25b
@@ -38,6 +38,7 @@
|
||||
#include <nvgpu/string.h>
|
||||
#include <nvgpu/gr/gr.h>
|
||||
#include <nvgpu/nvgpu_init.h>
|
||||
#include <nvgpu/linux/sim.h>
|
||||
|
||||
#include "nvlink.h"
|
||||
#include "module.h"
|
||||
@@ -394,8 +395,9 @@ static irqreturn_t nvgpu_pci_intr_thread(int irq, void *dev_id)
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static int nvgpu_pci_init_support(struct pci_dev *pdev)
|
||||
static int nvgpu_pci_init_support(struct pci_dev *pdev, bool is_pci_igpu)
|
||||
{
|
||||
struct gk20a_platform *platform = pci_get_drvdata(pdev);
|
||||
int err = 0;
|
||||
struct gk20a *g = get_gk20a(&pdev->dev);
|
||||
struct device *dev = &pdev->dev;
|
||||
@@ -427,17 +429,29 @@ static int nvgpu_pci_init_support(struct pci_dev *pdev)
|
||||
}
|
||||
g->bar1 = (uintptr_t)addr;
|
||||
|
||||
err = nvgpu_init_sim_support_linux_pci(g);
|
||||
if (err)
|
||||
goto fail;
|
||||
err = nvgpu_init_sim_support_pci(g);
|
||||
if (err)
|
||||
goto fail_sim;
|
||||
if (is_pci_igpu) {
|
||||
err = nvgpu_init_sim_support_linux_igpu_pci(g, platform);
|
||||
if (err)
|
||||
goto fail;
|
||||
err = nvgpu_init_sim_support(g);
|
||||
if (err)
|
||||
goto fail_sim;
|
||||
} else {
|
||||
err = nvgpu_init_sim_support_linux_pci(g);
|
||||
if (err)
|
||||
goto fail;
|
||||
err = nvgpu_init_sim_support_pci(g);
|
||||
if (err)
|
||||
goto fail_sim;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
fail_sim:
|
||||
nvgpu_remove_sim_support_linux_pci(g);
|
||||
if (is_pci_igpu)
|
||||
nvgpu_remove_sim_support_linux(g);
|
||||
else
|
||||
nvgpu_remove_sim_support_linux_pci(g);
|
||||
fail:
|
||||
if (g->regs)
|
||||
g->regs = 0U;
|
||||
@@ -675,7 +689,7 @@ static int nvgpu_pci_probe(struct pci_dev *pdev,
|
||||
}
|
||||
nvgpu_disable_irqs(g);
|
||||
|
||||
err = nvgpu_pci_init_support(pdev);
|
||||
err = nvgpu_pci_init_support(pdev, g->is_pci_igpu);
|
||||
if (err)
|
||||
goto err_free_irq;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user