1
2
3
4
5
6
7
8
9#ifndef _FSL_DPRC_H
10#define _FSL_DPRC_H
11
12
13#define DPRC_VER_MAJOR 6
14#define DPRC_VER_MINOR 1
15
16
17#define DPRC_CMDID_CLOSE 0x8001
18#define DPRC_CMDID_OPEN 0x8051
19#define DPRC_CMDID_CREATE 0x9051
20
21#define DPRC_CMDID_GET_ATTR 0x0041
22#define DPRC_CMDID_RESET_CONT 0x0051
23#define DPRC_CMDID_GET_API_VERSION 0xa051
24
25#define DPRC_CMDID_CREATE_CONT 0x1511
26#define DPRC_CMDID_DESTROY_CONT 0x1521
27#define DPRC_CMDID_GET_CONT_ID 0x8301
28#define DPRC_CMDID_GET_OBJ_COUNT 0x1591
29#define DPRC_CMDID_GET_OBJ 0x15A1
30#define DPRC_CMDID_GET_RES_COUNT 0x15B1
31#define DPRC_CMDID_GET_RES_IDS 0x15C1
32#define DPRC_CMDID_GET_OBJ_REG 0x15E1
33
34#define DPRC_CMDID_CONNECT 0x1671
35#define DPRC_CMDID_DISCONNECT 0x1681
36#define DPRC_CMDID_GET_CONNECTION 0x16C1
37
38
39#define DPRC_RSP_GET_CONTAINER_ID(cmd, container_id) \
40 MC_RSP_OP(cmd, 0, 0, 32, int, container_id)
41
42
43#define DPRC_CMD_OPEN(cmd, container_id) \
44 MC_CMD_OP(cmd, 0, 0, 32, int, container_id)
45
46
47#define DPRC_CMD_CREATE_CONTAINER(cmd, cfg) \
48do { \
49 MC_CMD_OP(cmd, 0, 32, 16, uint16_t, cfg->icid); \
50 MC_CMD_OP(cmd, 0, 0, 32, uint32_t, cfg->options); \
51 MC_CMD_OP(cmd, 1, 32, 32, int, cfg->portal_id); \
52 MC_CMD_OP(cmd, 2, 0, 8, char, cfg->label[0]);\
53 MC_CMD_OP(cmd, 2, 8, 8, char, cfg->label[1]);\
54 MC_CMD_OP(cmd, 2, 16, 8, char, cfg->label[2]);\
55 MC_CMD_OP(cmd, 2, 24, 8, char, cfg->label[3]);\
56 MC_CMD_OP(cmd, 2, 32, 8, char, cfg->label[4]);\
57 MC_CMD_OP(cmd, 2, 40, 8, char, cfg->label[5]);\
58 MC_CMD_OP(cmd, 2, 48, 8, char, cfg->label[6]);\
59 MC_CMD_OP(cmd, 2, 56, 8, char, cfg->label[7]);\
60 MC_CMD_OP(cmd, 3, 0, 8, char, cfg->label[8]);\
61 MC_CMD_OP(cmd, 3, 8, 8, char, cfg->label[9]);\
62 MC_CMD_OP(cmd, 3, 16, 8, char, cfg->label[10]);\
63 MC_CMD_OP(cmd, 3, 24, 8, char, cfg->label[11]);\
64 MC_CMD_OP(cmd, 3, 32, 8, char, cfg->label[12]);\
65 MC_CMD_OP(cmd, 3, 40, 8, char, cfg->label[13]);\
66 MC_CMD_OP(cmd, 3, 48, 8, char, cfg->label[14]);\
67 MC_CMD_OP(cmd, 3, 56, 8, char, cfg->label[15]);\
68} while (0)
69
70
71#define DPRC_RSP_CREATE_CONTAINER(cmd, child_container_id, child_portal_offset)\
72do { \
73 MC_RSP_OP(cmd, 1, 0, 32, int, child_container_id); \
74 MC_RSP_OP(cmd, 2, 0, 64, uint64_t, child_portal_offset);\
75} while (0)
76
77
78#define DPRC_CMD_DESTROY_CONTAINER(cmd, child_container_id) \
79 MC_CMD_OP(cmd, 0, 0, 32, int, child_container_id)
80
81
82#define DPRC_CMD_RESET_CONTAINER(cmd, child_container_id) \
83 MC_CMD_OP(cmd, 0, 0, 32, int, child_container_id)
84
85
86#define DPRC_RSP_GET_ATTRIBUTES(cmd, attr) \
87do { \
88 MC_RSP_OP(cmd, 0, 0, 32, int, attr->container_id); \
89 MC_RSP_OP(cmd, 0, 32, 16, uint16_t, attr->icid); \
90 MC_RSP_OP(cmd, 1, 0, 32, uint32_t, attr->options);\
91 MC_RSP_OP(cmd, 1, 32, 32, int, attr->portal_id); \
92} while (0)
93
94
95#define DPRC_RSP_GET_OBJ_COUNT(cmd, obj_count) \
96 MC_RSP_OP(cmd, 0, 32, 32, int, obj_count)
97
98
99#define DPRC_CMD_GET_OBJ(cmd, obj_index) \
100 MC_CMD_OP(cmd, 0, 0, 32, int, obj_index)
101
102
103#define DPRC_RSP_GET_OBJ(cmd, obj_desc) \
104do { \
105 MC_RSP_OP(cmd, 0, 32, 32, int, obj_desc->id); \
106 MC_RSP_OP(cmd, 1, 0, 16, uint16_t, obj_desc->vendor); \
107 MC_RSP_OP(cmd, 1, 16, 8, uint8_t, obj_desc->irq_count); \
108 MC_RSP_OP(cmd, 1, 24, 8, uint8_t, obj_desc->region_count); \
109 MC_RSP_OP(cmd, 1, 32, 32, uint32_t, obj_desc->state);\
110 MC_RSP_OP(cmd, 2, 0, 16, uint16_t, obj_desc->ver_major);\
111 MC_RSP_OP(cmd, 2, 16, 16, uint16_t, obj_desc->ver_minor);\
112 MC_RSP_OP(cmd, 2, 32, 16, uint16_t, obj_desc->flags); \
113 MC_RSP_OP(cmd, 3, 0, 8, char, obj_desc->type[0]);\
114 MC_RSP_OP(cmd, 3, 8, 8, char, obj_desc->type[1]);\
115 MC_RSP_OP(cmd, 3, 16, 8, char, obj_desc->type[2]);\
116 MC_RSP_OP(cmd, 3, 24, 8, char, obj_desc->type[3]);\
117 MC_RSP_OP(cmd, 3, 32, 8, char, obj_desc->type[4]);\
118 MC_RSP_OP(cmd, 3, 40, 8, char, obj_desc->type[5]);\
119 MC_RSP_OP(cmd, 3, 48, 8, char, obj_desc->type[6]);\
120 MC_RSP_OP(cmd, 3, 56, 8, char, obj_desc->type[7]);\
121 MC_RSP_OP(cmd, 4, 0, 8, char, obj_desc->type[8]);\
122 MC_RSP_OP(cmd, 4, 8, 8, char, obj_desc->type[9]);\
123 MC_RSP_OP(cmd, 4, 16, 8, char, obj_desc->type[10]);\
124 MC_RSP_OP(cmd, 4, 24, 8, char, obj_desc->type[11]);\
125 MC_RSP_OP(cmd, 4, 32, 8, char, obj_desc->type[12]);\
126 MC_RSP_OP(cmd, 4, 40, 8, char, obj_desc->type[13]);\
127 MC_RSP_OP(cmd, 4, 48, 8, char, obj_desc->type[14]);\
128 MC_RSP_OP(cmd, 4, 56, 8, char, obj_desc->type[15]);\
129 MC_RSP_OP(cmd, 5, 0, 8, char, obj_desc->label[0]);\
130 MC_RSP_OP(cmd, 5, 8, 8, char, obj_desc->label[1]);\
131 MC_RSP_OP(cmd, 5, 16, 8, char, obj_desc->label[2]);\
132 MC_RSP_OP(cmd, 5, 24, 8, char, obj_desc->label[3]);\
133 MC_RSP_OP(cmd, 5, 32, 8, char, obj_desc->label[4]);\
134 MC_RSP_OP(cmd, 5, 40, 8, char, obj_desc->label[5]);\
135 MC_RSP_OP(cmd, 5, 48, 8, char, obj_desc->label[6]);\
136 MC_RSP_OP(cmd, 5, 56, 8, char, obj_desc->label[7]);\
137 MC_RSP_OP(cmd, 6, 0, 8, char, obj_desc->label[8]);\
138 MC_RSP_OP(cmd, 6, 8, 8, char, obj_desc->label[9]);\
139 MC_RSP_OP(cmd, 6, 16, 8, char, obj_desc->label[10]);\
140 MC_RSP_OP(cmd, 6, 24, 8, char, obj_desc->label[11]);\
141 MC_RSP_OP(cmd, 6, 32, 8, char, obj_desc->label[12]);\
142 MC_RSP_OP(cmd, 6, 40, 8, char, obj_desc->label[13]);\
143 MC_RSP_OP(cmd, 6, 48, 8, char, obj_desc->label[14]);\
144 MC_RSP_OP(cmd, 6, 56, 8, char, obj_desc->label[15]);\
145} while (0)
146
147
148#define DPRC_CMD_GET_OBJ_DESC(cmd, obj_type, obj_id) \
149do { \
150 MC_CMD_OP(cmd, 0, 0, 32, int, obj_id);\
151 MC_CMD_OP(cmd, 1, 0, 8, char, obj_type[0]);\
152 MC_CMD_OP(cmd, 1, 8, 8, char, obj_type[1]);\
153 MC_CMD_OP(cmd, 1, 16, 8, char, obj_type[2]);\
154 MC_CMD_OP(cmd, 1, 24, 8, char, obj_type[3]);\
155 MC_CMD_OP(cmd, 1, 32, 8, char, obj_type[4]);\
156 MC_CMD_OP(cmd, 1, 40, 8, char, obj_type[5]);\
157 MC_CMD_OP(cmd, 1, 48, 8, char, obj_type[6]);\
158 MC_CMD_OP(cmd, 1, 56, 8, char, obj_type[7]);\
159 MC_CMD_OP(cmd, 2, 0, 8, char, obj_type[8]);\
160 MC_CMD_OP(cmd, 2, 8, 8, char, obj_type[9]);\
161 MC_CMD_OP(cmd, 2, 16, 8, char, obj_type[10]);\
162 MC_CMD_OP(cmd, 2, 24, 8, char, obj_type[11]);\
163 MC_CMD_OP(cmd, 2, 32, 8, char, obj_type[12]);\
164 MC_CMD_OP(cmd, 2, 40, 8, char, obj_type[13]);\
165 MC_CMD_OP(cmd, 2, 48, 8, char, obj_type[14]);\
166 MC_CMD_OP(cmd, 2, 56, 8, char, obj_type[15]);\
167} while (0)
168
169
170#define DPRC_RSP_GET_OBJ_DESC(cmd, obj_desc) \
171do { \
172 MC_RSP_OP(cmd, 0, 32, 32, int, obj_desc->id); \
173 MC_RSP_OP(cmd, 1, 0, 16, uint16_t, obj_desc->vendor); \
174 MC_RSP_OP(cmd, 1, 16, 8, uint8_t, obj_desc->irq_count); \
175 MC_RSP_OP(cmd, 1, 24, 8, uint8_t, obj_desc->region_count); \
176 MC_RSP_OP(cmd, 1, 32, 32, uint32_t, obj_desc->state);\
177 MC_RSP_OP(cmd, 2, 0, 16, uint16_t, obj_desc->ver_major);\
178 MC_RSP_OP(cmd, 2, 16, 16, uint16_t, obj_desc->ver_minor);\
179 MC_RSP_OP(cmd, 2, 32, 16, uint16_t, obj_desc->flags); \
180 MC_RSP_OP(cmd, 3, 0, 8, char, obj_desc->type[0]);\
181 MC_RSP_OP(cmd, 3, 8, 8, char, obj_desc->type[1]);\
182 MC_RSP_OP(cmd, 3, 16, 8, char, obj_desc->type[2]);\
183 MC_RSP_OP(cmd, 3, 24, 8, char, obj_desc->type[3]);\
184 MC_RSP_OP(cmd, 3, 32, 8, char, obj_desc->type[4]);\
185 MC_RSP_OP(cmd, 3, 40, 8, char, obj_desc->type[5]);\
186 MC_RSP_OP(cmd, 3, 48, 8, char, obj_desc->type[6]);\
187 MC_RSP_OP(cmd, 3, 56, 8, char, obj_desc->type[7]);\
188 MC_RSP_OP(cmd, 4, 0, 8, char, obj_desc->type[8]);\
189 MC_RSP_OP(cmd, 4, 8, 8, char, obj_desc->type[9]);\
190 MC_RSP_OP(cmd, 4, 16, 8, char, obj_desc->type[10]);\
191 MC_RSP_OP(cmd, 4, 24, 8, char, obj_desc->type[11]);\
192 MC_RSP_OP(cmd, 4, 32, 8, char, obj_desc->type[12]);\
193 MC_RSP_OP(cmd, 4, 40, 8, char, obj_desc->type[13]);\
194 MC_RSP_OP(cmd, 4, 48, 8, char, obj_desc->type[14]);\
195 MC_RSP_OP(cmd, 4, 56, 8, char, obj_desc->type[15]);\
196 MC_RSP_OP(cmd, 5, 0, 8, char, obj_desc->label[0]);\
197 MC_RSP_OP(cmd, 5, 8, 8, char, obj_desc->label[1]);\
198 MC_RSP_OP(cmd, 5, 16, 8, char, obj_desc->label[2]);\
199 MC_RSP_OP(cmd, 5, 24, 8, char, obj_desc->label[3]);\
200 MC_RSP_OP(cmd, 5, 32, 8, char, obj_desc->label[4]);\
201 MC_RSP_OP(cmd, 5, 40, 8, char, obj_desc->label[5]);\
202 MC_RSP_OP(cmd, 5, 48, 8, char, obj_desc->label[6]);\
203 MC_RSP_OP(cmd, 5, 56, 8, char, obj_desc->label[7]);\
204 MC_RSP_OP(cmd, 6, 0, 8, char, obj_desc->label[8]);\
205 MC_RSP_OP(cmd, 6, 8, 8, char, obj_desc->label[9]);\
206 MC_RSP_OP(cmd, 6, 16, 8, char, obj_desc->label[10]);\
207 MC_RSP_OP(cmd, 6, 24, 8, char, obj_desc->label[11]);\
208 MC_RSP_OP(cmd, 6, 32, 8, char, obj_desc->label[12]);\
209 MC_RSP_OP(cmd, 6, 40, 8, char, obj_desc->label[13]);\
210 MC_RSP_OP(cmd, 6, 48, 8, char, obj_desc->label[14]);\
211 MC_RSP_OP(cmd, 6, 56, 8, char, obj_desc->label[15]);\
212} while (0)
213
214
215#define DPRC_CMD_GET_RES_COUNT(cmd, type) \
216do { \
217 MC_CMD_OP(cmd, 1, 0, 8, char, type[0]);\
218 MC_CMD_OP(cmd, 1, 8, 8, char, type[1]);\
219 MC_CMD_OP(cmd, 1, 16, 8, char, type[2]);\
220 MC_CMD_OP(cmd, 1, 24, 8, char, type[3]);\
221 MC_CMD_OP(cmd, 1, 32, 8, char, type[4]);\
222 MC_CMD_OP(cmd, 1, 40, 8, char, type[5]);\
223 MC_CMD_OP(cmd, 1, 48, 8, char, type[6]);\
224 MC_CMD_OP(cmd, 1, 56, 8, char, type[7]);\
225 MC_CMD_OP(cmd, 2, 0, 8, char, type[8]);\
226 MC_CMD_OP(cmd, 2, 8, 8, char, type[9]);\
227 MC_CMD_OP(cmd, 2, 16, 8, char, type[10]);\
228 MC_CMD_OP(cmd, 2, 24, 8, char, type[11]);\
229 MC_CMD_OP(cmd, 2, 32, 8, char, type[12]);\
230 MC_CMD_OP(cmd, 2, 40, 8, char, type[13]);\
231 MC_CMD_OP(cmd, 2, 48, 8, char, type[14]);\
232 MC_CMD_OP(cmd, 2, 56, 8, char, type[15]);\
233} while (0)
234
235
236#define DPRC_RSP_GET_RES_COUNT(cmd, res_count) \
237 MC_RSP_OP(cmd, 0, 0, 32, int, res_count)
238
239
240#define DPRC_CMD_GET_RES_IDS(cmd, range_desc, type) \
241do { \
242 MC_CMD_OP(cmd, 0, 42, 7, enum dprc_iter_status, \
243 range_desc->iter_status); \
244 MC_CMD_OP(cmd, 1, 0, 32, int, range_desc->base_id); \
245 MC_CMD_OP(cmd, 1, 32, 32, int, range_desc->last_id);\
246 MC_CMD_OP(cmd, 2, 0, 8, char, type[0]);\
247 MC_CMD_OP(cmd, 2, 8, 8, char, type[1]);\
248 MC_CMD_OP(cmd, 2, 16, 8, char, type[2]);\
249 MC_CMD_OP(cmd, 2, 24, 8, char, type[3]);\
250 MC_CMD_OP(cmd, 2, 32, 8, char, type[4]);\
251 MC_CMD_OP(cmd, 2, 40, 8, char, type[5]);\
252 MC_CMD_OP(cmd, 2, 48, 8, char, type[6]);\
253 MC_CMD_OP(cmd, 2, 56, 8, char, type[7]);\
254 MC_CMD_OP(cmd, 3, 0, 8, char, type[8]);\
255 MC_CMD_OP(cmd, 3, 8, 8, char, type[9]);\
256 MC_CMD_OP(cmd, 3, 16, 8, char, type[10]);\
257 MC_CMD_OP(cmd, 3, 24, 8, char, type[11]);\
258 MC_CMD_OP(cmd, 3, 32, 8, char, type[12]);\
259 MC_CMD_OP(cmd, 3, 40, 8, char, type[13]);\
260 MC_CMD_OP(cmd, 3, 48, 8, char, type[14]);\
261 MC_CMD_OP(cmd, 3, 56, 8, char, type[15]);\
262} while (0)
263
264
265#define DPRC_RSP_GET_RES_IDS(cmd, range_desc) \
266do { \
267 MC_RSP_OP(cmd, 0, 42, 7, enum dprc_iter_status, \
268 range_desc->iter_status);\
269 MC_RSP_OP(cmd, 1, 0, 32, int, range_desc->base_id); \
270 MC_RSP_OP(cmd, 1, 32, 32, int, range_desc->last_id);\
271} while (0)
272
273
274#define DPRC_CMD_GET_OBJ_REGION(cmd, obj_type, obj_id, region_index) \
275do { \
276 MC_CMD_OP(cmd, 0, 0, 32, int, obj_id); \
277 MC_CMD_OP(cmd, 0, 48, 8, uint8_t, region_index);\
278 MC_CMD_OP(cmd, 3, 0, 8, char, obj_type[0]);\
279 MC_CMD_OP(cmd, 3, 8, 8, char, obj_type[1]);\
280 MC_CMD_OP(cmd, 3, 16, 8, char, obj_type[2]);\
281 MC_CMD_OP(cmd, 3, 24, 8, char, obj_type[3]);\
282 MC_CMD_OP(cmd, 3, 32, 8, char, obj_type[4]);\
283 MC_CMD_OP(cmd, 3, 40, 8, char, obj_type[5]);\
284 MC_CMD_OP(cmd, 3, 48, 8, char, obj_type[6]);\
285 MC_CMD_OP(cmd, 3, 56, 8, char, obj_type[7]);\
286 MC_CMD_OP(cmd, 4, 0, 8, char, obj_type[8]);\
287 MC_CMD_OP(cmd, 4, 8, 8, char, obj_type[9]);\
288 MC_CMD_OP(cmd, 4, 16, 8, char, obj_type[10]);\
289 MC_CMD_OP(cmd, 4, 24, 8, char, obj_type[11]);\
290 MC_CMD_OP(cmd, 4, 32, 8, char, obj_type[12]);\
291 MC_CMD_OP(cmd, 4, 40, 8, char, obj_type[13]);\
292 MC_CMD_OP(cmd, 4, 48, 8, char, obj_type[14]);\
293 MC_CMD_OP(cmd, 4, 56, 8, char, obj_type[15]);\
294} while (0)
295
296
297#define DPRC_RSP_GET_OBJ_REGION(cmd, region_desc) \
298do { \
299 MC_RSP_OP(cmd, 1, 0, 32, uint32_t, region_desc->base_offset);\
300 MC_RSP_OP(cmd, 2, 0, 32, uint32_t, region_desc->size); \
301 MC_RSP_OP(cmd, 2, 32, 4, enum dprc_region_type, region_desc->type);\
302 MC_RSP_OP(cmd, 3, 0, 32, uint32_t, region_desc->flags);\
303} while (0)
304
305
306#define DPRC_CMD_SET_OBJ_LABEL(cmd, obj_type, obj_id, label) \
307do { \
308 MC_CMD_OP(cmd, 0, 0, 32, int, obj_id); \
309 MC_CMD_OP(cmd, 1, 0, 8, char, label[0]);\
310 MC_CMD_OP(cmd, 1, 8, 8, char, label[1]);\
311 MC_CMD_OP(cmd, 1, 16, 8, char, label[2]);\
312 MC_CMD_OP(cmd, 1, 24, 8, char, label[3]);\
313 MC_CMD_OP(cmd, 1, 32, 8, char, label[4]);\
314 MC_CMD_OP(cmd, 1, 40, 8, char, label[5]);\
315 MC_CMD_OP(cmd, 1, 48, 8, char, label[6]);\
316 MC_CMD_OP(cmd, 1, 56, 8, char, label[7]);\
317 MC_CMD_OP(cmd, 2, 0, 8, char, label[8]);\
318 MC_CMD_OP(cmd, 2, 8, 8, char, label[9]);\
319 MC_CMD_OP(cmd, 2, 16, 8, char, label[10]);\
320 MC_CMD_OP(cmd, 2, 24, 8, char, label[11]);\
321 MC_CMD_OP(cmd, 2, 32, 8, char, label[12]);\
322 MC_CMD_OP(cmd, 2, 40, 8, char, label[13]);\
323 MC_CMD_OP(cmd, 2, 48, 8, char, label[14]);\
324 MC_CMD_OP(cmd, 2, 56, 8, char, label[15]);\
325 MC_CMD_OP(cmd, 3, 0, 8, char, obj_type[0]);\
326 MC_CMD_OP(cmd, 3, 8, 8, char, obj_type[1]);\
327 MC_CMD_OP(cmd, 3, 16, 8, char, obj_type[2]);\
328 MC_CMD_OP(cmd, 3, 24, 8, char, obj_type[3]);\
329 MC_CMD_OP(cmd, 3, 32, 8, char, obj_type[4]);\
330 MC_CMD_OP(cmd, 3, 40, 8, char, obj_type[5]);\
331 MC_CMD_OP(cmd, 3, 48, 8, char, obj_type[6]);\
332 MC_CMD_OP(cmd, 3, 56, 8, char, obj_type[7]);\
333 MC_CMD_OP(cmd, 4, 0, 8, char, obj_type[8]);\
334 MC_CMD_OP(cmd, 4, 8, 8, char, obj_type[9]);\
335 MC_CMD_OP(cmd, 4, 16, 8, char, obj_type[10]);\
336 MC_CMD_OP(cmd, 4, 24, 8, char, obj_type[11]);\
337 MC_CMD_OP(cmd, 4, 32, 8, char, obj_type[12]);\
338 MC_CMD_OP(cmd, 4, 40, 8, char, obj_type[13]);\
339 MC_CMD_OP(cmd, 4, 48, 8, char, obj_type[14]);\
340 MC_CMD_OP(cmd, 4, 56, 8, char, obj_type[15]);\
341} while (0)
342
343
344#define DPRC_CMD_CONNECT(cmd, endpoint1, endpoint2, cfg) \
345do { \
346 MC_CMD_OP(cmd, 0, 0, 32, int, endpoint1->id); \
347 MC_CMD_OP(cmd, 0, 32, 32, int, endpoint1->if_id); \
348 MC_CMD_OP(cmd, 1, 0, 32, int, endpoint2->id); \
349 MC_CMD_OP(cmd, 1, 32, 32, int, endpoint2->if_id); \
350 MC_CMD_OP(cmd, 2, 0, 8, char, endpoint1->type[0]); \
351 MC_CMD_OP(cmd, 2, 8, 8, char, endpoint1->type[1]); \
352 MC_CMD_OP(cmd, 2, 16, 8, char, endpoint1->type[2]); \
353 MC_CMD_OP(cmd, 2, 24, 8, char, endpoint1->type[3]); \
354 MC_CMD_OP(cmd, 2, 32, 8, char, endpoint1->type[4]); \
355 MC_CMD_OP(cmd, 2, 40, 8, char, endpoint1->type[5]); \
356 MC_CMD_OP(cmd, 2, 48, 8, char, endpoint1->type[6]); \
357 MC_CMD_OP(cmd, 2, 56, 8, char, endpoint1->type[7]); \
358 MC_CMD_OP(cmd, 3, 0, 8, char, endpoint1->type[8]); \
359 MC_CMD_OP(cmd, 3, 8, 8, char, endpoint1->type[9]); \
360 MC_CMD_OP(cmd, 3, 16, 8, char, endpoint1->type[10]); \
361 MC_CMD_OP(cmd, 3, 24, 8, char, endpoint1->type[11]); \
362 MC_CMD_OP(cmd, 3, 32, 8, char, endpoint1->type[12]); \
363 MC_CMD_OP(cmd, 3, 40, 8, char, endpoint1->type[13]); \
364 MC_CMD_OP(cmd, 3, 48, 8, char, endpoint1->type[14]); \
365 MC_CMD_OP(cmd, 3, 56, 8, char, endpoint1->type[15]); \
366 MC_CMD_OP(cmd, 4, 0, 32, uint32_t, cfg->max_rate); \
367 MC_CMD_OP(cmd, 4, 32, 32, uint32_t, cfg->committed_rate); \
368 MC_CMD_OP(cmd, 5, 0, 8, char, endpoint2->type[0]); \
369 MC_CMD_OP(cmd, 5, 8, 8, char, endpoint2->type[1]); \
370 MC_CMD_OP(cmd, 5, 16, 8, char, endpoint2->type[2]); \
371 MC_CMD_OP(cmd, 5, 24, 8, char, endpoint2->type[3]); \
372 MC_CMD_OP(cmd, 5, 32, 8, char, endpoint2->type[4]); \
373 MC_CMD_OP(cmd, 5, 40, 8, char, endpoint2->type[5]); \
374 MC_CMD_OP(cmd, 5, 48, 8, char, endpoint2->type[6]); \
375 MC_CMD_OP(cmd, 5, 56, 8, char, endpoint2->type[7]); \
376 MC_CMD_OP(cmd, 6, 0, 8, char, endpoint2->type[8]); \
377 MC_CMD_OP(cmd, 6, 8, 8, char, endpoint2->type[9]); \
378 MC_CMD_OP(cmd, 6, 16, 8, char, endpoint2->type[10]); \
379 MC_CMD_OP(cmd, 6, 24, 8, char, endpoint2->type[11]); \
380 MC_CMD_OP(cmd, 6, 32, 8, char, endpoint2->type[12]); \
381 MC_CMD_OP(cmd, 6, 40, 8, char, endpoint2->type[13]); \
382 MC_CMD_OP(cmd, 6, 48, 8, char, endpoint2->type[14]); \
383 MC_CMD_OP(cmd, 6, 56, 8, char, endpoint2->type[15]); \
384} while (0)
385
386
387#define DPRC_CMD_DISCONNECT(cmd, endpoint) \
388do { \
389 MC_CMD_OP(cmd, 0, 0, 32, int, endpoint->id); \
390 MC_CMD_OP(cmd, 0, 32, 16, uint16_t, endpoint->if_id); \
391 MC_CMD_OP(cmd, 1, 0, 8, char, endpoint->type[0]); \
392 MC_CMD_OP(cmd, 1, 8, 8, char, endpoint->type[1]); \
393 MC_CMD_OP(cmd, 1, 16, 8, char, endpoint->type[2]); \
394 MC_CMD_OP(cmd, 1, 24, 8, char, endpoint->type[3]); \
395 MC_CMD_OP(cmd, 1, 32, 8, char, endpoint->type[4]); \
396 MC_CMD_OP(cmd, 1, 40, 8, char, endpoint->type[5]); \
397 MC_CMD_OP(cmd, 1, 48, 8, char, endpoint->type[6]); \
398 MC_CMD_OP(cmd, 1, 56, 8, char, endpoint->type[7]); \
399 MC_CMD_OP(cmd, 2, 0, 8, char, endpoint->type[8]); \
400 MC_CMD_OP(cmd, 2, 8, 8, char, endpoint->type[9]); \
401 MC_CMD_OP(cmd, 2, 16, 8, char, endpoint->type[10]); \
402 MC_CMD_OP(cmd, 2, 24, 8, char, endpoint->type[11]); \
403 MC_CMD_OP(cmd, 2, 32, 8, char, endpoint->type[12]); \
404 MC_CMD_OP(cmd, 2, 40, 8, char, endpoint->type[13]); \
405 MC_CMD_OP(cmd, 2, 48, 8, char, endpoint->type[14]); \
406 MC_CMD_OP(cmd, 2, 56, 8, char, endpoint->type[15]); \
407} while (0)
408
409
410#define DPRC_CMD_GET_CONNECTION(cmd, endpoint1) \
411do { \
412 MC_CMD_OP(cmd, 0, 0, 32, int, endpoint1->id); \
413 MC_CMD_OP(cmd, 0, 32, 32, int, endpoint1->if_id); \
414 MC_CMD_OP(cmd, 1, 0, 8, char, endpoint1->type[0]); \
415 MC_CMD_OP(cmd, 1, 8, 8, char, endpoint1->type[1]); \
416 MC_CMD_OP(cmd, 1, 16, 8, char, endpoint1->type[2]); \
417 MC_CMD_OP(cmd, 1, 24, 8, char, endpoint1->type[3]); \
418 MC_CMD_OP(cmd, 1, 32, 8, char, endpoint1->type[4]); \
419 MC_CMD_OP(cmd, 1, 40, 8, char, endpoint1->type[5]); \
420 MC_CMD_OP(cmd, 1, 48, 8, char, endpoint1->type[6]); \
421 MC_CMD_OP(cmd, 1, 56, 8, char, endpoint1->type[7]); \
422 MC_CMD_OP(cmd, 2, 0, 8, char, endpoint1->type[8]); \
423 MC_CMD_OP(cmd, 2, 8, 8, char, endpoint1->type[9]); \
424 MC_CMD_OP(cmd, 2, 16, 8, char, endpoint1->type[10]); \
425 MC_CMD_OP(cmd, 2, 24, 8, char, endpoint1->type[11]); \
426 MC_CMD_OP(cmd, 2, 32, 8, char, endpoint1->type[12]); \
427 MC_CMD_OP(cmd, 2, 40, 8, char, endpoint1->type[13]); \
428 MC_CMD_OP(cmd, 2, 48, 8, char, endpoint1->type[14]); \
429 MC_CMD_OP(cmd, 2, 56, 8, char, endpoint1->type[15]); \
430} while (0)
431
432
433#define DPRC_RSP_GET_CONNECTION(cmd, endpoint2, state) \
434do { \
435 MC_RSP_OP(cmd, 3, 0, 32, int, endpoint2->id); \
436 MC_RSP_OP(cmd, 3, 32, 16, uint16_t, endpoint2->if_id); \
437 MC_RSP_OP(cmd, 4, 0, 8, char, endpoint2->type[0]); \
438 MC_RSP_OP(cmd, 4, 8, 8, char, endpoint2->type[1]); \
439 MC_RSP_OP(cmd, 4, 16, 8, char, endpoint2->type[2]); \
440 MC_RSP_OP(cmd, 4, 24, 8, char, endpoint2->type[3]); \
441 MC_RSP_OP(cmd, 4, 32, 8, char, endpoint2->type[4]); \
442 MC_RSP_OP(cmd, 4, 40, 8, char, endpoint2->type[5]); \
443 MC_RSP_OP(cmd, 4, 48, 8, char, endpoint2->type[6]); \
444 MC_RSP_OP(cmd, 4, 56, 8, char, endpoint2->type[7]); \
445 MC_RSP_OP(cmd, 5, 0, 8, char, endpoint2->type[8]); \
446 MC_RSP_OP(cmd, 5, 8, 8, char, endpoint2->type[9]); \
447 MC_RSP_OP(cmd, 5, 16, 8, char, endpoint2->type[10]); \
448 MC_RSP_OP(cmd, 5, 24, 8, char, endpoint2->type[11]); \
449 MC_RSP_OP(cmd, 5, 32, 8, char, endpoint2->type[12]); \
450 MC_RSP_OP(cmd, 5, 40, 8, char, endpoint2->type[13]); \
451 MC_RSP_OP(cmd, 5, 48, 8, char, endpoint2->type[14]); \
452 MC_RSP_OP(cmd, 5, 56, 8, char, endpoint2->type[15]); \
453 MC_RSP_OP(cmd, 6, 0, 32, int, state); \
454} while (0)
455
456
457
458
459
460struct fsl_mc_io;
461
462
463
464
465
466
467#define DPRC_GET_ICID_FROM_POOL (uint16_t)(~(0))
468
469
470
471
472
473
474#define DPRC_GET_PORTAL_ID_FROM_POOL (int)(~(0))
475
476
477
478
479
480
481
482
483
484int dprc_get_container_id(struct fsl_mc_io *mc_io,
485 uint32_t cmd_flags,
486 int *container_id);
487
488
489
490
491
492
493
494
495
496
497
498
499int dprc_open(struct fsl_mc_io *mc_io,
500 uint32_t cmd_flags,
501 int container_id,
502 uint16_t *token);
503
504
505
506
507
508
509
510
511
512
513
514
515int dprc_close(struct fsl_mc_io *mc_io,
516 uint32_t cmd_flags,
517 uint16_t token);
518
519
520
521
522
523
524
525
526
527
528
529#define DPRC_CFG_OPT_SPAWN_ALLOWED 0x00000001
530
531
532
533
534
535
536
537#define DPRC_CFG_OPT_ALLOC_ALLOWED 0x00000002
538
539
540
541
542#define DPRC_CFG_OPT_OBJ_CREATE_ALLOWED 0x00000004
543
544
545
546
547
548#define DPRC_CFG_OPT_TOPOLOGY_CHANGES_ALLOWED 0x00000008
549
550
551
552#define DPRC_CFG_OPT_AIOP 0x00000020
553
554
555#define DPRC_CFG_OPT_IRQ_CFG_ALLOWED 0x00000040
556
557
558
559
560
561
562
563
564
565
566struct dprc_cfg {
567 uint16_t icid;
568 int portal_id;
569 uint64_t options;
570 char label[16];
571};
572
573
574
575
576
577
578
579
580
581
582
583
584
585int dprc_create_container(struct fsl_mc_io *mc_io,
586 uint32_t cmd_flags,
587 uint16_t token,
588 struct dprc_cfg *cfg,
589 int *child_container_id,
590 uint64_t *child_portal_offset);
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614int dprc_destroy_container(struct fsl_mc_io *mc_io,
615 uint32_t cmd_flags,
616 uint16_t token,
617 int child_container_id);
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641int dprc_reset_container(struct fsl_mc_io *mc_io,
642 uint32_t cmd_flags,
643 uint16_t token,
644 int child_container_id);
645
646
647
648
649
650
651
652
653
654struct dprc_attributes {
655 int container_id;
656 uint16_t icid;
657 int portal_id;
658 uint64_t options;
659};
660
661
662
663
664
665
666
667
668
669
670int dprc_get_attributes(struct fsl_mc_io *mc_io,
671 uint32_t cmd_flags,
672 uint16_t token,
673 struct dprc_attributes *attributes);
674
675
676
677
678
679
680
681
682
683
684int dprc_get_obj_count(struct fsl_mc_io *mc_io,
685 uint32_t cmd_flags,
686 uint16_t token,
687 int *obj_count);
688
689
690
691
692#define DPRC_OBJ_STATE_OPEN 0x00000001
693
694#define DPRC_OBJ_STATE_PLUGGED 0x00000002
695
696
697
698
699
700
701
702#define DPRC_OBJ_FLAG_NO_MEM_SHAREABILITY 0x0001
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717struct dprc_obj_desc {
718 char type[16];
719 int id;
720 uint16_t vendor;
721 uint16_t ver_major;
722 uint16_t ver_minor;
723 uint8_t irq_count;
724 uint8_t region_count;
725 uint32_t state;
726 char label[16];
727 uint16_t flags;
728};
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745int dprc_get_obj(struct fsl_mc_io *mc_io,
746 uint32_t cmd_flags,
747 uint16_t token,
748 int obj_index,
749 struct dprc_obj_desc *obj_desc);
750
751
752
753
754
755
756
757
758
759
760
761
762
763int dprc_get_res_count(struct fsl_mc_io *mc_io,
764 uint32_t cmd_flags,
765 uint16_t token,
766 char *type,
767 int *res_count);
768
769
770
771
772
773
774
775enum dprc_iter_status {
776 DPRC_ITER_STATUS_FIRST = 0,
777 DPRC_ITER_STATUS_MORE = 1,
778 DPRC_ITER_STATUS_LAST = 2
779};
780
781
782
783
784
785
786
787
788
789
790struct dprc_res_ids_range_desc {
791 int base_id;
792 int last_id;
793 enum dprc_iter_status iter_status;
794};
795
796
797
798
799
800
801
802
803
804
805
806int dprc_get_res_ids(struct fsl_mc_io *mc_io,
807 uint32_t cmd_flags,
808 uint16_t token,
809 char *type,
810 struct dprc_res_ids_range_desc *range_desc);
811
812
813
814#define DPRC_REGION_CACHEABLE 0x00000001
815
816
817
818
819
820
821enum dprc_region_type {
822 DPRC_REGION_TYPE_MC_PORTAL,
823 DPRC_REGION_TYPE_QBMAN_PORTAL
824};
825
826
827
828
829
830
831
832
833
834
835
836struct dprc_region_desc {
837 uint32_t base_offset;
838 uint32_t size;
839 uint32_t flags;
840 enum dprc_region_type type;
841};
842
843
844
845
846
847
848
849
850
851
852
853
854
855int dprc_get_obj_region(struct fsl_mc_io *mc_io,
856 uint32_t cmd_flags,
857 uint16_t token,
858 char *obj_type,
859 int obj_id,
860 uint8_t region_index,
861 struct dprc_region_desc *region_desc);
862
863
864
865
866
867
868
869
870struct dprc_endpoint {
871 char type[16];
872 int id;
873 uint16_t if_id;
874};
875
876
877
878
879
880
881
882struct dprc_connection_cfg {
883 uint32_t committed_rate;
884 uint32_t max_rate;
885};
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900int dprc_connect(struct fsl_mc_io *mc_io,
901 uint32_t cmd_flags,
902 uint16_t token,
903 const struct dprc_endpoint *endpoint1,
904 const struct dprc_endpoint *endpoint2,
905 const struct dprc_connection_cfg *cfg);
906
907
908
909
910
911
912
913
914
915
916int dprc_disconnect(struct fsl_mc_io *mc_io,
917 uint32_t cmd_flags,
918 uint16_t token,
919 const struct dprc_endpoint *endpoint);
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936int dprc_get_connection(struct fsl_mc_io *mc_io,
937 uint32_t cmd_flags,
938 uint16_t token,
939 const struct dprc_endpoint *endpoint1,
940 struct dprc_endpoint *endpoint2,
941 int *state);
942
943
944
945
946
947
948
949
950
951
952
953int dprc_get_api_version(struct fsl_mc_io *mc_io,
954 u32 cmd_flags,
955 u16 *major_ver,
956 u16 *minor_ver);
957
958#endif
959