diff options
Diffstat (limited to 'drivers/gpu/nvgpu/os/linux/vgpu/platform_vgpu_tegra.c')
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/vgpu/platform_vgpu_tegra.c | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/vgpu/platform_vgpu_tegra.c b/drivers/gpu/nvgpu/os/linux/vgpu/platform_vgpu_tegra.c new file mode 100644 index 00000000..e4819e7d --- /dev/null +++ b/drivers/gpu/nvgpu/os/linux/vgpu/platform_vgpu_tegra.c | |||
@@ -0,0 +1,69 @@ | |||
1 | /* | ||
2 | * Tegra Virtualized GPU Platform Interface | ||
3 | * | ||
4 | * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms and conditions of the GNU General Public License, | ||
8 | * version 2, as published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
13 | * more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | */ | ||
18 | |||
19 | #include <nvgpu/nvhost.h> | ||
20 | |||
21 | #include "gk20a/gk20a.h" | ||
22 | #include "os/linux/platform_gk20a.h" | ||
23 | #include "clk_vgpu.h" | ||
24 | |||
25 | static int gk20a_tegra_probe(struct device *dev) | ||
26 | { | ||
27 | #ifdef CONFIG_TEGRA_GK20A_NVHOST | ||
28 | struct gk20a_platform *platform = dev_get_drvdata(dev); | ||
29 | int ret; | ||
30 | |||
31 | ret = nvgpu_get_nvhost_dev(platform->g); | ||
32 | if (ret) | ||
33 | return ret; | ||
34 | |||
35 | vgpu_init_clk_support(platform->g); | ||
36 | return 0; | ||
37 | #else | ||
38 | return 0; | ||
39 | #endif | ||
40 | } | ||
41 | |||
42 | struct gk20a_platform vgpu_tegra_platform = { | ||
43 | .has_syncpoints = true, | ||
44 | .aggressive_sync_destroy_thresh = 64, | ||
45 | |||
46 | /* power management configuration */ | ||
47 | .can_railgate_init = false, | ||
48 | .can_elpg_init = false, | ||
49 | .enable_slcg = false, | ||
50 | .enable_blcg = false, | ||
51 | .enable_elcg = false, | ||
52 | .enable_elpg = false, | ||
53 | .enable_aelpg = false, | ||
54 | .can_slcg = false, | ||
55 | .can_blcg = false, | ||
56 | .can_elcg = false, | ||
57 | |||
58 | .ch_wdt_timeout_ms = 5000, | ||
59 | |||
60 | .probe = gk20a_tegra_probe, | ||
61 | |||
62 | .clk_round_rate = vgpu_clk_round_rate, | ||
63 | .get_clk_freqs = vgpu_clk_get_freqs, | ||
64 | |||
65 | /* frequency scaling configuration */ | ||
66 | .devfreq_governor = "userspace", | ||
67 | |||
68 | .virtual_dev = true, | ||
69 | }; | ||