From 7525c1337b4416a1e05456a10b32bec80009d114 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Fri, 26 Oct 2018 13:54:56 -0700 Subject: [PATCH] gpu: nvgpu: Remove the GPU-NEXT conditional Remove build conditional for GPU-NEXT. It was used for including code for tu104, but now it's part of main nvgpu. Leave a TURING conditional to not need Turing code in other builds. JIRA NVGPU-961 Change-Id: I74177863c451d78b6db6165249561f15eadc3cc3 Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master.nvidia.com/r/1936803 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/Kconfig | 2 +- drivers/gpu/nvgpu/Makefile | 72 +++++++++---------- drivers/gpu/nvgpu/common/init/hal_init.c | 10 ++- .../gpu/nvgpu/common/netlist/netlist_tu104.c | 3 +- drivers/gpu/nvgpu/common/pmu/pmu_fw.c | 6 +- drivers/gpu/nvgpu/gp106/acr_gp106.c | 16 ++--- drivers/gpu/nvgpu/include/nvgpu/gk20a.h | 1 + drivers/gpu/nvgpu/nvgpu_gpuid_next.h | 39 ---------- drivers/gpu/nvgpu/os/linux/os_ops.c | 11 +-- drivers/gpu/nvgpu/os/linux/os_ops_tu104.h | 2 +- drivers/gpu/nvgpu/tu104/acr_tu104.h | 3 + 11 files changed, 55 insertions(+), 110 deletions(-) delete mode 100644 drivers/gpu/nvgpu/nvgpu_gpuid_next.h diff --git a/drivers/gpu/nvgpu/Kconfig b/drivers/gpu/nvgpu/Kconfig index 8f3a43b3e..35b434aff 100644 --- a/drivers/gpu/nvgpu/Kconfig +++ b/drivers/gpu/nvgpu/Kconfig @@ -147,7 +147,7 @@ config NVGPU_USE_TEGRA_ALLOC_FD It is only available in Tegra kernel. -config TEGRA_GPU_NEXT +config NVGPU_SUPPORT_TURING bool "Turing family GPU" depends on GK20A && ARCH_TEGRA_19x_SOC default y diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile index 36838f8cc..6b69d575b 100644 --- a/drivers/gpu/nvgpu/Makefile +++ b/drivers/gpu/nvgpu/Makefile @@ -26,6 +26,7 @@ nvgpu-y += common/bus/bus_gk20a.o \ common/bus/bus_gm20b.o \ common/bus/bus_gp10b.o \ common/bus/bus_gv100.o \ + common/bus/bus_tu104.o \ common/priv_ring/priv_ring_gm20b.o \ common/priv_ring/priv_ring_gp10b.o \ common/ptimer/ptimer.o \ @@ -35,6 +36,7 @@ nvgpu-y += common/bus/bus_gk20a.o \ common/fb/fb_gp106.o \ common/fb/fb_gv11b.o \ common/fb/fb_gv100.o \ + common/fb/fb_tu104.o \ common/perf/perf_gm20b.o \ common/perf/perf_gv11b.o \ common/perf/perfbuf.o \ @@ -53,13 +55,27 @@ nvgpu-y += common/bus/bus_gk20a.o \ common/mc/mc_gp10b.o \ common/mc/mc_gv11b.o \ common/mc/mc_gv100.o \ + common/mc/mc_tu104.o \ common/sync/channel_sync.o \ common/sync/channel_sync_semaphore.o \ common/boardobj/boardobj.o \ common/boardobj/boardobjgrp.o \ common/boardobj/boardobjgrpmask.o \ common/boardobj/boardobjgrp_e255.o \ - common/boardobj/boardobjgrp_e32.o + common/boardobj/boardobjgrp_e32.o \ + common/ltc/ltc.o \ + common/ltc/ltc_gm20b.o \ + common/ltc/ltc_gp10b.o \ + common/ltc/ltc_gv11b.o \ + common/ltc/ltc_tu104.o \ + common/netlist/netlist.o \ + common/netlist/netlist_sim.o \ + common/netlist/netlist_gm20b.o \ + common/netlist/netlist_gp106.o \ + common/netlist/netlist_gp10b.o \ + common/netlist/netlist_gv100.o \ + common/netlist/netlist_gv11b.o \ + common/netlist/netlist_tu104.o # Linux specific parts of nvgpu. nvgpu-y += \ @@ -101,7 +117,8 @@ nvgpu-y += \ os/linux/nvlink.o \ os/linux/dt.o \ os/linux/ecc_sysfs.o \ - os/linux/ltc.o + os/linux/ltc.o \ + os/linux/os_ops_tu104.o nvgpu-$(CONFIG_GK20A_VIDMEM) += \ os/linux/dmabuf_vidmem.o @@ -222,18 +239,6 @@ nvgpu-y += \ common/pmu/pmu_pg.o \ common/pmu/pmu_perfmon.o \ common/pmu/pmu_debug.o \ - common/netlist/netlist.o \ - common/netlist/netlist_sim.o \ - common/netlist/netlist_gm20b.o \ - common/netlist/netlist_gp106.o \ - common/netlist/netlist_gp10b.o \ - common/netlist/netlist_gv100.o \ - common/netlist/netlist_gv11b.o \ - common/netlist/netlist_tu104.o \ - common/ltc/ltc.o \ - common/ltc/ltc_gm20b.o \ - common/ltc/ltc_gp10b.o \ - common/ltc/ltc_gv11b.o \ common/sec2/sec2.o \ common/sec2/sec2_ipc.o \ common/io_common.o \ @@ -344,6 +349,19 @@ nvgpu-y += \ gv100/pmu_gv100.o \ gv100/perf_gv100.o \ gv100/gsp_gv100.o \ + gv100/clk_gv100.o \ + tu104/hal_tu104.o \ + tu104/fifo_tu104.o \ + tu104/gr_tu104.o \ + tu104/func_tu104.o \ + tu104/bios_tu104.o \ + tu104/nvlink_tu104.o \ + tu104/fbpa_tu104.o \ + tu104/flcn_tu104.o \ + tu104/sec2_tu104.o \ + tu104/ecc_tu104.o \ + tu104/regops_tu104.o \ + tu104/acr_tu104.o \ pstate/pstate.o \ clk/clk_vin.o \ clk/clk_fll.o \ @@ -372,28 +390,4 @@ nvgpu-y += \ therm/thrmchannel.o \ therm/thrmpmu.o \ lpwr/rppg.o \ - lpwr/lpwr.o \ - gv100/clk_gv100.o - -nvgpu-$(CONFIG_TEGRA_GPU_NEXT) += \ - common/bus/bus_tu104.o \ - common/fb/fb_tu104.o \ - common/ltc/ltc_tu104.o \ - common/mc/mc_tu104.o - -nvgpu-$(CONFIG_TEGRA_GPU_NEXT) += \ - tu104/hal_tu104.o \ - tu104/fifo_tu104.o \ - tu104/gr_tu104.o \ - tu104/func_tu104.o \ - tu104/bios_tu104.o \ - tu104/nvlink_tu104.o \ - tu104/fbpa_tu104.o \ - tu104/flcn_tu104.o \ - tu104/sec2_tu104.o \ - tu104/ecc_tu104.o \ - tu104/regops_tu104.o \ - tu104/acr_tu104.o - -nvgpu-$(CONFIG_TEGRA_GPU_NEXT) += \ - os/linux/os_ops_tu104.o + lpwr/lpwr.o diff --git a/drivers/gpu/nvgpu/common/init/hal_init.c b/drivers/gpu/nvgpu/common/init/hal_init.c index 598790b6a..a60fc839f 100644 --- a/drivers/gpu/nvgpu/common/init/hal_init.c +++ b/drivers/gpu/nvgpu/common/init/hal_init.c @@ -33,9 +33,7 @@ #include "gp106/hal_gp106.h" #include "gv100/hal_gv100.h" #include "gv11b/hal_gv11b.h" -#if defined(CONFIG_TEGRA_GPU_NEXT) -#include "nvgpu_gpuid_next.h" -#endif +#include "tu104/hal_tu104.h" int nvgpu_init_hal(struct gk20a *g) { @@ -80,9 +78,9 @@ int nvgpu_init_hal(struct gk20a *g) return -ENODEV; } break; -#if defined(CONFIG_TEGRA_GPU_NEXT) - case NVGPU_GPUID_NEXT: - if (NVGPU_NEXT_INIT_HAL(g) != 0) { +#if defined(CONFIG_NVGPU_SUPPORT_TURING) + case NVGPU_GPUID_TU104: + if (tu104_init_hal(g) != 0) { return -ENODEV; } break; diff --git a/drivers/gpu/nvgpu/common/netlist/netlist_tu104.c b/drivers/gpu/nvgpu/common/netlist/netlist_tu104.c index fe145f02b..ee11a4773 100644 --- a/drivers/gpu/nvgpu/common/netlist/netlist_tu104.c +++ b/drivers/gpu/nvgpu/common/netlist/netlist_tu104.c @@ -24,14 +24,13 @@ #include #include "netlist_tu104.h" -#include "nvgpu_gpuid_next.h" int tu104_netlist_get_name(struct gk20a *g, int index, char *name) { u32 ver = g->params.gpu_arch + g->params.gpu_impl; switch (ver) { - case NVGPU_GPUID_NEXT: + case NVGPU_GPUID_TU104: (void) sprintf(name, "%s/%s", "tu104", "NETC_img.bin"); break; default: diff --git a/drivers/gpu/nvgpu/common/pmu/pmu_fw.c b/drivers/gpu/nvgpu/common/pmu/pmu_fw.c index e6d6e73bb..1d3285d7f 100644 --- a/drivers/gpu/nvgpu/common/pmu/pmu_fw.c +++ b/drivers/gpu/nvgpu/common/pmu/pmu_fw.c @@ -35,7 +35,7 @@ #define NVGPU_PMU_NS_UCODE_IMAGE "gpmu_ucode.bin" /* PMU F/W version */ -#define APP_VERSION_GPU_NEXT 24408680U +#define APP_VERSION_TU10X 24408680U #define APP_VERSION_GV11B 25005711U #define APP_VERSION_GV10X 24283706U #define APP_VERSION_GP10X 24076634U @@ -1228,7 +1228,7 @@ static int nvgpu_init_pmu_fw_ver_ops(struct nvgpu_pmu *pmu) break; case APP_VERSION_GV11B: case APP_VERSION_GV10X: - case APP_VERSION_GPU_NEXT: + case APP_VERSION_TU10X: g->ops.pmu_ver.pg_cmd_eng_buf_load_size = pg_cmd_eng_buf_load_size_v2; g->ops.pmu_ver.pg_cmd_eng_buf_load_set_cmd_type = @@ -1294,7 +1294,7 @@ static int nvgpu_init_pmu_fw_ver_ops(struct nvgpu_pmu *pmu) g->ops.pmu_ver.pmu_allocation_get_fb_size = pmu_allocation_get_fb_size_v3; if (pmu->desc->app_version == APP_VERSION_GV10X || - pmu->desc->app_version == APP_VERSION_GPU_NEXT) { + pmu->desc->app_version == APP_VERSION_TU10X) { g->ops.pmu_ver.get_pmu_init_msg_pmu_queue_params = get_pmu_init_msg_pmu_queue_params_v5; g->ops.pmu_ver.get_pmu_msg_pmu_init_msg_ptr = diff --git a/drivers/gpu/nvgpu/gp106/acr_gp106.c b/drivers/gpu/nvgpu/gp106/acr_gp106.c index 2b2978eac..7a7631b2c 100644 --- a/drivers/gpu/nvgpu/gp106/acr_gp106.c +++ b/drivers/gpu/nvgpu/gp106/acr_gp106.c @@ -38,11 +38,9 @@ #include "gp106/acr_gp106.h" #include "gp106/pmu_gp106.h" #include "gv100/acr_gv100.h" +#include "tu104/acr_tu104.h" #include "sec2_gp106.h" -#if defined(CONFIG_TEGRA_GPU_NEXT) -#include "nvgpu_gpuid_next.h" -#endif #include #include @@ -214,13 +212,11 @@ int fecs_ucode_details(struct gk20a *g, struct flcn_ucode_img_v1 *p_img) GV100_FECS_UCODE_SIG, NVGPU_REQUEST_FIRMWARE_NO_SOC); break; -#if defined(CONFIG_TEGRA_GPU_NEXT) - case NVGPU_GPUID_NEXT: + case NVGPU_GPUID_TU104: fecs_sig = nvgpu_request_firmware(g, - NVGPU_GPU_NEXT_FECS_UCODE_SIG, + TU104_FECS_UCODE_SIG, NVGPU_REQUEST_FIRMWARE_NO_SOC); break; -#endif default: nvgpu_err(g, "no support for GPUID %x", ver); } @@ -318,13 +314,11 @@ int gpccs_ucode_details(struct gk20a *g, struct flcn_ucode_img_v1 *p_img) GV100_GPCCS_UCODE_SIG, NVGPU_REQUEST_FIRMWARE_NO_SOC); break; -#if defined(CONFIG_TEGRA_GPU_NEXT) - case NVGPU_GPUID_NEXT: + case NVGPU_GPUID_TU104: gpccs_sig = nvgpu_request_firmware(g, - NVGPU_GPU_NEXT_GPCCS_UCODE_SIG, + TU104_GPCCS_UCODE_SIG, NVGPU_REQUEST_FIRMWARE_NO_SOC); break; -#endif default: nvgpu_err(g, "no support for GPUID %x", ver); } diff --git a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h index 349497730..d48035611 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h @@ -1793,6 +1793,7 @@ int gk20a_wait_for_idle(struct gk20a *g); #define NVGPU_GPUID_GP106 0x00000136 #define NVGPU_GPUID_GV11B 0x0000015B #define NVGPU_GPUID_GV100 0x00000140 +#define NVGPU_GPUID_TU104 0x00000164 int gk20a_init_gpu_characteristics(struct gk20a *g); diff --git a/drivers/gpu/nvgpu/nvgpu_gpuid_next.h b/drivers/gpu/nvgpu/nvgpu_gpuid_next.h deleted file mode 100644 index 7b387f21f..000000000 --- a/drivers/gpu/nvgpu/nvgpu_gpuid_next.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2018, 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"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -#ifndef NVGPU_GPUID_NEXT_H -#define NVGPU_GPUID_NEXT_H - -#define NVGPU_GPUID_NEXT 0x00000164 - -#define NVGPU_GPU_NEXT_FECS_UCODE_SIG "tu104/fecs_sig.bin" -#define NVGPU_GPU_NEXT_GPCCS_UCODE_SIG "tu104/gpccs_sig.bin" - -#define NVGPU_NEXT_INIT_HAL tu104_init_hal -#define NVGPU_NEXT_INIT_OS_OPS nvgpu_tu104_init_os_ops - -struct nvgpu_os_linux; - -extern int tu104_init_hal(struct gk20a *g); -extern void nvgpu_tu104_init_os_ops(struct nvgpu_os_linux *l); - -#endif /* NVGPU_GPUID_NEXT_H */ diff --git a/drivers/gpu/nvgpu/os/linux/os_ops.c b/drivers/gpu/nvgpu/os/linux/os_ops.c index f1ab4b157..1ecda8f75 100644 --- a/drivers/gpu/nvgpu/os/linux/os_ops.c +++ b/drivers/gpu/nvgpu/os/linux/os_ops.c @@ -21,10 +21,7 @@ #include "os_ops_gp106.h" #include "os_ops_gv11b.h" #include "os_ops_gv100.h" - -#if defined(CONFIG_TEGRA_GPU_NEXT) -#include "nvgpu_gpuid_next.h" -#endif +#include "os_ops_tu104.h" int nvgpu_init_os_linux_ops(struct nvgpu_os_linux *l) { @@ -48,11 +45,9 @@ int nvgpu_init_os_linux_ops(struct nvgpu_os_linux *l) case NVGPU_GPUID_GV11B: nvgpu_gv11b_init_os_ops(l); break; -#if defined(CONFIG_TEGRA_GPU_NEXT) - case NVGPU_GPUID_NEXT: - NVGPU_NEXT_INIT_OS_OPS(l); + case NVGPU_GPUID_TU104: + nvgpu_tu104_init_os_ops(l); break; -#endif default: break; } diff --git a/drivers/gpu/nvgpu/os/linux/os_ops_tu104.h b/drivers/gpu/nvgpu/os/linux/os_ops_tu104.h index 60c900f14..dcaef16ba 100644 --- a/drivers/gpu/nvgpu/os/linux/os_ops_tu104.h +++ b/drivers/gpu/nvgpu/os/linux/os_ops_tu104.h @@ -17,6 +17,6 @@ #ifndef __LINUX_OS_OPS_TU104_H #define __LINUX_OS_OPS_TU104_H -void nvgpu_tu104_init_os_ops(struct nvgpu_os_linux *l) +void nvgpu_tu104_init_os_ops(struct nvgpu_os_linux *l); #endif diff --git a/drivers/gpu/nvgpu/tu104/acr_tu104.h b/drivers/gpu/nvgpu/tu104/acr_tu104.h index 07cd027b3..7afaacee8 100644 --- a/drivers/gpu/nvgpu/tu104/acr_tu104.h +++ b/drivers/gpu/nvgpu/tu104/acr_tu104.h @@ -25,6 +25,9 @@ #define TU104_MAX_SUPPORTED_LSFM 4 +#define TU104_FECS_UCODE_SIG "tu104/fecs_sig.bin" +#define TU104_GPCCS_UCODE_SIG "tu104/gpccs_sig.bin" + void nvgpu_tu104_acr_sw_init(struct gk20a *g, struct nvgpu_acr *acr); #endif /*NVGPU_ACR_TU104_H*/