From e492834a073fd7f749fe88e722519c4cb9101cce Mon Sep 17 00:00:00 2001 From: Vinod G Date: Tue, 11 Dec 2018 14:09:32 -0800 Subject: [PATCH] gpu: nvgpu: dGpu VDK support Skip the simulation register check in real silicon. Check sim_config_simulation register for fmodel identification. JIRA NVGPU-1564 Change-Id: Ic65d816f35e93855db31555e7e943361fca4e9d0 Signed-off-by: Vinod G Reviewed-on: https://git-master.nvidia.com/r/1970733 GVS: Gerrit_Virtual_Submit Reviewed-by: Seshendra Gadagottu Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/os/linux/sim_pci.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/nvgpu/os/linux/sim_pci.c b/drivers/gpu/nvgpu/os/linux/sim_pci.c index 340f1fab6..9a80e7e20 100644 --- a/drivers/gpu/nvgpu/os/linux/sim_pci.c +++ b/drivers/gpu/nvgpu/os/linux/sim_pci.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -27,6 +27,7 @@ #include #include #include +#include #include "os_linux.h" #include "module.h" @@ -36,9 +37,16 @@ static bool _nvgpu_pci_is_simulation(struct gk20a *g, u32 sim_base) u32 cfg; bool is_simulation = false; + if (nvgpu_platform_is_silicon(g)) { + return is_simulation; + } + cfg = nvgpu_readl(g, sim_base + sim_config_r()); - if (sim_config_mode_v(cfg) == sim_config_mode_enabled_v()) + + if ((sim_config_simulation_v(cfg) == sim_config_simulation_fmodel_v()) + || (sim_config_mode_v(cfg) == sim_config_mode_enabled_v())) { is_simulation = true; + } return is_simulation; }