summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/sim_gk20a.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/sim_gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/sim_gk20a.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/sim_gk20a.h b/drivers/gpu/nvgpu/gk20a/sim_gk20a.h
new file mode 100644
index 00000000..5fc8006e
--- /dev/null
+++ b/drivers/gpu/nvgpu/gk20a/sim_gk20a.h
@@ -0,0 +1,62 @@
1/*
2 * drivers/video/tegra/host/gk20a/sim_gk20a.h
3 *
4 * GK20A sim support
5 *
6 * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved.
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 along with
18 * this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
20 */
21#ifndef __SIM_GK20A_H__
22#define __SIM_GK20A_H__
23
24
25struct gk20a;
26struct sim_gk20a {
27 struct gk20a *g;
28 struct resource *reg_mem;
29 void __iomem *regs;
30 struct {
31 struct page *page;
32 void *kvaddr;
33 phys_addr_t phys;
34 } send_bfr, recv_bfr, msg_bfr;
35 u32 send_ring_put;
36 u32 recv_ring_get;
37 u32 recv_ring_put;
38 u32 sequence_base;
39 void (*remove_support)(struct sim_gk20a *);
40};
41
42
43int gk20a_sim_esc_read(struct gk20a *g, char *path, u32 index,
44 u32 count, u32 *data);
45
46static inline int gk20a_sim_esc_read_no_sim(struct gk20a *g, char *p,
47 u32 i, u32 c, u32 *d)
48{
49 *d = ~(u32)0;
50 return -1;
51}
52
53static inline int gk20a_sim_esc_readl(struct gk20a *g, char * p, u32 i, u32 *d)
54{
55 if (tegra_cpu_is_asim())
56 return gk20a_sim_esc_read(g, p, i, sizeof(u32), d);
57
58 return gk20a_sim_esc_read_no_sim(g, p, i, sizeof(u32), d);
59}
60
61
62#endif /*__SIM_GK20A_H__*/