diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile index df1e40aee..9908e0fbb 100644 --- a/drivers/gpu/nvgpu/Makefile +++ b/drivers/gpu/nvgpu/Makefile @@ -144,7 +144,15 @@ obj-$(CONFIG_GK20A) := nvgpu.o ifeq ($(CONFIG_NVGPU_DGPU),y) nvgpu-$(CONFIG_NVGPU_DGPU) += \ os/linux/pci.o \ - os/linux/pci_power.o \ + os/linux/pci_power.o +else ifeq ($(CONFIG_NVGPU_PCI_IGPU),y) +nvgpu-$(CONFIG_NVGPU_PCI_IGPU) += \ + os/linux/pci.o \ + os/linux/pci_power.o +endif + +ifeq ($(CONFIG_NVGPU_DGPU),y) +nvgpu-$(CONFIG_NVGPU_DGPU) += \ os/linux/dmabuf_vidmem.o \ os/linux/dmabuf_nvs.o \ os/linux/os_ops_gv100.o \ diff --git a/drivers/gpu/nvgpu/Makefile.linux.configs b/drivers/gpu/nvgpu/Makefile.linux.configs index 54dce28ef..dc2608621 100644 --- a/drivers/gpu/nvgpu/Makefile.linux.configs +++ b/drivers/gpu/nvgpu/Makefile.linux.configs @@ -150,6 +150,8 @@ endif # Enable support for GPUs on PCIe bus. ifeq ($(CONFIG_PCI),y) +# Support for pci probe of IGPU +CONFIG_NVGPU_PCI_IGPU := y # Support for NVGPU DGPU CONFIG_NVGPU_DGPU := y endif @@ -292,6 +294,9 @@ endif ifeq ($(CONFIG_NVGPU_DGPU),y) ccflags-y += -DCONFIG_NVGPU_DGPU endif +ifeq ($(CONFIG_NVGPU_PCI_IGPU),y) +ccflags-y += -DCONFIG_NVGPU_PCI_IGPU +endif ifeq ($(CONFIG_GK20A_TRACE_PRINTK),y) ccflags-y += -DCONFIG_GK20A_TRACE_PRINTK endif diff --git a/drivers/gpu/nvgpu/Makefile.shared.configs b/drivers/gpu/nvgpu/Makefile.shared.configs index b402af66b..452bc152b 100644 --- a/drivers/gpu/nvgpu/Makefile.shared.configs +++ b/drivers/gpu/nvgpu/Makefile.shared.configs @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved. +# Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), @@ -58,6 +58,11 @@ NVGPU_COMMON_CFLAGS += \ -DCONFIG_NVGPU_GR_VIRTUALIZATION \ -DCONFIG_NVS_ROUND_ROBIN_SCHEDULER_DISABLE + +# Enable the PCI probe functionality for all builds +CONFIG_NVGPU_PCI_IGPU := 1 +NVGPU_COMMON_CFLAGS += -DCONFIG_NVGPU_PCI_IGPU + ifeq ($(CONFIG_NVGPU_DGPU),1) NVGPU_COMMON_CFLAGS += -DCONFIG_PCI_MSI endif diff --git a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h index 325d01e44..42dfeb75e 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h @@ -840,7 +840,7 @@ struct gk20a { bool is_fusa_sku; u16 pci_class; -#ifdef CONFIG_NVGPU_DGPU +#if defined(CONFIG_NVGPU_DGPU) || defined(CONFIG_NVGPU_PCI_IGPU) /* PCI device identifier */ u16 pci_vendor_id, pci_device_id; u16 pci_subsystem_vendor_id, pci_subsystem_device_id;