From 864fa4ff821af4589c918dbbceecb1c76b9b85f0 Mon Sep 17 00:00:00 2001 From: Nicolas Benech Date: Fri, 21 Jun 2019 16:34:14 -0400 Subject: [PATCH] gpu: nvgpu: init: compile out non-FUSA HAL inits HAL inits for GM20B and GP10B can be removed when the safety profile is in use. JIRA NVGPU-3690 Change-Id: Ic516d1695f6c1362b48a028f2d1df5895ccd52f0 Signed-off-by: Nicolas Benech Reviewed-on: https://git-master.nvidia.com/r/2140894 GVS: Gerrit_Virtual_Submit Reviewed-by: Sagar Kamble Reviewed-by: Vijayakumar Subbu Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/Makefile.sources | 13 +++++++++---- drivers/gpu/nvgpu/hal/init/hal_init.c | 4 ++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/nvgpu/Makefile.sources b/drivers/gpu/nvgpu/Makefile.sources index eba9ffaaf..782d593f3 100644 --- a/drivers/gpu/nvgpu/Makefile.sources +++ b/drivers/gpu/nvgpu/Makefile.sources @@ -183,10 +183,6 @@ srcs += common/utils/enabled.c \ hal/gr/falcon/gr_falcon_gm20b.c \ hal/gr/falcon/gr_falcon_gp10b.c \ hal/gr/falcon/gr_falcon_gv11b.c \ - hal/init/hal_gm20b.c \ - hal/init/hal_gm20b_litter.c \ - hal/init/hal_gp10b.c \ - hal/init/hal_gp10b_litter.c \ hal/init/hal_gv11b.c \ hal/init/hal_gv11b_litter.c \ hal/init/hal_init.c \ @@ -274,6 +270,15 @@ srcs += common/utils/enabled.c \ hal/top/top_gp106.c \ hal/top/top_gv11b.c +# 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) +srcs += hal/init/hal_gp10b.c \ + hal/init/hal_gp10b_litter.c \ + hal/init/hal_gm20b.c \ + hal/init/hal_gm20b_litter.c +endif + ifeq ($(CONFIG_NVGPU_ACR_LEGACY),1) srcs += \ common/acr/acr_blob_construct_v0.c \ diff --git a/drivers/gpu/nvgpu/hal/init/hal_init.c b/drivers/gpu/nvgpu/hal/init/hal_init.c index df945e111..c42889449 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_init.c +++ b/drivers/gpu/nvgpu/hal/init/hal_init.c @@ -41,6 +41,7 @@ int nvgpu_init_hal(struct gk20a *g) u32 ver = g->params.gpu_arch + g->params.gpu_impl; switch (ver) { +#ifdef CONFIG_NVGPU_HAL_NON_FUSA case GK20A_GPUID_GM20B: nvgpu_log_info(g, "gm20b detected"); if (gm20b_init_hal(g) != 0) { @@ -58,11 +59,14 @@ int nvgpu_init_hal(struct gk20a *g) return -ENODEV; } break; +#endif + case NVGPU_GPUID_GV11B: if (gv11b_init_hal(g) != 0) { return -ENODEV; } break; + #ifdef CONFIG_NVGPU_DGPU #if defined(CONFIG_NVGPU_SUPPORT_TURING) case NVGPU_GPUID_TU104: