1 | /* $NetBSD: nouveau_engine_graph_nvd7.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_nvd7.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 | |
37 | static const struct nvc0_graph_init |
38 | nvd7_graph_init_pe_0[] = { |
39 | { 0x41980c, 1, 0x04, 0x00000010 }, |
40 | { 0x419844, 1, 0x04, 0x00000000 }, |
41 | { 0x41984c, 1, 0x04, 0x00005bc8 }, |
42 | { 0x419850, 3, 0x04, 0x00000000 }, |
43 | {} |
44 | }; |
45 | |
46 | const struct nvc0_graph_init |
47 | nvd7_graph_init_pes_0[] = { |
48 | { 0x41be04, 1, 0x04, 0x00000000 }, |
49 | { 0x41be08, 1, 0x04, 0x00000004 }, |
50 | { 0x41be0c, 1, 0x04, 0x00000000 }, |
51 | { 0x41be10, 1, 0x04, 0x003b8bc7 }, |
52 | { 0x41be14, 2, 0x04, 0x00000000 }, |
53 | {} |
54 | }; |
55 | |
56 | const struct nvc0_graph_init |
57 | nvd7_graph_init_wwdx_0[] = { |
58 | { 0x41bfd4, 1, 0x04, 0x00800000 }, |
59 | { 0x41bfdc, 1, 0x04, 0x00000000 }, |
60 | { 0x41bff8, 2, 0x04, 0x00000000 }, |
61 | {} |
62 | }; |
63 | |
64 | const struct nvc0_graph_init |
65 | nvd7_graph_init_cbm_0[] = { |
66 | { 0x41becc, 1, 0x04, 0x00000000 }, |
67 | { 0x41bee8, 2, 0x04, 0x00000000 }, |
68 | {} |
69 | }; |
70 | |
71 | static const struct nvc0_graph_pack |
72 | nvd7_graph_pack_mmio[] = { |
73 | { nvc0_graph_init_main_0 }, |
74 | { nvc0_graph_init_fe_0 }, |
75 | { nvc0_graph_init_pri_0 }, |
76 | { nvc0_graph_init_rstr2d_0 }, |
77 | { nvd9_graph_init_pd_0 }, |
78 | { nvd9_graph_init_ds_0 }, |
79 | { nvc0_graph_init_scc_0 }, |
80 | { nvd9_graph_init_prop_0 }, |
81 | { nvc1_graph_init_gpc_unk_0 }, |
82 | { nvc0_graph_init_setup_0 }, |
83 | { nvc0_graph_init_crstr_0 }, |
84 | { nvc1_graph_init_setup_1 }, |
85 | { nvc0_graph_init_zcull_0 }, |
86 | { nvd9_graph_init_gpm_0 }, |
87 | { nvd9_graph_init_gpc_unk_1 }, |
88 | { nvc0_graph_init_gcc_0 }, |
89 | { nvc0_graph_init_tpccs_0 }, |
90 | { nvd9_graph_init_tex_0 }, |
91 | { nvd7_graph_init_pe_0 }, |
92 | { nvc0_graph_init_l1c_0 }, |
93 | { nvc0_graph_init_mpc_0 }, |
94 | { nvd9_graph_init_sm_0 }, |
95 | { nvd7_graph_init_pes_0 }, |
96 | { nvd7_graph_init_wwdx_0 }, |
97 | { nvd7_graph_init_cbm_0 }, |
98 | { nvc0_graph_init_be_0 }, |
99 | { nvd9_graph_init_fe_1 }, |
100 | {} |
101 | }; |
102 | |
103 | /******************************************************************************* |
104 | * PGRAPH engine/subdev functions |
105 | ******************************************************************************/ |
106 | |
107 | #include "fuc/hubnvd7.fuc.h" |
108 | |
109 | struct nvc0_graph_ucode |
110 | nvd7_graph_fecs_ucode = { |
111 | .code.data = nvd7_grhub_code, |
112 | .code.size = sizeof(nvd7_grhub_code), |
113 | .data.data = nvd7_grhub_data, |
114 | .data.size = sizeof(nvd7_grhub_data), |
115 | }; |
116 | |
117 | #include "fuc/gpcnvd7.fuc.h" |
118 | |
119 | struct nvc0_graph_ucode |
120 | nvd7_graph_gpccs_ucode = { |
121 | .code.data = nvd7_grgpc_code, |
122 | .code.size = sizeof(nvd7_grgpc_code), |
123 | .data.data = nvd7_grgpc_data, |
124 | .data.size = sizeof(nvd7_grgpc_data), |
125 | }; |
126 | |
127 | struct nouveau_oclass * |
128 | nvd7_graph_oclass = &(struct nvc0_graph_oclass) { |
129 | .base.handle = NV_ENGINE(GR, 0xd7), |
130 | .base.ofuncs = &(struct nouveau_ofuncs) { |
131 | .ctor = nvc0_graph_ctor, |
132 | .dtor = nvc0_graph_dtor, |
133 | .init = nvc0_graph_init, |
134 | .fini = _nouveau_graph_fini, |
135 | }, |
136 | .cclass = &nvd7_grctx_oclass, |
137 | .sclass = nvc8_graph_sclass, |
138 | .mmio = nvd7_graph_pack_mmio, |
139 | .fecs.ucode = &nvd7_graph_fecs_ucode, |
140 | .gpccs.ucode = &nvd7_graph_gpccs_ucode, |
141 | }.base; |
142 | |