summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c
diff options
context:
space:
mode:
authorKevin Huang <kevinh@nvidia.com>2014-03-12 19:35:47 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:09:39 -0400
commitea3d83d98b509b03bbd7df3553719dbb3e3b8748 (patch)
tree0c5a16a8286a03f4bd083c13d68c8affae3483d4 /drivers/gpu/nvgpu/gm20b/fifo_gm20b.c
parent9eb1f57ba2b7072c6c53ca9dc59b10a87d88db23 (diff)
video: tegra: host: add gm20b channel op
Bug 1450792 Change-Id: I09f7c727a773178613fe555eb025ac324da0008e Signed-off-by: Kevin Huang <kevinh@nvidia.com> Reviewed-on: http://git-master/r/381128 Reviewed-on: http://git-master/r/396373 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Arto Merilainen <amerilainen@nvidia.com> Reviewed-by: Bo Yan <byan@nvidia.com>
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}