summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSunny He <suhe@nvidia.com>2017-07-05 22:05:45 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-07-24 02:35:05 -0400
commite932982853d779b62bc328eb3e9e506dad590f64 (patch)
tree4ce5ea1dbaacdf65a32817c6cc263ed6962ee719 /drivers
parent3b7d50ee12b7ed93f908338dc321bf71023d4b49 (diff)
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 <suhe@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1514661 GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/Makefile1
-rw-r--r--drivers/gpu/nvgpu/gv11b/bus_gv11b.c26
-rw-r--r--drivers/gpu/nvgpu/gv11b/bus_gv11b.h21
-rw-r--r--drivers/gpu/nvgpu/gv11b/hal_gv11b.c9
4 files changed, 7 insertions, 50 deletions
diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile
index 6fdabe62..7e96dcf3 100644
--- a/drivers/gpu/nvgpu/Makefile
+++ b/drivers/gpu/nvgpu/Makefile
@@ -4,7 +4,6 @@ nvgpu-y += \
4 $(nvgpu-t19x)/common/mm/gmmu_t19x.o \ 4 $(nvgpu-t19x)/common/mm/gmmu_t19x.o \
5 $(nvgpu-t19x)/common/linux/ioctl_tsg_t19x.o \ 5 $(nvgpu-t19x)/common/linux/ioctl_tsg_t19x.o \
6 $(nvgpu-t19x)/gv11b/gv11b.o \ 6 $(nvgpu-t19x)/gv11b/gv11b.o \
7 $(nvgpu-t19x)/gv11b/bus_gv11b.o \
8 $(nvgpu-t19x)/gv11b/mc_gv11b.o \ 7 $(nvgpu-t19x)/gv11b/mc_gv11b.o \
9 $(nvgpu-t19x)/gv11b/ltc_gv11b.o \ 8 $(nvgpu-t19x)/gv11b/ltc_gv11b.o \
10 $(nvgpu-t19x)/gv11b/hal_gv11b.o \ 9 $(nvgpu-t19x)/gv11b/hal_gv11b.o \
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 @@
1/*
2 * GV11B BUS
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
16#include "bus_gv11b.h"
17#include "gk20a/gk20a.h"
18#include "gk20a/bus_gk20a.h"
19
20void gv11b_init_bus(struct gpu_ops *gops)
21{
22 gops->bus.init_hw = gk20a_bus_init_hw;
23 gops->bus.isr = gk20a_bus_isr;
24 gops->bus.read_ptimer = gk20a_read_ptimer;
25 gops->bus.bar1_bind = NULL;
26}
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 @@
1/*
2 * GV11B BUS
3 * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 */
14
15#ifndef BUS_GV11B_H
16#define BUS_GV11B_H
17
18struct gpu_ops;
19
20void gv11b_init_bus(struct gpu_ops *gops);
21#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 @@
35#include "gp10b/priv_ring_gp10b.h" 35#include "gp10b/priv_ring_gp10b.h"
36 36
37#include "hal_gv11b.h" 37#include "hal_gv11b.h"
38#include "bus_gv11b.h"
39#include "gr_gv11b.h" 38#include "gr_gv11b.h"
40#include "mc_gv11b.h" 39#include "mc_gv11b.h"
41#include "ltc_gv11b.h" 40#include "ltc_gv11b.h"
@@ -235,6 +234,12 @@ static const struct gpu_ops gv11b_ops = {
235 .perfbuffer_enable = gk20a_perfbuf_enable_locked, 234 .perfbuffer_enable = gk20a_perfbuf_enable_locked,
236 .perfbuffer_disable = gk20a_perfbuf_disable_locked, 235 .perfbuffer_disable = gk20a_perfbuf_disable_locked,
237 }, 236 },
237 .bus = {
238 .init_hw = gk20a_bus_init_hw,
239 .isr = gk20a_bus_isr,
240 .read_ptimer = gk20a_read_ptimer,
241 .bar1_bind = NULL,
242 },
238#if defined(CONFIG_GK20A_CYCLE_STATS) 243#if defined(CONFIG_GK20A_CYCLE_STATS)
239 .css = { 244 .css = {
240 .enable_snapshot = css_hw_enable_snapshot, 245 .enable_snapshot = css_hw_enable_snapshot,
@@ -262,6 +267,7 @@ int gv11b_init_hal(struct gk20a *g)
262 gops->mc = gv11b_ops.mc; 267 gops->mc = gv11b_ops.mc;
263 gops->debug = gv11b_ops.debug; 268 gops->debug = gv11b_ops.debug;
264 gops->dbg_session_ops = gv11b_ops.dbg_session_ops; 269 gops->dbg_session_ops = gv11b_ops.dbg_session_ops;
270 gops->bus = gv11b_ops.bus;
265#if defined(CONFIG_GK20A_CYCLE_STATS) 271#if defined(CONFIG_GK20A_CYCLE_STATS)
266 gops->css = gv11b_ops.css; 272 gops->css = gv11b_ops.css;
267#endif 273#endif
@@ -276,7 +282,6 @@ int gv11b_init_hal(struct gk20a *g)
276 gops->privsecurity = 0; 282 gops->privsecurity = 0;
277 gops->securegpccs = 0; 283 gops->securegpccs = 0;
278 284
279 gv11b_init_bus(gops);
280 gp10b_init_priv_ring(gops); 285 gp10b_init_priv_ring(gops);
281 gv11b_init_gr(gops); 286 gv11b_init_gr(gops);
282 gv11b_init_fecs_trace_ops(gops); 287 gv11b_init_fecs_trace_ops(gops);