From e932982853d779b62bc328eb3e9e506dad590f64 Mon Sep 17 00:00:00 2001 From: Sunny He Date: Wed, 5 Jul 2017 19:05:45 -0700 Subject: gpu: nvgpu: gv11b: Reorg bus HAL init Reorganize HAL initialization to remove inheritance and construct the gpu_ops struct at compile time. This patch only covers the bus sub-module of the gpu_ops struct. Perform HAL function assignments in hal_gxxxx.c through the population of a chip-specific copy of gpu_ops. Jira NVGPU-74 Change-Id: I469113b204cb693a6b1cbf34a9ca53b62e34ec20 Signed-off-by: Sunny He Reviewed-on: https://git-master.nvidia.com/r/1514661 GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: Vijayakumar Subbu --- drivers/gpu/nvgpu/gv11b/bus_gv11b.c | 26 -------------------------- drivers/gpu/nvgpu/gv11b/bus_gv11b.h | 21 --------------------- drivers/gpu/nvgpu/gv11b/hal_gv11b.c | 9 +++++++-- 3 files changed, 7 insertions(+), 49 deletions(-) delete mode 100644 drivers/gpu/nvgpu/gv11b/bus_gv11b.c delete 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 deleted file mode 100644 index 9a70b41c..00000000 --- a/drivers/gpu/nvgpu/gv11b/bus_gv11b.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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 deleted file mode 100644 index fde0b14b..00000000 --- a/drivers/gpu/nvgpu/gv11b/bus_gv11b.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * 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 4f993494..51fe6b0a 100644 --- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c @@ -35,7 +35,6 @@ #include "gp10b/priv_ring_gp10b.h" #include "hal_gv11b.h" -#include "bus_gv11b.h" #include "gr_gv11b.h" #include "mc_gv11b.h" #include "ltc_gv11b.h" @@ -235,6 +234,12 @@ static const struct gpu_ops gv11b_ops = { .perfbuffer_enable = gk20a_perfbuf_enable_locked, .perfbuffer_disable = gk20a_perfbuf_disable_locked, }, + .bus = { + .init_hw = gk20a_bus_init_hw, + .isr = gk20a_bus_isr, + .read_ptimer = gk20a_read_ptimer, + .bar1_bind = NULL, + }, #if defined(CONFIG_GK20A_CYCLE_STATS) .css = { .enable_snapshot = css_hw_enable_snapshot, @@ -262,6 +267,7 @@ int gv11b_init_hal(struct gk20a *g) gops->mc = gv11b_ops.mc; gops->debug = gv11b_ops.debug; gops->dbg_session_ops = gv11b_ops.dbg_session_ops; + gops->bus = gv11b_ops.bus; #if defined(CONFIG_GK20A_CYCLE_STATS) gops->css = gv11b_ops.css; #endif @@ -276,7 +282,6 @@ int gv11b_init_hal(struct gk20a *g) gops->privsecurity = 0; gops->securegpccs = 0; - gv11b_init_bus(gops); gp10b_init_priv_ring(gops); gv11b_init_gr(gops); gv11b_init_fecs_trace_ops(gops); -- cgit v1.2.2