summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-09-27 16:21:44 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-10-13 18:19:55 -0400
commitbe3750bc9eb60f8696c20b7298cc282eea17ac1b (patch)
treeb36fb818ce58a96fc7f2822480433057bd28faf4 /drivers/gpu/nvgpu/gk20a/gk20a.c
parentff9c3fc20a27444cd1ff7d9402965023e425f404 (diff)
gpu: nvgpu: Abstract IO aperture accessors
Add abstraction of IO aperture accessors. Add new functions gk20a_io_exists() and gk20a_io_valid_reg() to remove dependencies to aperture fields from common code. Implement Linux version of the abstraction by moving gk20a_readl() and gk20a_writel() to new Linux specific io.c. Move the fields defining IO aperture to nvgpu_os_linux. Add t19x specific IO aperture initialization functions and add t19x specific section to nvgpu_os_linux. JIRA NVGPU-259 Change-Id: I09e79cda60d11a20d1099a9aaa6d2375236e94ce Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1569698 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c
index cac62db7..a4becda0 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.c
@@ -65,32 +65,6 @@ void __nvgpu_check_gpu_state(struct gk20a *g)
65 } 65 }
66} 66}
67 67
68/*
69 * Locks out the driver from accessing GPU registers. This prevents access to
70 * thse registers after the GPU has been clock or power gated. This should help
71 * find annoying bugs where register reads and writes are silently dropped
72 * after the GPU has been turned off. On older chips these reads and writes can
73 * also lock the entire CPU up.
74 */
75int gk20a_lockout_registers(struct gk20a *g)
76{
77 g->regs = NULL;
78 g->bar1 = NULL;
79
80 return 0;
81}
82
83/*
84 * Undoes gk20a_lockout_registers().
85 */
86int gk20a_restore_registers(struct gk20a *g)
87{
88 g->regs = g->regs_saved;
89 g->bar1 = g->bar1_saved;
90
91 return 0;
92}
93
94void __gk20a_warn_on_no_regs(void) 68void __gk20a_warn_on_no_regs(void)
95{ 69{
96 WARN_ONCE(1, "Attempted access to GPU regs after unmapping!"); 70 WARN_ONCE(1, "Attempted access to GPU regs after unmapping!");