diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile index 5e3934f94..f2d16148a 100644 --- a/drivers/gpu/nvgpu/Makefile +++ b/drivers/gpu/nvgpu/Makefile @@ -367,7 +367,6 @@ nvgpu-y += \ hal/gr/gr/gr_gv100.o \ hal/gr/gr/gr_gv11b.o \ hal/gr/gr/gr_tu104.o \ - hal/init/hal_gv11b.o \ hal/init/hal_gv11b_litter.o \ hal/init/hal_init.o \ hal/perf/perf_gv11b.o \ @@ -415,6 +414,11 @@ nvgpu-y += \ hal/cic/mon/init_ga10b_fusa.o \ hal/cic/mon/lut_ga10b_fusa.o +ifeq ($(CONFIG_NVGPU_SUPPORT_GV11B),y) +nvgpu-$(CONFIG_NVGPU_SUPPORT_GV11B) += \ + hal/init/hal_gv11b.o +endif + ifeq ($(CONFIG_NVGPU_INTR_DEBUG),y) nvgpu-$(CONFIG_NVGPU_INTR_DEBUG) += \ common/cic/mon/mon_ce.o \ diff --git a/drivers/gpu/nvgpu/Makefile.linux.configs b/drivers/gpu/nvgpu/Makefile.linux.configs index 010b6cbc6..80018c1de 100644 --- a/drivers/gpu/nvgpu/Makefile.linux.configs +++ b/drivers/gpu/nvgpu/Makefile.linux.configs @@ -41,6 +41,9 @@ CONFIG_NVGPU_COMPRESSION := y # Enable MIG Support CONFIG_NVGPU_MIG := y +# Enable gv11b support +CONFIG_NVGPU_SUPPORT_GV11B := y + # Enable support for extraction of comptags for CDE. ifeq ($(CONFIG_NVGPU_COMPRESSION),y) CONFIG_NVGPU_SUPPORT_CDE := y @@ -213,6 +216,9 @@ endif ifeq ($(CONFIG_NVGPU_COMPRESSION),y) ccflags-y += -DCONFIG_NVGPU_COMPRESSION endif +ifeq ($(CONFIG_NVGPU_SUPPORT_GV11B),y) +ccflags-y += -DCONFIG_NVGPU_SUPPORT_GV11B +endif ifeq ($(CONFIG_NVGPU_REMAP),y) ccflags-y += -DCONFIG_NVGPU_REMAP endif diff --git a/drivers/gpu/nvgpu/Makefile.shared.configs b/drivers/gpu/nvgpu/Makefile.shared.configs index b5c0b2812..e1055be5c 100644 --- a/drivers/gpu/nvgpu/Makefile.shared.configs +++ b/drivers/gpu/nvgpu/Makefile.shared.configs @@ -78,6 +78,9 @@ NVGPU_COMMON_CFLAGS += -DCONFIG_NVGPU_SYNCFD_NONE CONFIG_NVGPU_GRAPHICS := 1 NVGPU_COMMON_CFLAGS += -DCONFIG_NVGPU_GRAPHICS +CONFIG_NVGPU_SUPPORT_GV11B := 1 +NVGPU_COMMON_CFLAGS += -DCONFIG_NVGPU_SUPPORT_GV11B + # Error reporting needs to be supported in qnx-safety, qnx-standard, linux. # In qnx-standard, nvgpu makefile is used for RM SERVER. Since iGPU is in # pass through mode in all three platforms, EPL libraries should not be diff --git a/drivers/gpu/nvgpu/Makefile.sources b/drivers/gpu/nvgpu/Makefile.sources index 54dd87480..7e783b36f 100644 --- a/drivers/gpu/nvgpu/Makefile.sources +++ b/drivers/gpu/nvgpu/Makefile.sources @@ -165,7 +165,6 @@ srcs += common/device.c \ common/cic/mon/mon_report_err.c \ common/cic/rm/rm_init.c \ common/cic/rm/rm_intr.c \ - hal/init/hal_gv11b.c \ hal/init/hal_gv11b_litter.c \ hal/init/hal_init.c \ hal/power_features/cg/gv11b_gating_reglist.c \ @@ -299,6 +298,10 @@ ifeq ($(CONFIG_NVGPU_COMPRESSION),1) srcs += hal/cbc/cbc_tu104.c endif +ifeq ($(CONFIG_NVGPU_SUPPORT_GV11B),1) +srcs += hal/init/hal_gv11b.c +endif + # Source files below are not guaranteed to be functionaly safe (FuSa) and are # only included in the normal build. ifeq ($(CONFIG_NVGPU_HAL_NON_FUSA),1) diff --git a/drivers/gpu/nvgpu/hal/init/hal_init.c b/drivers/gpu/nvgpu/hal/init/hal_init.c index 23f4bf38b..69912dd69 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_init.c +++ b/drivers/gpu/nvgpu/hal/init/hal_init.c @@ -1,7 +1,7 @@ /* * NVIDIA GPU HAL interface. * - * Copyright (c) 2014-2021, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2022, 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"), @@ -68,11 +68,13 @@ int nvgpu_init_hal(struct gk20a *g) err = -ENODEV; } break; +#ifdef CONFIG_NVGPU_SUPPORT_GV11B case NVGPU_GPUID_GV11B: if (gv11b_init_hal(g) != 0) { err = -ENODEV; } break; +#endif #if defined(CONFIG_NVGPU_DGPU) && defined(CONFIG_NVGPU_HAL_NON_FUSA) case NVGPU_GPUID_TU104: @@ -121,6 +123,7 @@ int nvgpu_detect_chip(struct gk20a *g) return -ENODEV; } +#ifdef CONFIG_NVGPU_SUPPORT_GV11B if (nvgpu_safe_add_u32(p->gpu_arch, p->gpu_impl) == (u32)NVGPU_GPUID_GV11B) { /* overwrite gpu revison for A02 */ @@ -128,6 +131,7 @@ int nvgpu_detect_chip(struct gk20a *g) p->gpu_rev = 0xa2; } } +#endif nvgpu_log_info(g, "arch: %x, impl: %x, rev: %x\n", g->params.gpu_arch, g->params.gpu_impl,