From a8cf64019f74dd05626a911af3df079efd9c7c89 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Mon, 1 May 2017 15:31:00 -0700 Subject: 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 Reviewed-on: http://git-master/r/1473696 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gk20a.h | 3 +++ drivers/gpu/nvgpu/gk20a/hal_gk20a.c | 2 ++ drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c | 5 +++++ drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.h | 9 ++++----- 4 files changed, 14 insertions(+), 5 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 03f61c33..626ed2bd 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -886,6 +886,9 @@ struct gpu_ops { struct { void (*falcon_hal_sw_init)(struct nvgpu_falcon *flcn); } falcon; + struct { + void (*isr)(struct gk20a *g); + } priv_ring; }; struct nvgpu_bios_ucode { diff --git a/drivers/gpu/nvgpu/gk20a/hal_gk20a.c b/drivers/gpu/nvgpu/gk20a/hal_gk20a.c index 3dbe856d..729a277f 100644 --- a/drivers/gpu/nvgpu/gk20a/hal_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/hal_gk20a.c @@ -35,6 +35,7 @@ #include "dbg_gpu_gk20a.h" #include "css_gr_gk20a.h" #include "pramin_gk20a.h" +#include "priv_ring_gk20a.h" #include #include @@ -155,6 +156,7 @@ int gk20a_init_hal(struct gk20a *g) gops->pmupstate = false; gk20a_init_bus(gops); gk20a_init_mc(gops); + gk20a_init_priv_ring(gops); gk20a_init_ltc(gops); gk20a_init_gr_ops(gops); gk20a_init_fecs_trace_ops(gops); diff --git a/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c b/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c index 96e21d2d..2f837bfc 100644 --- a/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c @@ -94,3 +94,8 @@ void gk20a_priv_ring_isr(struct gk20a *g) if (retry <= 0) nvgpu_warn(g, "priv ringmaster cmd ack too many retries"); } + +void gk20a_init_priv_ring(struct gpu_ops *gops) +{ + gops->priv_ring.isr = gk20a_priv_ring_isr; +} diff --git a/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.h b/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.h index 8a6320d7..61780288 100644 --- a/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.h @@ -11,15 +11,14 @@ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef __PRIV_RING_GK20A_H__ #define __PRIV_RING_GK20A_H__ -void gk20a_enable_priv_ring(struct gk20a *g); +struct gpu_ops; + void gk20a_priv_ring_isr(struct gk20a *g); +void gk20a_enable_priv_ring(struct gk20a *g); +void gk20a_init_priv_ring(struct gpu_ops *gops); #endif /*__PRIV_RING_GK20A_H__*/ -- cgit v1.2.2