summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/fifo_gm20b.c')
-rw-r--r--drivers/gpu/nvgpu/gm20b/fifo_gm20b.c47
1 files changed, 47 insertions, 0 deletions
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}