aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/tegra/host/chip_support.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/tegra/host/chip_support.h')
-rw-r--r--drivers/video/tegra/host/chip_support.h141
1 files changed, 141 insertions, 0 deletions
diff --git a/drivers/video/tegra/host/chip_support.h b/drivers/video/tegra/host/chip_support.h
new file mode 100644
index 00000000000..6727e7a69fb
--- /dev/null
+++ b/drivers/video/tegra/host/chip_support.h
@@ -0,0 +1,141 @@
1/*
2 * drivers/video/tegra/host/chip_support.h
3 *
4 * Tegra Graphics Host Chip Support
5 *
6 * Copyright (c) 2011-2012, NVIDIA Corporation.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms and conditions of the GNU General Public License,
10 * version 2, as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20#ifndef _NVHOST_CHIP_SUPPORT_H_
21#define _NVHOST_CHIP_SUPPORT_H_
22
23#include <linux/types.h>
24struct output;
25struct nvhost_waitchk;
26struct nvhost_userctx_timeout;
27struct nvhost_master;
28struct nvhost_channel;
29struct nvmap_handle;
30struct nvmap_client;
31struct nvhost_hwctx;
32struct nvhost_cdma;
33struct nvhost_intr;
34struct push_buffer;
35struct nvhost_syncpt;
36struct nvhost_master;
37struct dentry;
38struct nvhost_job;
39
40struct nvhost_chip_support {
41 struct {
42 int (*init)(struct nvhost_channel *,
43 struct nvhost_master *,
44 int chid);
45 int (*submit)(struct nvhost_job *job);
46 int (*read3dreg)(struct nvhost_channel *channel,
47 struct nvhost_hwctx *hwctx,
48 u32 offset,
49 u32 *value);
50 } channel;
51
52 struct {
53 void (*start)(struct nvhost_cdma *);
54 void (*stop)(struct nvhost_cdma *);
55 void (*kick)(struct nvhost_cdma *);
56 int (*timeout_init)(struct nvhost_cdma *,
57 u32 syncpt_id);
58 void (*timeout_destroy)(struct nvhost_cdma *);
59 void (*timeout_teardown_begin)(struct nvhost_cdma *);
60 void (*timeout_teardown_end)(struct nvhost_cdma *,
61 u32 getptr);
62 void (*timeout_cpu_incr)(struct nvhost_cdma *,
63 u32 getptr,
64 u32 syncpt_incrs,
65 u32 syncval,
66 u32 nr_slots);
67 void (*timeout_pb_incr)(struct nvhost_cdma *,
68 u32 getptr,
69 u32 syncpt_incrs,
70 u32 nr_slots,
71 bool exec_ctxsave);
72 } cdma;
73
74 struct {
75 void (*reset)(struct push_buffer *);
76 int (*init)(struct push_buffer *);
77 void (*destroy)(struct push_buffer *);
78 void (*push_to)(struct push_buffer *,
79 struct nvmap_client *,
80 struct nvmap_handle *,
81 u32 op1, u32 op2);
82 void (*pop_from)(struct push_buffer *,
83 unsigned int slots);
84 u32 (*space)(struct push_buffer *);
85 u32 (*putptr)(struct push_buffer *);
86 } push_buffer;
87
88 struct {
89 void (*debug_init)(struct dentry *de);
90 void (*show_channel_cdma)(struct nvhost_master *,
91 struct nvhost_channel *,
92 struct output *,
93 int chid);
94 void (*show_channel_fifo)(struct nvhost_master *,
95 struct nvhost_channel *,
96 struct output *,
97 int chid);
98 void (*show_mlocks)(struct nvhost_master *m,
99 struct output *o);
100
101 } debug;
102
103 struct {
104 void (*reset)(struct nvhost_syncpt *, u32 id);
105 void (*reset_wait_base)(struct nvhost_syncpt *, u32 id);
106 void (*read_wait_base)(struct nvhost_syncpt *, u32 id);
107 u32 (*update_min)(struct nvhost_syncpt *, u32 id);
108 void (*cpu_incr)(struct nvhost_syncpt *, u32 id);
109 int (*wait_check)(struct nvhost_syncpt *sp,
110 struct nvmap_client *nvmap,
111 u32 waitchk_mask,
112 struct nvhost_waitchk *wait,
113 int num_waitchk);
114 void (*debug)(struct nvhost_syncpt *);
115 const char * (*name)(struct nvhost_syncpt *, u32 id);
116 int (*mutex_try_lock)(struct nvhost_syncpt *,
117 unsigned int idx);
118 void (*mutex_unlock)(struct nvhost_syncpt *,
119 unsigned int idx);
120 } syncpt;
121
122 struct {
123 void (*init_host_sync)(struct nvhost_intr *);
124 void (*set_host_clocks_per_usec)(
125 struct nvhost_intr *, u32 clocks);
126 void (*set_syncpt_threshold)(
127 struct nvhost_intr *, u32 id, u32 thresh);
128 void (*enable_syncpt_intr)(struct nvhost_intr *, u32 id);
129 void (*disable_all_syncpt_intrs)(struct nvhost_intr *);
130 int (*request_host_general_irq)(struct nvhost_intr *);
131 void (*free_host_general_irq)(struct nvhost_intr *);
132 int (*request_syncpt_irq)(struct nvhost_intr_syncpt *syncpt);
133 } intr;
134
135 struct {
136 struct nvhost_device *(*get_nvhost_device)(struct nvhost_master *host,
137 char *name);
138 } nvhost_dev;
139};
140
141#endif /* _NVHOST_CHIP_SUPPORT_H_ */