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>
This commit is contained in:
Deepak Nibade
2017-06-02 14:51:08 +05:30
committed by mobile promotions
parent 366386d189
commit 5205ab23a2
2 changed files with 14 additions and 30 deletions

View File

@@ -14,10 +14,6 @@
*/
#include <linux/delay.h>
#include <linux/types.h>
#ifdef CONFIG_TEGRA_GK20A_NVHOST
#include <linux/nvhost.h>
#include <linux/nvhost_t194.h>
#endif
#include <nvgpu/semaphore.h>
#include <nvgpu/timers.h>
@@ -27,6 +23,7 @@
#include <nvgpu/gmmu.h>
#include <nvgpu/soc.h>
#include <nvgpu/debug.h>
#include <nvgpu/nvhost_t19x.h>
#include "gk20a/gk20a.h"
#include "gk20a/fifo_gk20a.h"
@@ -1461,7 +1458,7 @@ static void gv11b_fifo_add_syncpt_wait_cmd(struct gk20a *g,
u32 id, u32 thresh, u64 gpu_va_base)
{
u64 gpu_va = gpu_va_base +
nvhost_syncpt_unit_interface_get_byte_offset(id);
nvgpu_nvhost_syncpt_unit_interface_get_byte_offset(id);
gk20a_dbg_fn("");
@@ -1497,7 +1494,7 @@ static void gv11b_fifo_add_syncpt_incr_cmd(struct gk20a *g,
{
u32 off = cmd->off;
u64 gpu_va = gpu_va_base +
nvhost_syncpt_unit_interface_get_byte_offset(id);
nvgpu_nvhost_syncpt_unit_interface_get_byte_offset(id);
gk20a_dbg_fn("");

View File

@@ -19,9 +19,8 @@
#include <linux/nvmap.h>
#include <linux/reset.h>
#include <linux/hashtable.h>
#ifdef CONFIG_TEGRA_GK20A_NVHOST
#include <linux/nvhost_t194.h>
#endif
#include <nvgpu/nvhost.h>
#include <nvgpu/nvhost_t19x.h>
#include <uapi/linux/nvgpu.h>
@@ -40,38 +39,26 @@ static void gr_gv11b_remove_sysfs(struct device *dev);
static int gv11b_tegra_probe(struct device *dev)
{
int err = 0;
struct gk20a_platform *platform = dev_get_drvdata(dev);
struct gk20a *g = platform->g;
struct device_node *np = dev->of_node;
struct device_node *host1x_node;
struct platform_device *host1x_pdev;
const __be32 *host1x_ptr;
#ifdef CONFIG_TEGRA_GK20A_NVHOST
host1x_ptr = of_get_property(np, "nvidia,host1x", NULL);
if (!host1x_ptr) {
struct gk20a *g = platform->g;
int err = 0;
err = nvgpu_get_nvhost_dev(g);
if (err) {
dev_err(dev, "host1x device not available");
return -ENOSYS;
return err;
}
host1x_node = of_find_node_by_phandle(be32_to_cpup(host1x_ptr));
host1x_pdev = of_find_device_by_node(host1x_node);
if (!host1x_pdev) {
dev_err(dev, "host1x device not available");
return -ENOSYS;
}
platform->g->host1x_dev = host1x_pdev;
err = nvhost_syncpt_unit_interface_get_aperture(
g->host1x_dev,
err = nvgpu_nvhost_syncpt_unit_interface_get_aperture(
g->nvhost_dev,
&g->syncpt_unit_base,
&g->syncpt_unit_size);
if (err) {
dev_err(dev, "Failed to get syncpt interface");
return -ENOSYS;
}
g->syncpt_size = nvhost_syncpt_unit_interface_get_byte_offset(1);
g->syncpt_size = nvgpu_nvhost_syncpt_unit_interface_get_byte_offset(1);
gk20a_dbg_info("syncpt_unit_base %llx syncpt_unit_size %zx size %x\n",
g->syncpt_unit_base, g->syncpt_unit_size,
g->syncpt_size);