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