summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp10b
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2014-10-31 05:59:39 -0400
committerDeepak Nibade <dnibade@nvidia.com>2016-12-27 04:52:02 -0500
commit0f4da5e11825ae26f86efcd06dede8dfb80e73fd (patch)
tree12a25a464856292d9033a24f5ab38cc0d455095f /drivers/gpu/nvgpu/gp10b
parent23a4456260f163881b54b89fc14ec14a2b0d1f35 (diff)
gpu: nvgpu: Add own platform data to enable host1x
Add gp10b platform data to enable sync point support. Bug 1572701 Change-Id: Iaf03ecb8fb6b8bf4bb824e2a012c80dfe3f4fcae Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/592099 Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b')
-rw-r--r--drivers/gpu/nvgpu/gp10b/Makefile2
-rw-r--r--drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c99
2 files changed, 101 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/Makefile b/drivers/gpu/nvgpu/gp10b/Makefile
index 722cc550..193efee0 100644
--- a/drivers/gpu/nvgpu/gp10b/Makefile
+++ b/drivers/gpu/nvgpu/gp10b/Makefile
@@ -12,3 +12,5 @@ obj-$(CONFIG_GK20A) += \
12 gr_gp10b.o \ 12 gr_gp10b.o \
13 mc_gp10b.o \ 13 mc_gp10b.o \
14 hal_gp10b.o 14 hal_gp10b.o
15
16obj-$(CONFIG_TEGRA_GK20A) += platform_gp10b_tegra.o
diff --git a/drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c b/drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c
new file mode 100644
index 00000000..7a25a3fc
--- /dev/null
+++ b/drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c
@@ -0,0 +1,99 @@
1/*
2 * drivers/video/tegra/host/gk20a/platform_gk20a_tegra.c
3 *
4 * GK20A Tegra Platform Interface
5 *
6 * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms and conditions of the GNU General Public License,
10 * version 2, as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * more details.
16 */
17
18#include <linux/of_platform.h>
19#include <linux/nvhost.h>
20#include <linux/debugfs.h>
21#include <linux/tegra-powergate.h>
22#include <linux/platform_data/tegra_edp.h>
23#include <uapi/linux/nvgpu.h>
24#include <linux/dma-buf.h>
25#include <linux/nvmap.h>
26#include <linux/tegra_pm_domains.h>
27#include "gk20a/platform_gk20a.h"
28#include "gk20a/gk20a.h"
29
30static int gp10b_tegra_probe(struct platform_device *pdev)
31{
32 struct gk20a_platform *platform = gk20a_get_platform(pdev);
33 struct device_node *np = pdev->dev.of_node;
34 struct device_node *host1x_node;
35 struct platform_device *host1x_pdev;
36 const __be32 *host1x_ptr;
37
38 host1x_ptr = of_get_property(np, "nvidia,host1x", NULL);
39 if (!host1x_ptr) {
40 gk20a_err(&pdev->dev, "host1x device not available");
41 return -ENOSYS;
42 }
43
44 host1x_node = of_find_node_by_phandle(be32_to_cpup(host1x_ptr));
45 host1x_pdev = of_find_device_by_node(host1x_node);
46 if (!host1x_pdev) {
47 gk20a_err(&pdev->dev, "host1x device not available");
48 return -ENOSYS;
49 }
50
51 platform->g->host1x_dev = host1x_pdev;
52
53 return 0;
54}
55
56static int gp10b_tegra_late_probe(struct platform_device *pdev)
57{
58 return 0;
59}
60
61static bool gp10b_tegra_is_railgated(struct platform_device *pdev)
62{
63 return false;
64}
65
66static int gp10b_tegra_railgate(struct platform_device *pdev)
67{
68 return 0;
69}
70
71static int gp10b_tegra_unrailgate(struct platform_device *pdev)
72{
73 return 0;
74}
75
76static int gp10b_tegra_suspend(struct device *dev)
77{
78 return 0;
79}
80
81struct gk20a_platform t18x_gpu_tegra_platform = {
82 .has_syncpoints = true,
83
84 .default_big_page_size = SZ_128K,
85
86 .probe = gp10b_tegra_probe,
87 .late_probe = gp10b_tegra_late_probe,
88
89 /* power management callbacks */
90 .suspend = gp10b_tegra_suspend,
91 .railgate = gp10b_tegra_railgate,
92 .unrailgate = gp10b_tegra_unrailgate,
93 .is_railgated = gp10b_tegra_is_railgated,
94
95 .busy = gk20a_tegra_busy,
96 .idle = gk20a_tegra_idle,
97
98 .dump_platform_dependencies = gk20a_tegra_debug_dump,
99};