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 <vinodg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1970733
GVS: Gerrit_Virtual_Submit
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Vinod G
2018-12-11 14:09:32 -08:00
committed by mobile promotions
parent befd4f7ac3
commit e492834a07

View File

@@ -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 <nvgpu/sim.h>
#include <nvgpu/io.h>
#include <nvgpu/gk20a.h>
#include <nvgpu/soc.h>
#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;
}