summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp106/xve_gp106.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2017-01-17 17:04:09 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-01-24 18:15:22 -0500
commit6715361156343afc6024513a6618ee4c89cbf49b (patch)
treeea03e86db83a6062395a0f44c11611c33250504b /drivers/gpu/nvgpu/gp106/xve_gp106.c
parentefe32664311677c87d4da4f0f0e36d519bcc5c16 (diff)
gpu: nvgpu: Add GPU reset for gp106 XVE
Resets the GPU without resetting the XVE/XP interfaces. This allows the GPU to stay attached to the PCI bus but still resets all the rest of the GPU's internal state. Bug 1816516 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: http://git-master/r/1287644 Reviewed-on: http://git-master/r/1287650 (cherry picked from commit c14efaee5d03a053d5bf229425a7594e1c6bfad0) Change-Id: If7aba3cc8109e30bd6b6aa145836e812d50b35c5 Reviewed-on: http://git-master/r/1292699 Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp106/xve_gp106.c')
-rw-r--r--drivers/gpu/nvgpu/gp106/xve_gp106.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gp106/xve_gp106.c b/drivers/gpu/nvgpu/gp106/xve_gp106.c
index a0ee8108..561140c6 100644
--- a/drivers/gpu/nvgpu/gp106/xve_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/xve_gp106.c
@@ -59,6 +59,40 @@ static u32 xve_xve_readl_gp106(struct gk20a *g, u32 reg)
59} 59}
60 60
61/** 61/**
62 * Resets the GPU (except the XVE/XP).
63 */
64static void xve_reset_gpu_gp106(struct gk20a *g)
65{
66 u32 reset;
67
68 /*
69 * This resets the GPU except for the XVE/XP (since then we would lose
70 * the dGPU from the bus). t18x has a HW limitation where once that
71 * happens the GPU is gone until the entire system is reset.
72 *
73 * We have to use the auto-deassert register since we won't be able to
74 * access the GPU after the GPU goes into reset. This appears like the
75 * GPU has dropped from the bus and causes nvgpu to reset the entire
76 * system. Whoops!
77 */
78 reset = xve_reset_reset_m() |
79 xve_reset_gpu_on_sw_reset_m() |
80 xve_reset_counter_en_m() |
81 xve_reset_counter_val_f(0x7ff) |
82 xve_reset_clock_on_sw_reset_m() |
83 xve_reset_clock_counter_en_m() |
84 xve_reset_clock_counter_val_f(0x7ff);
85
86 g->ops.xve.xve_writel(g, xve_reset_r(), reset | xve_reset_reset_m());
87
88 /*
89 * Don't access GPU until _after_ it's back out of reset!
90 */
91 msleep(100);
92 g->ops.xve.xve_writel(g, xve_reset_r(), 0);
93}
94
95/**
62 * Places one of: 96 * Places one of:
63 * 97 *
64 * %GPU_XVE_SPEED_2P5 98 * %GPU_XVE_SPEED_2P5
@@ -632,6 +666,7 @@ int gp106_init_xve_ops(struct gpu_ops *gops)
632 gops->xve.xve_readl = xve_xve_readl_gp106; 666 gops->xve.xve_readl = xve_xve_readl_gp106;
633 gops->xve.xve_writel = xve_xve_writel_gp106; 667 gops->xve.xve_writel = xve_xve_writel_gp106;
634 gops->xve.disable_aspm = xve_disable_aspm_gp106; 668 gops->xve.disable_aspm = xve_disable_aspm_gp106;
669 gops->xve.reset_gpu = xve_reset_gpu_gp106;
635 670
636 return 0; 671 return 0;
637} 672}