summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b')
-rw-r--r--drivers/gpu/nvgpu/gm20b/Makefile1
-rw-r--r--drivers/gpu/nvgpu/gm20b/fifo_gm20b.c47
-rw-r--r--drivers/gpu/nvgpu/gm20b/fifo_gm20b.h21
-rw-r--r--drivers/gpu/nvgpu/gm20b/hal_gm20b.c2
4 files changed, 71 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/Makefile b/drivers/gpu/nvgpu/gm20b/Makefile
index 42c3cec0..b779373d 100644
--- a/drivers/gpu/nvgpu/gm20b/Makefile
+++ b/drivers/gpu/nvgpu/gm20b/Makefile
@@ -8,4 +8,5 @@ obj-$(CONFIG_GK20A) = \
8 gr_gm20b.o \ 8 gr_gm20b.o \
9 gr_gm20b.o \ 9 gr_gm20b.o \
10 fb_gm20b.o \ 10 fb_gm20b.o \
11 fifo_gm20b.o \
11 gm20b_gating_reglist.o 12 gm20b_gating_reglist.o
diff --git a/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c b/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c
new file mode 100644
index 00000000..83dc0f79
--- /dev/null
+++ b/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c
@@ -0,0 +1,47 @@
1/*
2 * GM20B Fifo
3 *
4 * Copyright (c) 2014, 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 "gk20a/gk20a.h"
17#include "fifo_gm20b.h"
18#include "hw_ccsr_gm20b.h"
19#include "hw_ram_gm20b.h"
20
21static void channel_gm20b_bind(struct channel_gk20a *ch_gk20a)
22{
23 struct gk20a *g = ch_gk20a->g;
24
25 u32 inst_ptr = ch_gk20a->inst_block.cpu_pa
26 >> ram_in_base_shift_v();
27
28 gk20a_dbg_info("bind channel %d inst ptr 0x%08x",
29 ch_gk20a->hw_chid, inst_ptr);
30
31 ch_gk20a->bound = true;
32
33 gk20a_writel(g, ccsr_channel_inst_r(ch_gk20a->hw_chid),
34 ccsr_channel_inst_ptr_f(inst_ptr) |
35 ccsr_channel_inst_target_vid_mem_f() |
36 ccsr_channel_inst_bind_true_f());
37
38 gk20a_writel(g, ccsr_channel_r(ch_gk20a->hw_chid),
39 (gk20a_readl(g, ccsr_channel_r(ch_gk20a->hw_chid)) &
40 ~ccsr_channel_enable_set_f(~0)) |
41 ccsr_channel_enable_set_true_f());
42}
43
44void gm20b_init_fifo(struct gpu_ops *gops)
45{
46 gops->fifo.bind_channel = channel_gm20b_bind;
47}
diff --git a/drivers/gpu/nvgpu/gm20b/fifo_gm20b.h b/drivers/gpu/nvgpu/gm20b/fifo_gm20b.h
new file mode 100644
index 00000000..ca452d21
--- /dev/null
+++ b/drivers/gpu/nvgpu/gm20b/fifo_gm20b.h
@@ -0,0 +1,21 @@
1/*
2 * GM20B Fifo
3 *
4 * Copyright (c) 2014, 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#ifndef _NVHOST_GM20B_FIFO
17#define _NVHOST_GM20B_FIFO
18struct gk20a;
19
20void gm20b_init_fifo(struct gpu_ops *gops);
21#endif
diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
index 286e5fa5..da633b9f 100644
--- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
@@ -22,6 +22,7 @@
22#include "ltc_gm20b.h" 22#include "ltc_gm20b.h"
23#include "fb_gm20b.h" 23#include "fb_gm20b.h"
24#include "gm20b_gating_reglist.h" 24#include "gm20b_gating_reglist.h"
25#include "fifo_gm20b.h"
25 26
26struct gpu_ops gm20b_ops = { 27struct gpu_ops gm20b_ops = {
27 .clock_gating = { 28 .clock_gating = {
@@ -45,6 +46,7 @@ int gm20b_init_hal(struct gpu_ops *gops)
45 gm20b_init_gr(gops); 46 gm20b_init_gr(gops);
46 gm20b_init_ltc(gops); 47 gm20b_init_ltc(gops);
47 gm20b_init_fb(gops); 48 gm20b_init_fb(gops);
49 gm20b_init_fifo(gops);
48 gops->name = "gm20b"; 50 gops->name = "gm20b";
49 51
50 return 0; 52 return 0;