]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - drivers/staging/fsl-mc/bus/dprc-cmd.h
Merge branch 'for-4.8/core' of git://git.kernel.dk/linux-block
[karo-tx-linux.git] / drivers / staging / fsl-mc / bus / dprc-cmd.h
1 /* Copyright 2013-2016 Freescale Semiconductor Inc.
2  *
3  * Redistribution and use in source and binary forms, with or without
4  * modification, are permitted provided that the following conditions are met:
5  *     * Redistributions of source code must retain the above copyright
6  *       notice, this list of conditions and the following disclaimer.
7  *     * Redistributions in binary form must reproduce the above copyright
8  *       notice, this list of conditions and the following disclaimer in the
9  *       documentation and/or other materials provided with the distribution.
10  *     * Neither the name of the above-listed copyright holders nor the
11  *       names of any contributors may be used to endorse or promote products
12  *       derived from this software without specific prior written permission.
13  *
14  *
15  * ALTERNATIVELY, this software may be distributed under the terms of the
16  * GNU General Public License ("GPL") as published by the Free Software
17  * Foundation, either version 2 of that License or (at your option) any
18  * later version.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  */
32
33 /*************************************************************************//*
34  dprc-cmd.h
35
36  defines dprc portal commands
37
38  *//**************************************************************************/
39
40 #ifndef _FSL_DPRC_CMD_H
41 #define _FSL_DPRC_CMD_H
42
43 /* Minimal supported DPRC Version */
44 #define DPRC_MIN_VER_MAJOR                      5
45 #define DPRC_MIN_VER_MINOR                      0
46
47 /* Command IDs */
48 #define DPRC_CMDID_CLOSE                        0x800
49 #define DPRC_CMDID_OPEN                         0x805
50 #define DPRC_CMDID_CREATE                       0x905
51
52 #define DPRC_CMDID_GET_ATTR                     0x004
53 #define DPRC_CMDID_RESET_CONT                   0x005
54
55 #define DPRC_CMDID_SET_IRQ                      0x010
56 #define DPRC_CMDID_GET_IRQ                      0x011
57 #define DPRC_CMDID_SET_IRQ_ENABLE               0x012
58 #define DPRC_CMDID_GET_IRQ_ENABLE               0x013
59 #define DPRC_CMDID_SET_IRQ_MASK                 0x014
60 #define DPRC_CMDID_GET_IRQ_MASK                 0x015
61 #define DPRC_CMDID_GET_IRQ_STATUS               0x016
62 #define DPRC_CMDID_CLEAR_IRQ_STATUS             0x017
63
64 #define DPRC_CMDID_CREATE_CONT                  0x151
65 #define DPRC_CMDID_DESTROY_CONT                 0x152
66 #define DPRC_CMDID_SET_RES_QUOTA                0x155
67 #define DPRC_CMDID_GET_RES_QUOTA                0x156
68 #define DPRC_CMDID_ASSIGN                       0x157
69 #define DPRC_CMDID_UNASSIGN                     0x158
70 #define DPRC_CMDID_GET_OBJ_COUNT                0x159
71 #define DPRC_CMDID_GET_OBJ                      0x15A
72 #define DPRC_CMDID_GET_RES_COUNT                0x15B
73 #define DPRC_CMDID_GET_RES_IDS                  0x15C
74 #define DPRC_CMDID_GET_OBJ_REG                  0x15E
75 #define DPRC_CMDID_SET_OBJ_IRQ                  0x15F
76 #define DPRC_CMDID_GET_OBJ_IRQ                  0x160
77 #define DPRC_CMDID_SET_OBJ_LABEL                0x161
78 #define DPRC_CMDID_GET_OBJ_DESC                 0x162
79
80 #define DPRC_CMDID_CONNECT                      0x167
81 #define DPRC_CMDID_DISCONNECT                   0x168
82 #define DPRC_CMDID_GET_POOL                     0x169
83 #define DPRC_CMDID_GET_POOL_COUNT               0x16A
84
85 #define DPRC_CMDID_GET_CONNECTION               0x16C
86
87 struct dprc_cmd_open {
88         __le32 container_id;
89 };
90
91 struct dprc_cmd_create_container {
92         /* cmd word 0 */
93         __le32 options;
94         __le16 icid;
95         __le16 pad0;
96         /* cmd word 1 */
97         __le32 pad1;
98         __le32 portal_id;
99         /* cmd words 2-3 */
100         u8 label[16];
101 };
102
103 struct dprc_rsp_create_container {
104         /* response word 0 */
105         __le64 pad0;
106         /* response word 1 */
107         __le32 child_container_id;
108         __le32 pad1;
109         /* response word 2 */
110         __le64 child_portal_addr;
111 };
112
113 struct dprc_cmd_destroy_container {
114         __le32 child_container_id;
115 };
116
117 struct dprc_cmd_reset_container {
118         __le32 child_container_id;
119 };
120
121 struct dprc_cmd_set_irq {
122         /* cmd word 0 */
123         __le32 irq_val;
124         u8 irq_index;
125         u8 pad[3];
126         /* cmd word 1 */
127         __le64 irq_addr;
128         /* cmd word 2 */
129         __le32 irq_num;
130 };
131
132 struct dprc_cmd_get_irq {
133         __le32 pad;
134         u8 irq_index;
135 };
136
137 struct dprc_rsp_get_irq {
138         /* response word 0 */
139         __le32 irq_val;
140         __le32 pad;
141         /* response word 1 */
142         __le64 irq_addr;
143         /* response word 2 */
144         __le32 irq_num;
145         __le32 type;
146 };
147
148 #define DPRC_ENABLE             0x1
149
150 struct dprc_cmd_set_irq_enable {
151         u8 enable;
152         u8 pad[3];
153         u8 irq_index;
154 };
155
156 struct dprc_cmd_get_irq_enable {
157         __le32 pad;
158         u8 irq_index;
159 };
160
161 struct dprc_rsp_get_irq_enable {
162         u8 enabled;
163 };
164
165 struct dprc_cmd_set_irq_mask {
166         __le32 mask;
167         u8 irq_index;
168 };
169
170 struct dprc_cmd_get_irq_mask {
171         __le32 pad;
172         u8 irq_index;
173 };
174
175 struct dprc_rsp_get_irq_mask {
176         __le32 mask;
177 };
178
179 struct dprc_cmd_get_irq_status {
180         __le32 status;
181         u8 irq_index;
182 };
183
184 struct dprc_rsp_get_irq_status {
185         __le32 status;
186 };
187
188 struct dprc_cmd_clear_irq_status {
189         __le32 status;
190         u8 irq_index;
191 };
192
193 struct dprc_rsp_get_attributes {
194         /* response word 0 */
195         __le32 container_id;
196         __le16 icid;
197         __le16 pad;
198         /* response word 1 */
199         __le32 options;
200         __le32 portal_id;
201         /* response word 2 */
202         __le16 version_major;
203         __le16 version_minor;
204 };
205
206 struct dprc_cmd_set_res_quota {
207         /* cmd word 0 */
208         __le32 child_container_id;
209         __le16 quota;
210         __le16 pad;
211         /* cmd words 1-2 */
212         u8 type[16];
213 };
214
215 struct dprc_cmd_get_res_quota {
216         /* cmd word 0 */
217         __le32 child_container_id;
218         __le32 pad;
219         /* cmd word 1-2 */
220         u8 type[16];
221 };
222
223 struct dprc_rsp_get_res_quota {
224         __le32 pad;
225         __le16 quota;
226 };
227
228 struct dprc_cmd_assign {
229         /* cmd word 0 */
230         __le32 container_id;
231         __le32 options;
232         /* cmd word 1 */
233         __le32 num;
234         __le32 id_base_align;
235         /* cmd word 2-3 */
236         u8 type[16];
237 };
238
239 struct dprc_cmd_unassign {
240         /* cmd word 0 */
241         __le32 child_container_id;
242         __le32 options;
243         /* cmd word 1 */
244         __le32 num;
245         __le32 id_base_align;
246         /* cmd word 2-3 */
247         u8 type[16];
248 };
249
250 struct dprc_rsp_get_pool_count {
251         __le32 pool_count;
252 };
253
254 struct dprc_cmd_get_pool {
255         __le32 pool_index;
256 };
257
258 struct dprc_rsp_get_pool {
259         /* response word 0 */
260         __le64 pad;
261         /* response word 1-2 */
262         u8 type[16];
263 };
264
265 struct dprc_rsp_get_obj_count {
266         __le32 pad;
267         __le32 obj_count;
268 };
269
270 struct dprc_cmd_get_obj {
271         __le32 obj_index;
272 };
273
274 struct dprc_rsp_get_obj {
275         /* response word 0 */
276         __le32 pad0;
277         __le32 id;
278         /* response word 1 */
279         __le16 vendor;
280         u8 irq_count;
281         u8 region_count;
282         __le32 state;
283         /* response word 2 */
284         __le16 version_major;
285         __le16 version_minor;
286         __le16 flags;
287         __le16 pad1;
288         /* response word 3-4 */
289         u8 type[16];
290         /* response word 5-6 */
291         u8 label[16];
292 };
293
294 struct dprc_cmd_get_obj_desc {
295         /* cmd word 0 */
296         __le32 obj_id;
297         __le32 pad;
298         /* cmd word 1-2 */
299         u8 type[16];
300 };
301
302 struct dprc_rsp_get_obj_desc {
303         /* response word 0 */
304         __le32 pad0;
305         __le32 id;
306         /* response word 1 */
307         __le16 vendor;
308         u8 irq_count;
309         u8 region_count;
310         __le32 state;
311         /* response word 2 */
312         __le16 version_major;
313         __le16 version_minor;
314         __le16 flags;
315         __le16 pad1;
316         /* response word 3-4 */
317         u8 type[16];
318         /* response word 5-6 */
319         u8 label[16];
320 };
321
322 struct dprc_cmd_get_res_count {
323         /* cmd word 0 */
324         __le64 pad;
325         /* cmd word 1-2 */
326         u8 type[16];
327 };
328
329 struct dprc_rsp_get_res_count {
330         __le32 res_count;
331 };
332
333 struct dprc_cmd_get_res_ids {
334         /* cmd word 0 */
335         u8 pad0[5];
336         u8 iter_status;
337         __le16 pad1;
338         /* cmd word 1 */
339         __le32 base_id;
340         __le32 last_id;
341         /* cmd word 2-3 */
342         u8 type[16];
343 };
344
345 struct dprc_rsp_get_res_ids {
346         /* response word 0 */
347         u8 pad0[5];
348         u8 iter_status;
349         __le16 pad1;
350         /* response word 1 */
351         __le32 base_id;
352         __le32 last_id;
353 };
354
355 struct dprc_cmd_get_obj_region {
356         /* cmd word 0 */
357         __le32 obj_id;
358         __le16 pad0;
359         u8 region_index;
360         u8 pad1;
361         /* cmd word 1-2 */
362         __le64 pad2[2];
363         /* cmd word 3-4 */
364         u8 obj_type[16];
365 };
366
367 struct dprc_rsp_get_obj_region {
368         /* response word 0 */
369         __le64 pad;
370         /* response word 1 */
371         __le64 base_addr;
372         /* response word 2 */
373         __le32 size;
374 };
375
376 struct dprc_cmd_set_obj_label {
377         /* cmd word 0 */
378         __le32 obj_id;
379         __le32 pad;
380         /* cmd word 1-2 */
381         u8 label[16];
382         /* cmd word 3-4 */
383         u8 obj_type[16];
384 };
385
386 struct dprc_cmd_set_obj_irq {
387         /* cmd word 0 */
388         __le32 irq_val;
389         u8 irq_index;
390         u8 pad[3];
391         /* cmd word 1 */
392         __le64 irq_addr;
393         /* cmd word 2 */
394         __le32 irq_num;
395         __le32 obj_id;
396         /* cmd word 3-4 */
397         u8 obj_type[16];
398 };
399
400 struct dprc_cmd_get_obj_irq {
401         /* cmd word 0 */
402         __le32 obj_id;
403         u8 irq_index;
404         u8 pad[3];
405         /* cmd word 1-2 */
406         u8 obj_type[16];
407 };
408
409 struct dprc_rsp_get_obj_irq {
410         /* response word 0 */
411         __le32 irq_val;
412         __le32 pad;
413         /* response word 1 */
414         __le64 irq_addr;
415         /* response word 2 */
416         __le32 irq_num;
417         __le32 type;
418 };
419
420 struct dprc_cmd_connect {
421         /* cmd word 0 */
422         __le32 ep1_id;
423         __le32 ep1_interface_id;
424         /* cmd word 1 */
425         __le32 ep2_id;
426         __le32 ep2_interface_id;
427         /* cmd word 2-3 */
428         u8 ep1_type[16];
429         /* cmd word 4 */
430         __le32 max_rate;
431         __le32 committed_rate;
432         /* cmd word 5-6 */
433         u8 ep2_type[16];
434 };
435
436 struct dprc_cmd_disconnect {
437         /* cmd word 0 */
438         __le32 id;
439         __le32 interface_id;
440         /* cmd word 1-2 */
441         u8 type[16];
442 };
443
444 struct dprc_cmd_get_connection {
445         /* cmd word 0 */
446         __le32 ep1_id;
447         __le32 ep1_interface_id;
448         /* cmd word 1-2 */
449         u8 ep1_type[16];
450 };
451
452 struct dprc_rsp_get_connection {
453         /* response word 0-2 */
454         __le64 pad[3];
455         /* response word 3 */
456         __le32 ep2_id;
457         __le32 ep2_interface_id;
458         /* response word 4-5 */
459         u8 ep2_type[16];
460         /* response word 6 */
461         __le32 state;
462 };
463
464 #endif /* _FSL_DPRC_CMD_H */