summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2015-02-23 18:20:36 -0500
committerDeepak Nibade <dnibade@nvidia.com>2016-12-27 04:52:05 -0500
commit607b8649768ff32ce435cbf5726c9d185a68cd85 (patch)
treeb839362f2d12b2a268ddef82731940ad224de3e4
parentd2a5cf6e80a65366bc2ba78303cb8ef1f12f1596 (diff)
gpu: nvgpu: Implement syncpt protection
Change-Id: I05b2554588e5e1001cdbb54551cf8a064ea531bd Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/711303 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com> Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/gp10b/fifo_gp10b.c27
-rw-r--r--drivers/gpu/nvgpu/gp10b/hw_pbdma_gp10b.h26
-rw-r--r--drivers/gpu/nvgpu/gp10b/hw_ram_gp10b.h4
3 files changed, 55 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/fifo_gp10b.c b/drivers/gpu/nvgpu/gp10b/fifo_gp10b.c
index 59f7deef..08f1c13c 100644
--- a/drivers/gpu/nvgpu/gp10b/fifo_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/fifo_gp10b.c
@@ -147,10 +147,35 @@ static u32 gp10b_fifo_get_pbdma_signature(struct gk20a *g)
147 | pbdma_signature_sw_zero_f(); 147 | pbdma_signature_sw_zero_f();
148} 148}
149 149
150static int gp10b_fifo_resetup_ramfc(struct channel_gk20a *c)
151{
152 int syncpt_id;
153 void *inst_ptr;
154
155 gk20a_dbg_fn("");
156
157 inst_ptr = c->inst_block.cpu_va;
158 if (c->sync) {
159 u32 v = pbdma_allowed_syncpoints_0_valid_f(1);
160
161 syncpt_id = c->sync->syncpt_id(c->sync);
162 gk20a_dbg_info("Channel %d, syncpt id %d\n",
163 c->hw_chid, syncpt_id);
164
165 v |= pbdma_allowed_syncpoints_0_index_f(syncpt_id);
166
167 gk20a_mem_wr32(inst_ptr, ram_fc_allowed_syncpoints_w(), v);
168 }
169
170 gk20a_dbg_fn("done");
171
172 return 0;
173}
174
150void gp10b_init_fifo(struct gpu_ops *gops) 175void gp10b_init_fifo(struct gpu_ops *gops)
151{ 176{
152 gm20b_init_fifo(gops); 177 gm20b_init_fifo(gops);
153 gops->fifo.setup_ramfc = channel_gp10b_setup_ramfc; 178 gops->fifo.setup_ramfc = channel_gp10b_setup_ramfc;
154 gops->fifo.get_pbdma_signature = gp10b_fifo_get_pbdma_signature; 179 gops->fifo.get_pbdma_signature = gp10b_fifo_get_pbdma_signature;
155 180 gops->fifo.resetup_ramfc = gp10b_fifo_resetup_ramfc;
156} 181}
diff --git a/drivers/gpu/nvgpu/gp10b/hw_pbdma_gp10b.h b/drivers/gpu/nvgpu/gp10b/hw_pbdma_gp10b.h
index 91429b47..18db8595 100644
--- a/drivers/gpu/nvgpu/gp10b/hw_pbdma_gp10b.h
+++ b/drivers/gpu/nvgpu/gp10b/hw_pbdma_gp10b.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -410,6 +410,10 @@ static inline u32 pbdma_intr_0_signature_pending_f(void)
410{ 410{
411 return 0x80000000; 411 return 0x80000000;
412} 412}
413static inline u32 pbdma_intr_0_syncpoint_illegal_pending_f(void)
414{
415 return 0x10000000;
416}
413static inline u32 pbdma_intr_1_r(u32 i) 417static inline u32 pbdma_intr_1_r(u32 i)
414{ 418{
415 return 0x00040148 + i*8192; 419 return 0x00040148 + i*8192;
@@ -438,6 +442,26 @@ static inline u32 pbdma_udma_nop_r(void)
438{ 442{
439 return 0x00000008; 443 return 0x00000008;
440} 444}
445static inline u32 pbdma_allowed_syncpoints_r(u32 i)
446{
447 return 0x000400e8 + i*8192;
448}
449static inline u32 pbdma_allowed_syncpoints_0_valid_f(u32 v)
450{
451 return (v & 0x1) << 31;
452}
453static inline u32 pbdma_allowed_syncpoints_0_index_f(u32 v)
454{
455 return (v & 0x7fff) << 16;
456}
457static inline u32 pbdma_allowed_syncpoints_1_valid_f(u32 v)
458{
459 return (v & 0x1) << 15;
460}
461static inline u32 pbdma_allowed_syncpoints_1_index_f(u32 v)
462{
463 return (v & 0x7fff) << 0;
464}
441static inline u32 pbdma_syncpointa_r(u32 i) 465static inline u32 pbdma_syncpointa_r(u32 i)
442{ 466{
443 return 0x000400a4 + i*8192; 467 return 0x000400a4 + i*8192;
diff --git a/drivers/gpu/nvgpu/gp10b/hw_ram_gp10b.h b/drivers/gpu/nvgpu/gp10b/hw_ram_gp10b.h
index dea53f96..863b15b8 100644
--- a/drivers/gpu/nvgpu/gp10b/hw_ram_gp10b.h
+++ b/drivers/gpu/nvgpu/gp10b/hw_ram_gp10b.h
@@ -342,6 +342,10 @@ static inline u32 ram_fc_formats_w(void)
342{ 342{
343 return 39; 343 return 39;
344} 344}
345static inline u32 ram_fc_allowed_syncpoints_w(void)
346{
347 return 58;
348}
345static inline u32 ram_fc_syncpointa_w(void) 349static inline u32 ram_fc_syncpointa_w(void)
346{ 350{
347 return 41; 351 return 41;