diff options
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/gv11b/platform_gv11b_vgpu_tegra.c')
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/gv11b/platform_gv11b_vgpu_tegra.c | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/platform_gv11b_vgpu_tegra.c b/drivers/gpu/nvgpu/vgpu/gv11b/platform_gv11b_vgpu_tegra.c new file mode 100644 index 00000000..a6ed67b2 --- /dev/null +++ b/drivers/gpu/nvgpu/vgpu/gv11b/platform_gv11b_vgpu_tegra.c | |||
@@ -0,0 +1,80 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | */ | ||
13 | |||
14 | #include "gk20a/gk20a.h" | ||
15 | #include "gk20a/hal_gk20a.h" | ||
16 | #include "gk20a/platform_gk20a.h" | ||
17 | #include "vgpu/clk_vgpu.h" | ||
18 | |||
19 | #include <nvgpu/nvhost.h> | ||
20 | #include <linux/platform_device.h> | ||
21 | |||
22 | static int gv11b_vgpu_probe(struct device *dev) | ||
23 | { | ||
24 | struct platform_device *pdev = to_platform_device(dev); | ||
25 | struct gk20a_platform *platform = dev_get_drvdata(dev); | ||
26 | struct resource *r; | ||
27 | void __iomem *regs; | ||
28 | struct fifo_gk20a *f = &platform->g->fifo; | ||
29 | int ret; | ||
30 | |||
31 | r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "usermode"); | ||
32 | if (!r) { | ||
33 | dev_err(dev, "failed to get usermode regs\n"); | ||
34 | return -ENXIO; | ||
35 | } | ||
36 | regs = devm_ioremap_resource(dev, r); | ||
37 | if (IS_ERR(regs)) { | ||
38 | dev_err(dev, "failed to map usermode regs\n"); | ||
39 | return PTR_ERR(regs); | ||
40 | } | ||
41 | f->t19x.usermode_regs = regs; | ||
42 | |||
43 | #ifdef CONFIG_TEGRA_GK20A_NVHOST | ||
44 | ret = nvgpu_get_nvhost_dev(platform->g); | ||
45 | if (ret) { | ||
46 | f->t19x.usermode_regs = NULL; | ||
47 | return ret; | ||
48 | } | ||
49 | #endif | ||
50 | vgpu_init_clk_support(platform->g); | ||
51 | |||
52 | return 0; | ||
53 | } | ||
54 | |||
55 | struct gk20a_platform gv11b_vgpu_tegra_platform = { | ||
56 | .has_syncpoints = false, | ||
57 | .aggressive_sync_destroy_thresh = 64, | ||
58 | |||
59 | /* power management configuration */ | ||
60 | .can_railgate_init = false, | ||
61 | .can_elpg_init = false, | ||
62 | .enable_slcg = false, | ||
63 | .enable_blcg = false, | ||
64 | .enable_elcg = false, | ||
65 | .enable_elpg = false, | ||
66 | .enable_aelpg = false, | ||
67 | |||
68 | .ch_wdt_timeout_ms = 5000, | ||
69 | |||
70 | .probe = gv11b_vgpu_probe, | ||
71 | .default_big_page_size = SZ_64K, | ||
72 | |||
73 | .clk_round_rate = vgpu_clk_round_rate, | ||
74 | .get_clk_freqs = vgpu_clk_get_freqs, | ||
75 | |||
76 | /* frequency scaling configuration */ | ||
77 | .devfreq_governor = "userspace", | ||
78 | |||
79 | .virtual_dev = true, | ||
80 | }; | ||