2 * Copyright 2013-2016 Freescale Semiconductor Inc.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 * * Redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer.
8 * * Redistributions in binary form must reproduce the above copyright
9 * notice, this list of conditions and the following disclaimer in the
10 * documentation and/or other materials provided with the distribution.
11 * * Neither the name of the above-listed copyright holders nor the
12 * names of any contributors may be used to endorse or promote products
13 * derived from this software without specific prior written permission.
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
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.
36 * defines dprc portal commands
40 #ifndef _FSL_DPRC_CMD_H
41 #define _FSL_DPRC_CMD_H
43 /* Minimal supported DPRC Version */
44 #define DPRC_MIN_VER_MAJOR 6
45 #define DPRC_MIN_VER_MINOR 0
47 /* Command versioning */
48 #define DPRC_CMD_BASE_VERSION 1
49 #define DPRC_CMD_ID_OFFSET 4
51 #define DPRC_CMD(id) (((id) << DPRC_CMD_ID_OFFSET) | DPRC_CMD_BASE_VERSION)
54 #define DPRC_CMDID_CLOSE DPRC_CMD(0x800)
55 #define DPRC_CMDID_OPEN DPRC_CMD(0x805)
56 #define DPRC_CMDID_GET_API_VERSION DPRC_CMD(0xa05)
58 #define DPRC_CMDID_GET_ATTR DPRC_CMD(0x004)
60 #define DPRC_CMDID_SET_IRQ DPRC_CMD(0x010)
61 #define DPRC_CMDID_GET_IRQ DPRC_CMD(0x011)
62 #define DPRC_CMDID_SET_IRQ_ENABLE DPRC_CMD(0x012)
63 #define DPRC_CMDID_GET_IRQ_ENABLE DPRC_CMD(0x013)
64 #define DPRC_CMDID_SET_IRQ_MASK DPRC_CMD(0x014)
65 #define DPRC_CMDID_GET_IRQ_MASK DPRC_CMD(0x015)
66 #define DPRC_CMDID_GET_IRQ_STATUS DPRC_CMD(0x016)
67 #define DPRC_CMDID_CLEAR_IRQ_STATUS DPRC_CMD(0x017)
69 #define DPRC_CMDID_GET_CONT_ID DPRC_CMD(0x830)
70 #define DPRC_CMDID_GET_OBJ_COUNT DPRC_CMD(0x159)
71 #define DPRC_CMDID_GET_OBJ DPRC_CMD(0x15A)
72 #define DPRC_CMDID_GET_RES_COUNT DPRC_CMD(0x15B)
73 #define DPRC_CMDID_GET_OBJ_REG DPRC_CMD(0x15E)
74 #define DPRC_CMDID_SET_OBJ_IRQ DPRC_CMD(0x15F)
75 #define DPRC_CMDID_GET_OBJ_IRQ DPRC_CMD(0x160)
77 struct dprc_cmd_open {
81 struct dprc_cmd_create_container {
93 struct dprc_rsp_create_container {
97 __le32 child_container_id;
100 __le64 child_portal_addr;
103 struct dprc_cmd_destroy_container {
104 __le32 child_container_id;
107 struct dprc_cmd_reset_container {
108 __le32 child_container_id;
111 struct dprc_cmd_set_irq {
122 struct dprc_cmd_get_irq {
127 struct dprc_rsp_get_irq {
128 /* response word 0 */
131 /* response word 1 */
133 /* response word 2 */
138 #define DPRC_ENABLE 0x1
140 struct dprc_cmd_set_irq_enable {
146 struct dprc_cmd_get_irq_enable {
151 struct dprc_rsp_get_irq_enable {
155 struct dprc_cmd_set_irq_mask {
160 struct dprc_cmd_get_irq_mask {
165 struct dprc_rsp_get_irq_mask {
169 struct dprc_cmd_get_irq_status {
174 struct dprc_rsp_get_irq_status {
178 struct dprc_cmd_clear_irq_status {
183 struct dprc_rsp_get_attributes {
184 /* response word 0 */
188 /* response word 1 */
193 struct dprc_cmd_set_res_quota {
195 __le32 child_container_id;
202 struct dprc_cmd_get_res_quota {
204 __le32 child_container_id;
210 struct dprc_rsp_get_res_quota {
215 struct dprc_cmd_assign {
221 __le32 id_base_align;
226 struct dprc_cmd_unassign {
228 __le32 child_container_id;
232 __le32 id_base_align;
237 struct dprc_rsp_get_pool_count {
241 struct dprc_cmd_get_pool {
245 struct dprc_rsp_get_pool {
246 /* response word 0 */
248 /* response word 1-2 */
252 struct dprc_rsp_get_obj_count {
257 struct dprc_cmd_get_obj {
261 struct dprc_rsp_get_obj {
262 /* response word 0 */
265 /* response word 1 */
270 /* response word 2 */
271 __le16 version_major;
272 __le16 version_minor;
275 /* response word 3-4 */
277 /* response word 5-6 */
281 struct dprc_cmd_get_obj_desc {
289 struct dprc_rsp_get_obj_desc {
290 /* response word 0 */
293 /* response word 1 */
298 /* response word 2 */
299 __le16 version_major;
300 __le16 version_minor;
303 /* response word 3-4 */
305 /* response word 5-6 */
309 struct dprc_cmd_get_res_count {
316 struct dprc_rsp_get_res_count {
320 struct dprc_cmd_get_res_ids {
332 struct dprc_rsp_get_res_ids {
333 /* response word 0 */
337 /* response word 1 */
342 struct dprc_cmd_get_obj_region {
354 struct dprc_rsp_get_obj_region {
355 /* response word 0 */
357 /* response word 1 */
359 /* response word 2 */
363 struct dprc_cmd_set_obj_label {
373 struct dprc_cmd_set_obj_irq {
387 struct dprc_cmd_get_obj_irq {
396 struct dprc_rsp_get_obj_irq {
397 /* response word 0 */
400 /* response word 1 */
402 /* response word 2 */
407 struct dprc_cmd_connect {
410 __le32 ep1_interface_id;
413 __le32 ep2_interface_id;
418 __le32 committed_rate;
423 struct dprc_cmd_disconnect {
431 struct dprc_cmd_get_connection {
434 __le32 ep1_interface_id;
439 struct dprc_rsp_get_connection {
440 /* response word 0-2 */
442 /* response word 3 */
444 __le32 ep2_interface_id;
445 /* response word 4-5 */
447 /* response word 6 */
451 #endif /* _FSL_DPRC_CMD_H */