From d409d7ebc136470906b861f3bebb7da63e1557e6 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Fri, 17 Mar 2017 13:47:54 -0700 Subject: gpu: nvgpu: Add bus HAL Add bus HAL and separate bus related functions from mm_gv11b: timer access. Change-Id: I311f258857238233103688fb653d27e4e79005a4 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1323354 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv11b/bus_gv11b.c | 26 ++++++++++++++++++++++++++ drivers/gpu/nvgpu/gv11b/bus_gv11b.h | 21 +++++++++++++++++++++ drivers/gpu/nvgpu/gv11b/hal_gv11b.c | 3 ++- drivers/gpu/nvgpu/gv11b/mm_gv11b.c | 1 - 4 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 drivers/gpu/nvgpu/gv11b/bus_gv11b.c create mode 100644 drivers/gpu/nvgpu/gv11b/bus_gv11b.h (limited to 'drivers/gpu/nvgpu/gv11b') diff --git a/drivers/gpu/nvgpu/gv11b/bus_gv11b.c b/drivers/gpu/nvgpu/gv11b/bus_gv11b.c new file mode 100644 index 00000000..9a70b41c --- /dev/null +++ b/drivers/gpu/nvgpu/gv11b/bus_gv11b.c @@ -0,0 +1,26 @@ +/* + * GV11B BUS + * + * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#include "bus_gv11b.h" +#include "gk20a/gk20a.h" +#include "gk20a/bus_gk20a.h" + +void gv11b_init_bus(struct gpu_ops *gops) +{ + gops->bus.init_hw = gk20a_bus_init_hw; + gops->bus.isr = gk20a_bus_isr; + gops->bus.read_ptimer = gk20a_read_ptimer; + gops->bus.bar1_bind = NULL; +} diff --git a/drivers/gpu/nvgpu/gv11b/bus_gv11b.h b/drivers/gpu/nvgpu/gv11b/bus_gv11b.h new file mode 100644 index 00000000..fde0b14b --- /dev/null +++ b/drivers/gpu/nvgpu/gv11b/bus_gv11b.h @@ -0,0 +1,21 @@ +/* + * GV11B BUS + * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef BUS_GV11B_H +#define BUS_GV11B_H + +struct gpu_ops; + +void gv11b_init_bus(struct gpu_ops *gops); +#endif diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c index 133a1e8d..1b580558 100644 --- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c @@ -21,6 +21,7 @@ #include "gk20a/gk20a.h" #include "gk20a/dbg_gpu_gk20a.h" +#include "gk20a/bus_gk20a.h" #include "gm20b/gr_gm20b.h" @@ -185,6 +186,7 @@ int gv11b_init_hal(struct gk20a *g) gops->privsecurity = 0; gops->securegpccs = 0; + gk20a_init_bus(gops); gv11b_init_mc(gops); gv11b_init_ltc(gops); gv11b_init_gr(gops); @@ -203,7 +205,6 @@ int gv11b_init_hal(struct gk20a *g) gops->name = "gv11b"; gops->chip_init_gpu_characteristics = gv11b_init_gpu_characteristics; gops->get_litter_value = gv11b_get_litter_value; - gops->read_ptimer = gk20a_read_ptimer; c->twod_class = FERMI_TWOD_A; c->threed_class = VOLTA_A; diff --git a/drivers/gpu/nvgpu/gv11b/mm_gv11b.c b/drivers/gpu/nvgpu/gv11b/mm_gv11b.c index fd77ed10..84a9449a 100644 --- a/drivers/gpu/nvgpu/gv11b/mm_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/mm_gv11b.c @@ -55,7 +55,6 @@ static bool gv11b_mm_mmu_fault_pending(struct gk20a *g) void gv11b_init_mm(struct gpu_ops *gops) { gp10b_init_mm(gops); - gops->mm.bar1_bind = NULL; gops->mm.is_bar1_supported = gv11b_mm_is_bar1_supported; gops->mm.init_inst_block = gv11b_init_inst_block; gops->mm.init_mm_setup_hw = gk20a_init_mm_setup_hw; -- cgit v1.2.2