summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c
diff options
context:
space:
mode:
authorSeshendra Gadagottu <sgadagottu@nvidia.com>2016-04-07 19:57:18 -0400
committerKen Adams <kadams@nvidia.com>2016-04-13 11:15:13 -0400
commit55a5c57bc1fd532cc6d041fdfb70d90286894b35 (patch)
tree2c5d2bd6ee19d470b576eaee90a85b99d4235015 /drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c
parent3f26f6955fc6736384e1d56f9ddff2baaa2102a0 (diff)
gpu: nvgpu: gv11b: added initial source code
Bug 1735757 Change-Id: Iea7488551a437afa0dfc005c87ad1b9ab9673b6c Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com> Reviewed-on: http://git-master/r/1122123 GVS: Gerrit_Virtual_Submit Reviewed-by: Ken Adams <kadams@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c')
-rw-r--r--drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c149
1 files changed, 149 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c
new file mode 100644
index 00000000..322bebc8
--- /dev/null
+++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c
@@ -0,0 +1,149 @@
1/*
2 * GV11B Tegra Platform Interface
3 *
4 * Copyright (c) 2016, 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
16#include <linux/of_platform.h>
17#include <linux/nvhost.h>
18#include <linux/debugfs.h>
19#include <linux/tegra-powergate.h>
20#include <linux/platform_data/tegra_edp.h>
21#include <uapi/linux/nvgpu.h>
22#include <linux/dma-buf.h>
23#include <linux/nvmap.h>
24#include <linux/tegra_pm_domains.h>
25#include <linux/reset.h>
26#include <linux/hashtable.h>
27#include "gk20a/platform_gk20a.h"
28#include "gk20a/gk20a.h"
29#include "platform_tegra.h"
30#include "gr_gv11b.h"
31#include "hw_gr_gv11b.h"
32
33/*
34 * gv11b_tegra_get_clocks()
35 *
36 * This function finds clocks in tegra platform and populates
37 * the clock information to gv11b platform data.
38 */
39
40static int gv11b_tegra_get_clocks(struct device *dev)
41{
42 /* TODO */
43 return 0;
44}
45
46static int gv11b_tegra_probe(struct device *dev)
47{
48 struct gk20a_platform *platform = dev_get_drvdata(dev);
49 struct device_node *np = dev->of_node;
50 struct device_node *host1x_node;
51 struct platform_device *host1x_pdev;
52 const __be32 *host1x_ptr;
53
54 host1x_ptr = of_get_property(np, "nvidia,host1x", NULL);
55 if (!host1x_ptr) {
56 gk20a_err(dev, "host1x device not available");
57 return -ENOSYS;
58 }
59
60 host1x_node = of_find_node_by_phandle(be32_to_cpup(host1x_ptr));
61 host1x_pdev = of_find_device_by_node(host1x_node);
62 if (!host1x_pdev) {
63 gk20a_err(dev, "host1x device not available");
64 return -ENOSYS;
65 }
66
67 platform->g->host1x_dev = host1x_pdev;
68 platform->bypass_smmu = !device_is_iommuable(dev);
69 platform->disable_bigpage = platform->bypass_smmu;
70
71 platform->g->gr.t18x.ctx_vars.dump_ctxsw_stats_on_channel_close
72 = false;
73 platform->g->gr.t18x.ctx_vars.dump_ctxsw_stats_on_channel_close
74 = false;
75
76 platform->g->gr.t18x.ctx_vars.force_preemption_gfxp = false;
77 platform->g->gr.t18x.ctx_vars.force_preemption_cilp = false;
78
79
80 gv11b_tegra_get_clocks(dev);
81
82 return 0;
83}
84
85static int gv11b_tegra_late_probe(struct device *dev)
86{
87 /* Make gk20a power domain a subdomain of host1x */
88 nvhost_register_client_domain(dev_to_genpd(dev));
89 return 0;
90}
91
92static int gv11b_tegra_remove(struct device *dev)
93{
94 /* remove gk20a power subdomain from host1x */
95 nvhost_unregister_client_domain(dev_to_genpd(dev));
96
97 return 0;
98
99}
100
101static bool gv11b_tegra_is_railgated(struct device *dev)
102{
103 bool ret = false;
104
105 return ret;
106}
107
108static int gv11b_tegra_railgate(struct device *dev)
109{
110 return 0;
111}
112
113static int gv11b_tegra_unrailgate(struct device *dev)
114{
115 int ret = 0;
116 return ret;
117}
118
119static int gv11b_tegra_suspend(struct device *dev)
120{
121 return 0;
122}
123
124struct gk20a_platform t19x_gpu_tegra_platform = {
125 .has_syncpoints = false,
126
127 /* power management configuration */
128
129 /* ptimer src frequency in hz*/
130 .ptimer_src_freq = 31250000,
131
132 .probe = gv11b_tegra_probe,
133 .late_probe = gv11b_tegra_late_probe,
134 .remove = gv11b_tegra_remove,
135
136 /* power management callbacks */
137 .suspend = gv11b_tegra_suspend,
138 .railgate = gv11b_tegra_railgate,
139 .unrailgate = gv11b_tegra_unrailgate,
140 .is_railgated = gv11b_tegra_is_railgated,
141
142 .busy = gk20a_tegra_busy,
143 .idle = gk20a_tegra_idle,
144
145 .dump_platform_dependencies = gk20a_tegra_debug_dump,
146
147 .default_big_page_size = SZ_64K,
148
149};