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