]> git.karo-electronics.de Git - karo-tx-linux.git/blob - drivers/gpu/drm/nouveau/core/engine/graph/nvd7.c
b2a66eb90418bdfcfa23331a843cfe37dbd80e34
[karo-tx-linux.git] / drivers / gpu / drm / nouveau / core / engine / graph / nvd7.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 static const struct nvc0_graph_init
33 nvd7_graph_init_tpc_0[] = {
34         { 0x419d08,   2, 0x04, 0x00000000 },
35         { 0x419d10,   1, 0x04, 0x00000014 },
36         { 0x419ab0,   1, 0x04, 0x00000000 },
37         { 0x419ac8,   1, 0x04, 0x00000000 },
38         { 0x419ab8,   1, 0x04, 0x000000e7 },
39         { 0x419abc,   2, 0x04, 0x00000000 },
40         { 0x419ab4,   1, 0x04, 0x00000000 },
41         { 0x41980c,   1, 0x04, 0x00000010 },
42         { 0x419844,   1, 0x04, 0x00000000 },
43         { 0x41984c,   1, 0x04, 0x00005bc8 },
44         { 0x419850,   3, 0x04, 0x00000000 },
45         { 0x419c98,   1, 0x04, 0x00000000 },
46         { 0x419ca8,   1, 0x04, 0x80000000 },
47         { 0x419cb4,   1, 0x04, 0x00000000 },
48         { 0x419cb8,   1, 0x04, 0x00008bf4 },
49         { 0x419cbc,   1, 0x04, 0x28137606 },
50         { 0x419cc0,   2, 0x04, 0x00000000 },
51         { 0x419c0c,   1, 0x04, 0x00000000 },
52         { 0x419e00,   1, 0x04, 0x00000000 },
53         { 0x419ea0,   1, 0x04, 0x00000000 },
54         { 0x419ea4,   1, 0x04, 0x00000100 },
55         { 0x419ea8,   1, 0x04, 0x02001100 },
56         { 0x419eac,   1, 0x04, 0x11100702 },
57         { 0x419eb0,   1, 0x04, 0x00000003 },
58         { 0x419eb4,   4, 0x04, 0x00000000 },
59         { 0x419ec8,   1, 0x04, 0x0e063818 },
60         { 0x419ecc,   1, 0x04, 0x0e060e06 },
61         { 0x419ed0,   1, 0x04, 0x00003818 },
62         { 0x419ed4,   1, 0x04, 0x011104f1 },
63         { 0x419edc,   1, 0x04, 0x00000000 },
64         { 0x419f00,   1, 0x04, 0x00000000 },
65         { 0x419f2c,   1, 0x04, 0x00000000 },
66         {}
67 };
68
69 const struct nvc0_graph_init
70 nvd7_graph_init_ppc_0[] = {
71         { 0x41be04,   1, 0x04, 0x00000000 },
72         { 0x41be08,   1, 0x04, 0x00000004 },
73         { 0x41be0c,   1, 0x04, 0x00000000 },
74         { 0x41be10,   1, 0x04, 0x003b8bc7 },
75         { 0x41be14,   2, 0x04, 0x00000000 },
76         { 0x41bfd4,   1, 0x04, 0x00800000 },
77         { 0x41bfdc,   1, 0x04, 0x00000000 },
78         { 0x41bff8,   2, 0x04, 0x00000000 },
79         { 0x41becc,   1, 0x04, 0x00000000 },
80         { 0x41bee8,   2, 0x04, 0x00000000 },
81         {}
82 };
83
84 static const struct nvc0_graph_pack
85 nvd7_graph_pack_mmio[] = {
86         { nvc0_graph_init_main_0 },
87         { nvc0_graph_init_fe_0 },
88         { nvc0_graph_init_pri_0 },
89         { nvc0_graph_init_rstr2d_0 },
90         { nvd9_graph_init_pd_0 },
91         { nvd9_graph_init_ds_0 },
92         { nvc0_graph_init_scc_0 },
93         { nvd9_graph_init_gpc_0 },
94         { nvd7_graph_init_tpc_0 },
95         { nvd7_graph_init_ppc_0 },
96         { nvc0_graph_init_be_0 },
97         { nvd9_graph_init_fe_1 },
98         {}
99 };
100
101 /*******************************************************************************
102  * PGRAPH engine/subdev functions
103  ******************************************************************************/
104
105 #include "fuc/hubnvd7.fuc.h"
106
107 struct nvc0_graph_ucode
108 nvd7_graph_fecs_ucode = {
109         .code.data = nvd7_grhub_code,
110         .code.size = sizeof(nvd7_grhub_code),
111         .data.data = nvd7_grhub_data,
112         .data.size = sizeof(nvd7_grhub_data),
113 };
114
115 #include "fuc/gpcnvd7.fuc.h"
116
117 struct nvc0_graph_ucode
118 nvd7_graph_gpccs_ucode = {
119         .code.data = nvd7_grgpc_code,
120         .code.size = sizeof(nvd7_grgpc_code),
121         .data.data = nvd7_grgpc_data,
122         .data.size = sizeof(nvd7_grgpc_data),
123 };
124
125 struct nouveau_oclass *
126 nvd7_graph_oclass = &(struct nvc0_graph_oclass) {
127         .base.handle = NV_ENGINE(GR, 0xd7),
128         .base.ofuncs = &(struct nouveau_ofuncs) {
129                 .ctor = nvc0_graph_ctor,
130                 .dtor = nvc0_graph_dtor,
131                 .init = nvc0_graph_init,
132                 .fini = _nouveau_graph_fini,
133         },
134         .cclass = &nvd7_grctx_oclass,
135         .sclass = nvc8_graph_sclass,
136         .mmio = nvd7_graph_pack_mmio,
137         .fecs.ucode = &nvd7_graph_fecs_ucode,
138         .gpccs.ucode = &nvd7_graph_gpccs_ucode,
139 }.base;