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