summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2018-05-24 15:31:57 -0400
committerTejal Kudav <tkudav@nvidia.com>2018-06-14 09:44:07 -0400
commited65f1f26e2d0ca4a491215297b61d25b0c1493b (patch)
treead4ce439a0f77fe89f9138e6f4284aeaa996b4c8 /drivers/gpu/nvgpu/gk20a
parent4eae06299ba35e3f6a48eef4a19cde6d1c374deb (diff)
gpu: nvgpu: Move setting priv interrupt to priv_ring
Registers to set priv interrupts are in priv_ring, but the code was in bus HAL. Move the code and related HALs to priv_ring instead. JIRA NVGPU-588 Change-Id: I708d11f77405dbba86586a0d1da42f65bcc1de9d Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1730889 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h2
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c4
-rw-r--r--drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c12
-rw-r--r--drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.h1
4 files changed, 16 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index 77e6e759..2d304cff 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -1128,7 +1128,6 @@ struct gpu_ops {
1128 u32 source_id, u32 count, 1128 u32 source_id, u32 count,
1129 struct nvgpu_cpu_time_correlation_sample *); 1129 struct nvgpu_cpu_time_correlation_sample *);
1130 int (*bar1_bind)(struct gk20a *g, struct nvgpu_mem *bar1_inst); 1130 int (*bar1_bind)(struct gk20a *g, struct nvgpu_mem *bar1_inst);
1131 void (*set_ppriv_timeout_settings)(struct gk20a *g);
1132 } bus; 1131 } bus;
1133 1132
1134 struct { 1133 struct {
@@ -1179,6 +1178,7 @@ struct gpu_ops {
1179 struct { 1178 struct {
1180 void (*isr)(struct gk20a *g); 1179 void (*isr)(struct gk20a *g);
1181 void (*decode_error_code)(struct gk20a *g, u32 error_code); 1180 void (*decode_error_code)(struct gk20a *g, u32 error_code);
1181 void (*set_ppriv_timeout_settings)(struct gk20a *g);
1182 } priv_ring; 1182 } priv_ring;
1183 struct { 1183 struct {
1184 int (*check_priv_security)(struct gk20a *g); 1184 int (*check_priv_security)(struct gk20a *g);
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index 52346541..42e96715 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -4502,8 +4502,8 @@ static int gk20a_init_gr_setup_hw(struct gk20a *g)
4502 4502
4503 gr_gk20a_zcull_init_hw(g, gr); 4503 gr_gk20a_zcull_init_hw(g, gr);
4504 4504
4505 if (g->ops.bus.set_ppriv_timeout_settings) 4505 if (g->ops.priv_ring.set_ppriv_timeout_settings)
4506 g->ops.bus.set_ppriv_timeout_settings(g); 4506 g->ops.priv_ring.set_ppriv_timeout_settings(g);
4507 4507
4508 /* enable fifo access */ 4508 /* enable fifo access */
4509 gk20a_writel(g, gr_gpfifo_ctl_r(), 4509 gk20a_writel(g, gr_gpfifo_ctl_r(),
diff --git a/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c b/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c
index dea42b55..adbaf94f 100644
--- a/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c
@@ -32,6 +32,7 @@
32#include <nvgpu/hw/gk20a/hw_pri_ringmaster_gk20a.h> 32#include <nvgpu/hw/gk20a/hw_pri_ringmaster_gk20a.h>
33#include <nvgpu/hw/gk20a/hw_pri_ringstation_sys_gk20a.h> 33#include <nvgpu/hw/gk20a/hw_pri_ringstation_sys_gk20a.h>
34#include <nvgpu/hw/gk20a/hw_pri_ringstation_gpc_gk20a.h> 34#include <nvgpu/hw/gk20a/hw_pri_ringstation_gpc_gk20a.h>
35#include <nvgpu/hw/gk20a/hw_pri_ringstation_fbp_gk20a.h>
35 36
36void gk20a_enable_priv_ring(struct gk20a *g) 37void gk20a_enable_priv_ring(struct gk20a *g)
37{ 38{
@@ -103,3 +104,14 @@ void gk20a_priv_ring_isr(struct gk20a *g)
103 if (retry == 0 && cmd != pri_ringmaster_command_cmd_no_cmd_v()) 104 if (retry == 0 && cmd != pri_ringmaster_command_cmd_no_cmd_v())
104 nvgpu_warn(g, "priv ringmaster intr ack too many retries"); 105 nvgpu_warn(g, "priv ringmaster intr ack too many retries");
105} 106}
107
108void gk20a_priv_set_timeout_settings(struct gk20a *g)
109{
110 /*
111 * Bug 1340570: increase the clock timeout to avoid potential
112 * operation failure at high gpcclk rate. Default values are 0x400.
113 */
114 nvgpu_writel(g, pri_ringstation_sys_master_config_r(0x15), 0x800);
115 nvgpu_writel(g, pri_ringstation_gpc_master_config_r(0xa), 0x800);
116 nvgpu_writel(g, pri_ringstation_fbp_master_config_r(0x8), 0x800);
117}
diff --git a/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.h b/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.h
index ef564eeb..98040624 100644
--- a/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.h
@@ -28,5 +28,6 @@ struct gpu_ops;
28 28
29void gk20a_priv_ring_isr(struct gk20a *g); 29void gk20a_priv_ring_isr(struct gk20a *g);
30void gk20a_enable_priv_ring(struct gk20a *g); 30void gk20a_enable_priv_ring(struct gk20a *g);
31void gk20a_priv_set_timeout_settings(struct gk20a *g);
31 32
32#endif /*__PRIV_RING_GK20A_H__*/ 33#endif /*__PRIV_RING_GK20A_H__*/