summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2017-06-02 05:21:08 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-06-08 09:37:17 -0400
commit5205ab23a29d6bb2d94eecae67ba344f438c5045 (patch)
tree9305a25a50771b12393e11aa5901e493993806c7 /drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c
parent366386d1898af61eb425aa8b37cfb656ff898c1a (diff)
gpu: nvgpu: use nvgpu specific nvhost APIs
Remove use of linux specifix header files <linux/nvhost.h> and <linux/nvhost_t194.h> and use nvgpu specific header file <nvgpu/nvhost_t19x.h> instead This is needed to remove all Linux dependencies from nvgpu driver Replace all nvhost_*() calls by nvgpu_nvhost_*() calls from new nvgpu library Jira NVGPU-29 Change-Id: I32d59628ca5ab3ece80a10eb5aefa150b1da448b Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/1494648 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c')
-rw-r--r--drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c33
1 files changed, 10 insertions, 23 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c
index 4b600cdd..2b6f8759 100644
--- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c
+++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c
@@ -19,9 +19,8 @@
19#include <linux/nvmap.h> 19#include <linux/nvmap.h>
20#include <linux/reset.h> 20#include <linux/reset.h>
21#include <linux/hashtable.h> 21#include <linux/hashtable.h>
22#ifdef CONFIG_TEGRA_GK20A_NVHOST 22#include <nvgpu/nvhost.h>
23#include <linux/nvhost_t194.h> 23#include <nvgpu/nvhost_t19x.h>
24#endif
25 24
26#include <uapi/linux/nvgpu.h> 25#include <uapi/linux/nvgpu.h>
27 26
@@ -40,38 +39,26 @@ static void gr_gv11b_remove_sysfs(struct device *dev);
40 39
41static int gv11b_tegra_probe(struct device *dev) 40static int gv11b_tegra_probe(struct device *dev)
42{ 41{
43 int err = 0;
44 struct gk20a_platform *platform = dev_get_drvdata(dev); 42 struct gk20a_platform *platform = dev_get_drvdata(dev);
45 struct gk20a *g = platform->g;
46 struct device_node *np = dev->of_node;
47 struct device_node *host1x_node;
48 struct platform_device *host1x_pdev;
49 const __be32 *host1x_ptr;
50
51#ifdef CONFIG_TEGRA_GK20A_NVHOST 43#ifdef CONFIG_TEGRA_GK20A_NVHOST
52 host1x_ptr = of_get_property(np, "nvidia,host1x", NULL); 44 struct gk20a *g = platform->g;
53 if (!host1x_ptr) { 45 int err = 0;
54 dev_err(dev, "host1x device not available");
55 return -ENOSYS;
56 }
57 46
58 host1x_node = of_find_node_by_phandle(be32_to_cpup(host1x_ptr)); 47 err = nvgpu_get_nvhost_dev(g);
59 host1x_pdev = of_find_device_by_node(host1x_node); 48 if (err) {
60 if (!host1x_pdev) {
61 dev_err(dev, "host1x device not available"); 49 dev_err(dev, "host1x device not available");
62 return -ENOSYS; 50 return err;
63 } 51 }
64 52
65 platform->g->host1x_dev = host1x_pdev; 53 err = nvgpu_nvhost_syncpt_unit_interface_get_aperture(
66 err = nvhost_syncpt_unit_interface_get_aperture( 54 g->nvhost_dev,
67 g->host1x_dev,
68 &g->syncpt_unit_base, 55 &g->syncpt_unit_base,
69 &g->syncpt_unit_size); 56 &g->syncpt_unit_size);
70 if (err) { 57 if (err) {
71 dev_err(dev, "Failed to get syncpt interface"); 58 dev_err(dev, "Failed to get syncpt interface");
72 return -ENOSYS; 59 return -ENOSYS;
73 } 60 }
74 g->syncpt_size = nvhost_syncpt_unit_interface_get_byte_offset(1); 61 g->syncpt_size = nvgpu_nvhost_syncpt_unit_interface_get_byte_offset(1);
75 gk20a_dbg_info("syncpt_unit_base %llx syncpt_unit_size %zx size %x\n", 62 gk20a_dbg_info("syncpt_unit_base %llx syncpt_unit_size %zx size %x\n",
76 g->syncpt_unit_base, g->syncpt_unit_size, 63 g->syncpt_unit_base, g->syncpt_unit_size,
77 g->syncpt_size); 64 g->syncpt_size);