Merge tag 'drm/panel/for-3.15-rc1' of git://anongit.freedesktop.org/tegra/linux into...
[linux-2.6-microblaze.git] / drivers / gpu / drm / nouveau / core / engine / graph / nvd9.c
1 /*
2  * Copyright 2013 Red Hat Inc.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  * and/or sell copies of the Software, and to permit persons to whom the
9  * Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20  * OTHER DEALINGS IN THE SOFTWARE.
21  *
22  * Authors: Ben Skeggs <bskeggs@redhat.com>
23  */
24
25 #include "nvc0.h"
26 #include "ctxnvc0.h"
27
28 /*******************************************************************************
29  * PGRAPH register lists
30  ******************************************************************************/
31
32 const struct nvc0_graph_init
33 nvd9_graph_init_pd_0[] = {
34         { 0x406024,   1, 0x04, 0x00000000 },
35         { 0x4064f0,   3, 0x04, 0x00000000 },
36         {}
37 };
38
39 const struct nvc0_graph_init
40 nvd9_graph_init_ds_0[] = {
41         { 0x405844,   1, 0x04, 0x00ffffff },
42         { 0x405850,   1, 0x04, 0x00000000 },
43         { 0x405900,   1, 0x04, 0x00002834 },
44         { 0x405908,   1, 0x04, 0x00000000 },
45         { 0x405928,   2, 0x04, 0x00000000 },
46         {}
47 };
48
49 const struct nvc0_graph_init
50 nvd9_graph_init_prop_0[] = {
51         { 0x418408,   1, 0x04, 0x00000000 },
52         { 0x4184a0,   3, 0x04, 0x00000000 },
53         {}
54 };
55
56 const struct nvc0_graph_init
57 nvd9_graph_init_gpm_0[] = {
58         { 0x418c04,   1, 0x04, 0x00000000 },
59         { 0x418c64,   2, 0x04, 0x00000000 },
60         { 0x418c88,   1, 0x04, 0x00000000 },
61         { 0x418cb4,   2, 0x04, 0x00000000 },
62         {}
63 };
64
65 const struct nvc0_graph_init
66 nvd9_graph_init_gpc_unk_1[] = {
67         { 0x418d00,   1, 0x04, 0x00000000 },
68         { 0x418d28,   2, 0x04, 0x00000000 },
69         { 0x418f00,   1, 0x04, 0x00000000 },
70         { 0x418f08,   1, 0x04, 0x00000000 },
71         { 0x418f20,   2, 0x04, 0x00000000 },
72         { 0x418e00,   1, 0x04, 0x00000003 },
73         { 0x418e08,   1, 0x04, 0x00000000 },
74         { 0x418e1c,   2, 0x04, 0x00000000 },
75         {}
76 };
77
78 const struct nvc0_graph_init
79 nvd9_graph_init_tex_0[] = {
80         { 0x419ab0,   1, 0x04, 0x00000000 },
81         { 0x419ac8,   1, 0x04, 0x00000000 },
82         { 0x419ab8,   1, 0x04, 0x000000e7 },
83         { 0x419abc,   2, 0x04, 0x00000000 },
84         { 0x419ab4,   1, 0x04, 0x00000000 },
85         {}
86 };
87
88 static const struct nvc0_graph_init
89 nvd9_graph_init_pe_0[] = {
90         { 0x41980c,   1, 0x04, 0x00000010 },
91         { 0x419810,   1, 0x04, 0x00000000 },
92         { 0x419814,   1, 0x04, 0x00000004 },
93         { 0x419844,   1, 0x04, 0x00000000 },
94         { 0x41984c,   1, 0x04, 0x0000a918 },
95         { 0x419850,   4, 0x04, 0x00000000 },
96         { 0x419880,   1, 0x04, 0x00000002 },
97         {}
98 };
99
100 static const struct nvc0_graph_init
101 nvd9_graph_init_wwdx_0[] = {
102         { 0x419bd4,   1, 0x04, 0x00800000 },
103         { 0x419bdc,   1, 0x04, 0x00000000 },
104         { 0x419bf8,   2, 0x04, 0x00000000 },
105         {}
106 };
107
108 static const struct nvc0_graph_init
109 nvd9_graph_init_tpccs_1[] = {
110         { 0x419d2c,   1, 0x04, 0x00000000 },
111         { 0x419d48,   2, 0x04, 0x00000000 },
112         {}
113 };
114
115 const struct nvc0_graph_init
116 nvd9_graph_init_sm_0[] = {
117         { 0x419e00,   1, 0x04, 0x00000000 },
118         { 0x419ea0,   1, 0x04, 0x00000000 },
119         { 0x419ea4,   1, 0x04, 0x00000100 },
120         { 0x419ea8,   1, 0x04, 0x02001100 },
121         { 0x419eac,   1, 0x04, 0x11100702 },
122         { 0x419eb0,   1, 0x04, 0x00000003 },
123         { 0x419eb4,   4, 0x04, 0x00000000 },
124         { 0x419ec8,   1, 0x04, 0x0e063818 },
125         { 0x419ecc,   1, 0x04, 0x0e060e06 },
126         { 0x419ed0,   1, 0x04, 0x00003818 },
127         { 0x419ed4,   1, 0x04, 0x011104f1 },
128         { 0x419edc,   1, 0x04, 0x00000000 },
129         { 0x419f00,   1, 0x04, 0x00000000 },
130         { 0x419f2c,   1, 0x04, 0x00000000 },
131         {}
132 };
133
134 const struct nvc0_graph_init
135 nvd9_graph_init_fe_1[] = {
136         { 0x40402c,   1, 0x04, 0x00000000 },
137         { 0x4040f0,   1, 0x04, 0x00000000 },
138         { 0x404174,   1, 0x04, 0x00000000 },
139         {}
140 };
141
142 static const struct nvc0_graph_pack
143 nvd9_graph_pack_mmio[] = {
144         { nvc0_graph_init_main_0 },
145         { nvc0_graph_init_fe_0 },
146         { nvc0_graph_init_pri_0 },
147         { nvc0_graph_init_rstr2d_0 },
148         { nvd9_graph_init_pd_0 },
149         { nvd9_graph_init_ds_0 },
150         { nvc0_graph_init_scc_0 },
151         { nvd9_graph_init_prop_0 },
152         { nvc1_graph_init_gpc_unk_0 },
153         { nvc0_graph_init_setup_0 },
154         { nvc0_graph_init_crstr_0 },
155         { nvc1_graph_init_setup_1 },
156         { nvc0_graph_init_zcull_0 },
157         { nvd9_graph_init_gpm_0 },
158         { nvd9_graph_init_gpc_unk_1 },
159         { nvc0_graph_init_gcc_0 },
160         { nvc0_graph_init_tpccs_0 },
161         { nvd9_graph_init_tex_0 },
162         { nvd9_graph_init_pe_0 },
163         { nvc0_graph_init_l1c_0 },
164         { nvd9_graph_init_wwdx_0 },
165         { nvd9_graph_init_tpccs_1 },
166         { nvc0_graph_init_mpc_0 },
167         { nvd9_graph_init_sm_0 },
168         { nvc0_graph_init_be_0 },
169         { nvd9_graph_init_fe_1 },
170         {}
171 };
172
173 /*******************************************************************************
174  * PGRAPH engine/subdev functions
175  ******************************************************************************/
176
177 struct nouveau_oclass *
178 nvd9_graph_oclass = &(struct nvc0_graph_oclass) {
179         .base.handle = NV_ENGINE(GR, 0xd9),
180         .base.ofuncs = &(struct nouveau_ofuncs) {
181                 .ctor = nvc0_graph_ctor,
182                 .dtor = nvc0_graph_dtor,
183                 .init = nvc0_graph_init,
184                 .fini = _nouveau_graph_fini,
185         },
186         .cclass = &nvd9_grctx_oclass,
187         .sclass = nvc8_graph_sclass,
188         .mmio = nvd9_graph_pack_mmio,
189         .fecs.ucode = &nvc0_graph_fecs_ucode,
190         .gpccs.ucode = &nvc0_graph_gpccs_ucode,
191 }.base;