drm/panel: add support for LG LD070WX3-SL01 panel
[linux-2.6-microblaze.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
27 /*******************************************************************************
28  * PGRAPH engine/subdev functions
29  ******************************************************************************/
30
31 #include "fuc/hubnvd7.fuc.h"
32
33 struct nvc0_graph_ucode
34 nvd7_graph_fecs_ucode = {
35         .code.data = nvd7_grhub_code,
36         .code.size = sizeof(nvd7_grhub_code),
37         .data.data = nvd7_grhub_data,
38         .data.size = sizeof(nvd7_grhub_data),
39 };
40
41 #include "fuc/gpcnvd7.fuc.h"
42
43 struct nvc0_graph_ucode
44 nvd7_graph_gpccs_ucode = {
45         .code.data = nvd7_grgpc_code,
46         .code.size = sizeof(nvd7_grgpc_code),
47         .data.data = nvd7_grgpc_data,
48         .data.size = sizeof(nvd7_grgpc_data),
49 };
50
51 static struct nvc0_graph_init
52 nvd7_graph_init_gpc[] = {
53         { 0x418408,   1, 0x04, 0x00000000 },
54         { 0x4184a0,   1, 0x04, 0x00000000 },
55         { 0x4184a4,   2, 0x04, 0x00000000 },
56         { 0x418604,   1, 0x04, 0x00000000 },
57         { 0x418680,   1, 0x04, 0x00000000 },
58         { 0x418714,   1, 0x04, 0x00000000 },
59         { 0x418384,   1, 0x04, 0x00000000 },
60         { 0x418814,   3, 0x04, 0x00000000 },
61         { 0x418b04,   1, 0x04, 0x00000000 },
62         { 0x4188c8,   2, 0x04, 0x00000000 },
63         { 0x4188d0,   1, 0x04, 0x00010000 },
64         { 0x4188d4,   1, 0x04, 0x00000001 },
65         { 0x418910,   1, 0x04, 0x00010001 },
66         { 0x418914,   1, 0x04, 0x00000301 },
67         { 0x418918,   1, 0x04, 0x00800000 },
68         { 0x418980,   1, 0x04, 0x77777770 },
69         { 0x418984,   3, 0x04, 0x77777777 },
70         { 0x418c04,   1, 0x04, 0x00000000 },
71         { 0x418c64,   1, 0x04, 0x00000000 },
72         { 0x418c68,   1, 0x04, 0x00000000 },
73         { 0x418c88,   1, 0x04, 0x00000000 },
74         { 0x418cb4,   2, 0x04, 0x00000000 },
75         { 0x418d00,   1, 0x04, 0x00000000 },
76         { 0x418d28,   1, 0x04, 0x00000000 },
77         { 0x418f00,   1, 0x04, 0x00000000 },
78         { 0x418f08,   1, 0x04, 0x00000000 },
79         { 0x418f20,   2, 0x04, 0x00000000 },
80         { 0x418e00,   1, 0x04, 0x00000003 },
81         { 0x418e08,   1, 0x04, 0x00000000 },
82         { 0x418e1c,   1, 0x04, 0x00000000 },
83         { 0x418e20,   1, 0x04, 0x00000000 },
84         { 0x41900c,   1, 0x04, 0x00000000 },
85         { 0x419018,   1, 0x04, 0x00000000 },
86         {}
87 };
88
89 static struct nvc0_graph_init
90 nvd7_graph_init_tpc[] = {
91         { 0x419d08,   2, 0x04, 0x00000000 },
92         { 0x419d10,   1, 0x04, 0x00000014 },
93         { 0x419ab0,   1, 0x04, 0x00000000 },
94         { 0x419ac8,   1, 0x04, 0x00000000 },
95         { 0x419ab8,   1, 0x04, 0x000000e7 },
96         { 0x419abc,   2, 0x04, 0x00000000 },
97         { 0x419ab4,   1, 0x04, 0x00000000 },
98         { 0x41980c,   1, 0x04, 0x00000010 },
99         { 0x419844,   1, 0x04, 0x00000000 },
100         { 0x41984c,   1, 0x04, 0x00005bc8 },
101         { 0x419850,   2, 0x04, 0x00000000 },
102         { 0x419c98,   1, 0x04, 0x00000000 },
103         { 0x419ca8,   1, 0x04, 0x80000000 },
104         { 0x419cb4,   1, 0x04, 0x00000000 },
105         { 0x419cb8,   1, 0x04, 0x00008bf4 },
106         { 0x419cbc,   1, 0x04, 0x28137606 },
107         { 0x419cc0,   2, 0x04, 0x00000000 },
108         { 0x419c0c,   1, 0x04, 0x00000000 },
109         { 0x419e00,   1, 0x04, 0x00000000 },
110         { 0x419ea0,   1, 0x04, 0x00000000 },
111         { 0x419ea4,   1, 0x04, 0x00000100 },
112         { 0x419ea8,   1, 0x04, 0x02001100 },
113         { 0x419eac,   1, 0x04, 0x11100702 },
114         { 0x419eb0,   1, 0x04, 0x00000003 },
115         { 0x419eb4,   4, 0x04, 0x00000000 },
116         { 0x419ec8,   1, 0x04, 0x0e063818 },
117         { 0x419ecc,   1, 0x04, 0x0e060e06 },
118         { 0x419ed0,   1, 0x04, 0x00003818 },
119         { 0x419ed4,   1, 0x04, 0x011104f1 },
120         { 0x419edc,   1, 0x04, 0x00000000 },
121         { 0x419f00,   1, 0x04, 0x00000000 },
122         { 0x419f2c,   1, 0x04, 0x00000000 },
123         {}
124 };
125
126 static struct nvc0_graph_init
127 nvd7_graph_init_tpc_0[] = {
128         { 0x40402c,   1, 0x04, 0x00000000 },
129         { 0x4040f0,   1, 0x04, 0x00000000 },
130         { 0x404174,   1, 0x04, 0x00000000 },
131         { 0x503018,   1, 0x04, 0x00000001 },
132         {}
133 };
134
135 static struct nvc0_graph_init *
136 nvd7_graph_init_mmio[] = {
137         nvc0_graph_init_regs,
138         nvc0_graph_init_unk40xx,
139         nvc0_graph_init_unk44xx,
140         nvc0_graph_init_unk78xx,
141         nvc0_graph_init_unk60xx,
142         nvd9_graph_init_unk64xx,
143         nvd9_graph_init_unk58xx,
144         nvc0_graph_init_unk80xx,
145         nvd7_graph_init_gpc,
146         nvd7_graph_init_tpc,
147         nve4_graph_init_unk,
148         nvc0_graph_init_unk88xx,
149         nvd7_graph_init_tpc_0,
150         NULL
151 };
152
153 struct nouveau_oclass *
154 nvd7_graph_oclass = &(struct nvc0_graph_oclass) {
155         .base.handle = NV_ENGINE(GR, 0xd7),
156         .base.ofuncs = &(struct nouveau_ofuncs) {
157                 .ctor = nvc0_graph_ctor,
158                 .dtor = nvc0_graph_dtor,
159                 .init = nvc0_graph_init,
160                 .fini = _nouveau_graph_fini,
161         },
162         .cclass = &nvd7_grctx_oclass,
163         .sclass = nvc8_graph_sclass,
164         .mmio = nvd7_graph_init_mmio,
165         .fecs.ucode = &nvd7_graph_fecs_ucode,
166         .gpccs.ucode = &nvd7_graph_gpccs_ucode,
167 }.base;