summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c b/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c
index d16c5fd1..420b65f1 100644
--- a/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GK20A priv ring 2 * GK20A priv ring
3 * 3 *
4 * Copyright (c) 2011-2016, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2011-2017, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -24,7 +24,7 @@
24#include <nvgpu/hw/gk20a/hw_pri_ringmaster_gk20a.h> 24#include <nvgpu/hw/gk20a/hw_pri_ringmaster_gk20a.h>
25#include <nvgpu/hw/gk20a/hw_pri_ringstation_sys_gk20a.h> 25#include <nvgpu/hw/gk20a/hw_pri_ringstation_sys_gk20a.h>
26 26
27void gk20a_reset_priv_ring(struct gk20a *g) 27void gk20a_enable_priv_ring(struct gk20a *g)
28{ 28{
29 struct gk20a_platform *platform = dev_get_drvdata(g->dev); 29 struct gk20a_platform *platform = dev_get_drvdata(g->dev);
30 30
@@ -45,6 +45,27 @@ void gk20a_reset_priv_ring(struct gk20a *g)
45 45
46} 46}
47 47
48static void gk20a_reset_priv_ring(struct gk20a *g)
49{
50 u32 val;
51
52 gk20a_reset(g, mc_enable_priv_ring_enabled_f());
53
54 val = gk20a_readl(g, pri_ringstation_sys_decode_config_r());
55 val = set_field(val,
56 pri_ringstation_sys_decode_config_ring_m(),
57 pri_ringstation_sys_decode_config_ring_drop_on_ring_not_started_f());
58 gk20a_writel(g, pri_ringstation_sys_decode_config_r(), val);
59
60 gk20a_writel(g, pri_ringmaster_global_ctl_r(),
61 pri_ringmaster_global_ctl_ring_reset_asserted_f());
62 udelay(20);
63 gk20a_writel(g, pri_ringmaster_global_ctl_r(),
64 pri_ringmaster_global_ctl_ring_reset_deasserted_f());
65
66 gk20a_enable_priv_ring(g);
67}
68
48void gk20a_priv_ring_isr(struct gk20a *g) 69void gk20a_priv_ring_isr(struct gk20a *g)
49{ 70{
50 u32 status0, status1; 71 u32 status0, status1;