diff options
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/Makefile | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c | 99 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/nvgpu_gpuid_t18x.h | 1 |
3 files changed, 102 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 | |||
16 | obj-$(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 | |||
30 | static 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 | |||
56 | static int gp10b_tegra_late_probe(struct platform_device *pdev) | ||
57 | { | ||
58 | return 0; | ||
59 | } | ||
60 | |||
61 | static bool gp10b_tegra_is_railgated(struct platform_device *pdev) | ||
62 | { | ||
63 | return false; | ||
64 | } | ||
65 | |||
66 | static int gp10b_tegra_railgate(struct platform_device *pdev) | ||
67 | { | ||
68 | return 0; | ||
69 | } | ||
70 | |||
71 | static int gp10b_tegra_unrailgate(struct platform_device *pdev) | ||
72 | { | ||
73 | return 0; | ||
74 | } | ||
75 | |||
76 | static int gp10b_tegra_suspend(struct device *dev) | ||
77 | { | ||
78 | return 0; | ||
79 | } | ||
80 | |||
81 | struct 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 | }; | ||
diff --git a/drivers/gpu/nvgpu/nvgpu_gpuid_t18x.h b/drivers/gpu/nvgpu/nvgpu_gpuid_t18x.h index fe027fb0..ac65af18 100644 --- a/drivers/gpu/nvgpu/nvgpu_gpuid_t18x.h +++ b/drivers/gpu/nvgpu/nvgpu_gpuid_t18x.h | |||
@@ -27,4 +27,5 @@ | |||
27 | #define TEGRA_18x_GPU_COMPAT_GENERIC NVGPU_COMPAT_GENERIC_GP10B | 27 | #define TEGRA_18x_GPU_COMPAT_GENERIC NVGPU_COMPAT_GENERIC_GP10B |
28 | struct gpu_ops; | 28 | struct gpu_ops; |
29 | extern int gp10b_init_hal(struct gpu_ops *); | 29 | extern int gp10b_init_hal(struct gpu_ops *); |
30 | extern struct gk20a_platform t18x_gpu_tegra_platform; | ||
30 | #endif | 31 | #endif |