summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp10b
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-05-01 18:31:00 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-05-12 13:19:52 -0400
commita8cf64019f74dd05626a911af3df079efd9c7c89 (patch)
treeb88b450a989a13cb4cbd0f831cd7add30c4ef0c4 /drivers/gpu/nvgpu/gp10b
parent5a4926f2918b84fccefb8ddf6dbaa7b6449735bf (diff)
gpu: nvgpu: Introduce priv ring HAL and define ISR
Introduce a priv ring HAL and define ISR as the only function in it. Introduce a gp10b version of the ISR that writes error message to UART for every priv ring error, and leave the old chips with silent error handling. Bug 1846641 Change-Id: I73e38396205ac7bb7b8488b7fbca3ff67a3db3bb Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1473696 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b')
-rw-r--r--drivers/gpu/nvgpu/gp10b/hal_gp10b.c4
-rw-r--r--drivers/gpu/nvgpu/gp10b/priv_ring_gp10b.c82
-rw-r--r--drivers/gpu/nvgpu/gp10b/priv_ring_gp10b.h22
3 files changed, 107 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
index 40e49e13..1d3ad275 100644
--- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GP10B Tegra HAL interface 2 * GP10B Tegra HAL interface
3 * 3 *
4 * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2014-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,
@@ -34,6 +34,7 @@
34#include "gp10b/regops_gp10b.h" 34#include "gp10b/regops_gp10b.h"
35#include "gp10b/cde_gp10b.h" 35#include "gp10b/cde_gp10b.h"
36#include "gp10b/therm_gp10b.h" 36#include "gp10b/therm_gp10b.h"
37#include "gp10b/priv_ring_gp10b.h"
37 38
38#include "gm20b/gr_gm20b.h" 39#include "gm20b/gr_gm20b.h"
39#include "gm20b/fifo_gm20b.h" 40#include "gm20b/fifo_gm20b.h"
@@ -233,6 +234,7 @@ int gp10b_init_hal(struct gk20a *g)
233 234
234 gk20a_init_bus(gops); 235 gk20a_init_bus(gops);
235 gp10b_init_mc(gops); 236 gp10b_init_mc(gops);
237 gp10b_init_priv_ring(gops);
236 gp10b_init_gr(gops); 238 gp10b_init_gr(gops);
237 gp10b_init_fecs_trace_ops(gops); 239 gp10b_init_fecs_trace_ops(gops);
238 gp10b_init_ltc(gops); 240 gp10b_init_ltc(gops);
diff --git a/drivers/gpu/nvgpu/gp10b/priv_ring_gp10b.c b/drivers/gpu/nvgpu/gp10b/priv_ring_gp10b.c
new file mode 100644
index 00000000..7cdbec5e
--- /dev/null
+++ b/drivers/gpu/nvgpu/gp10b/priv_ring_gp10b.c
@@ -0,0 +1,82 @@
1/*
2 * GP10B priv ring
3 *
4 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
5 *
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,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#include "gk20a/gk20a.h"
20
21#include <nvgpu/log.h>
22#include <nvgpu/timers.h>
23
24#include <nvgpu/hw/gp10b/hw_mc_gp10b.h>
25#include <nvgpu/hw/gp10b/hw_pri_ringmaster_gp10b.h>
26#include <nvgpu/hw/gp10b/hw_pri_ringstation_sys_gp10b.h>
27#include <nvgpu/hw/gp10b/hw_pri_ringstation_gpc_gp10b.h>
28
29static void gp10b_priv_ring_isr(struct gk20a *g)
30{
31 u32 status0, status1;
32 u32 cmd;
33 s32 retry = 100;
34 u32 gpc;
35 u32 gpc_stride = nvgpu_get_litter_value(g, GPU_LIT_GPC_STRIDE);
36
37 if (g->is_fmodel)
38 return;
39
40 status0 = gk20a_readl(g, pri_ringmaster_intr_status0_r());
41 status1 = gk20a_readl(g, pri_ringmaster_intr_status1_r());
42
43 nvgpu_err(g, "ringmaster intr status0: 0x%08x,"
44 "status1: 0x%08x", status0, status1);
45
46 if (pri_ringmaster_intr_status0_gbl_write_error_sys_v(status0) != 0) {
47 nvgpu_err(g, "SYS write error. ADR %08x WRDAT %08x INFO %08x, CODE %08x",
48 gk20a_readl(g, pri_ringstation_sys_priv_error_adr_r()),
49 gk20a_readl(g, pri_ringstation_sys_priv_error_wrdat_r()),
50 gk20a_readl(g, pri_ringstation_sys_priv_error_info_r()),
51 gk20a_readl(g, pri_ringstation_sys_priv_error_code_r()));
52 }
53
54 for (gpc = 0; gpc < g->gr.gpc_count; gpc++) {
55 if (status1 & BIT(gpc)) {
56 nvgpu_err(g, "GPC%u write error. ADR %08x WRDAT %08x INFO %08x, CODE %08x", gpc,
57 gk20a_readl(g, pri_ringstation_gpc_gpc0_priv_error_adr_r() + gpc * gpc_stride),
58 gk20a_readl(g, pri_ringstation_gpc_gpc0_priv_error_wrdat_r() + gpc * gpc_stride),
59 gk20a_readl(g, pri_ringstation_gpc_gpc0_priv_error_info_r() + gpc * gpc_stride),
60 gk20a_readl(g, pri_ringstation_gpc_gpc0_priv_error_code_r() + gpc * gpc_stride));
61 }
62 }
63
64 cmd = gk20a_readl(g, pri_ringmaster_command_r());
65 cmd = set_field(cmd, pri_ringmaster_command_cmd_m(),
66 pri_ringmaster_command_cmd_ack_interrupt_f());
67 gk20a_writel(g, pri_ringmaster_command_r(), cmd);
68
69 do {
70 cmd = pri_ringmaster_command_cmd_v(
71 gk20a_readl(g, pri_ringmaster_command_r()));
72 nvgpu_usleep_range(20, 40);
73 } while (cmd != pri_ringmaster_command_cmd_no_cmd_v() && --retry);
74
75 if (retry <= 0)
76 nvgpu_warn(g, "priv ringmaster cmd ack too many retries");
77}
78
79void gp10b_init_priv_ring(struct gpu_ops *gops)
80{
81 gops->priv_ring.isr = gp10b_priv_ring_isr;
82}
diff --git a/drivers/gpu/nvgpu/gp10b/priv_ring_gp10b.h b/drivers/gpu/nvgpu/gp10b/priv_ring_gp10b.h
new file mode 100644
index 00000000..acd0857f
--- /dev/null
+++ b/drivers/gpu/nvgpu/gp10b/priv_ring_gp10b.h
@@ -0,0 +1,22 @@
1/*
2 * GP10B PRIV ringmaster
3 *
4 * Copyright (c) 2011-2017, NVIDIA CORPORATION. All rights reserved.
5 *
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,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 */
15#ifndef __PRIV_RING_GP10B_H__
16#define __PRIV_RING_GP10B_H__
17
18struct gpu_ops;
19
20void gp10b_init_priv_ring(struct gpu_ops *gops);
21
22#endif /*__PRIV_RING_GP10B_H__*/