summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/nvhost.c
diff options
context:
space:
mode:
authorThomas Fleury <tfleury@nvidia.com>2018-02-20 23:39:22 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-05-07 19:03:45 -0400
commita5f3fe9506dcf87910eba24c80a4b30c03dcced1 (patch)
tree322374f40e46286ac0b98abe6e3dbce293943943 /drivers/gpu/nvgpu/common/linux/nvhost.c
parent15ec5722be8f483f6d9c1cd0bfd61a7e2bcbfca2 (diff)
gpu: nvgpu: gv100: enable syncpt shim for nvlink
Get host1x node reference from c1_rp device tree node, and enable syncpoints shim in case of nvlink. JIRA EVLR-2441 JIRA EVLR-2585 Change-Id: Idbf1edf656557f2ed2d3bd27393c2f4d5d1ad75a Signed-off-by: Thomas Fleury <tfleury@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1663360 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/nvhost.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/nvhost.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/nvhost.c b/drivers/gpu/nvgpu/common/linux/nvhost.c
index fa169cf0..6ab60248 100644
--- a/drivers/gpu/nvgpu/common/linux/nvhost.c
+++ b/drivers/gpu/nvgpu/common/linux/nvhost.c
@@ -258,4 +258,37 @@ u32 nvgpu_nvhost_syncpt_unit_interface_get_byte_offset(u32 syncpt_id)
258{ 258{
259 return nvhost_syncpt_unit_interface_get_byte_offset(syncpt_id); 259 return nvhost_syncpt_unit_interface_get_byte_offset(syncpt_id);
260} 260}
261
262int nvgpu_nvhost_syncpt_init(struct gk20a *g)
263{
264 int err = 0;
265
266 if (!g->has_syncpoints)
267 return -ENOSYS;
268
269 err = nvgpu_get_nvhost_dev(g);
270 if (err) {
271 nvgpu_err(g, "host1x device not available");
272 g->has_syncpoints = false;
273 return -ENOSYS;
274 }
275
276 err = nvgpu_nvhost_syncpt_unit_interface_get_aperture(
277 g->nvhost_dev,
278 &g->syncpt_unit_base,
279 &g->syncpt_unit_size);
280 if (err) {
281 nvgpu_err(g, "Failed to get syncpt interface");
282 g->has_syncpoints = false;
283 return -ENOSYS;
284 }
285
286 g->syncpt_size =
287 nvgpu_nvhost_syncpt_unit_interface_get_byte_offset(1);
288 nvgpu_info(g, "syncpt_unit_base %llx syncpt_unit_size %zx size %x\n",
289 g->syncpt_unit_base, g->syncpt_unit_size,
290 g->syncpt_size);
291
292 return 0;
293}
261#endif 294#endif