1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17#ifndef _MEI_HW_TYPES_H_
18#define _MEI_HW_TYPES_H_
19
20#include <linux/uuid.h>
21
22
23
24
25#define MEI_HW_READY_TIMEOUT 2
26#define MEI_CONNECT_TIMEOUT 3
27
28#define MEI_CL_CONNECT_TIMEOUT 15
29#define MEI_CLIENTS_INIT_TIMEOUT 15
30
31#define MEI_IAMTHIF_STALL_TIMER 12
32
33#define MEI_PGI_TIMEOUT 1
34#define MEI_D0I3_TIMEOUT 5
35#define MEI_HBM_TIMEOUT 1
36
37
38
39
40#define HBM_MINOR_VERSION 0
41#define HBM_MAJOR_VERSION 2
42
43
44
45
46#define HBM_MINOR_VERSION_PGI 1
47#define HBM_MAJOR_VERSION_PGI 1
48
49
50
51
52#define HBM_MINOR_VERSION_DC 0
53#define HBM_MAJOR_VERSION_DC 2
54
55
56
57
58#define HBM_MINOR_VERSION_IE 0
59#define HBM_MAJOR_VERSION_IE 2
60
61
62
63
64#define HBM_MINOR_VERSION_DOT 0
65#define HBM_MAJOR_VERSION_DOT 2
66
67
68
69
70#define HBM_MINOR_VERSION_EV 0
71#define HBM_MAJOR_VERSION_EV 2
72
73
74
75
76#define HBM_MINOR_VERSION_FA 0
77#define HBM_MAJOR_VERSION_FA 2
78
79
80
81
82#define HBM_MINOR_VERSION_OS 0
83#define HBM_MAJOR_VERSION_OS 2
84
85
86#define MEI_HBM_CMD_OP_MSK 0x7f
87
88#define MEI_HBM_CMD_RES_MSK 0x80
89
90
91
92
93#define HOST_START_REQ_CMD 0x01
94#define HOST_START_RES_CMD 0x81
95
96#define HOST_STOP_REQ_CMD 0x02
97#define HOST_STOP_RES_CMD 0x82
98
99#define ME_STOP_REQ_CMD 0x03
100
101#define HOST_ENUM_REQ_CMD 0x04
102#define HOST_ENUM_RES_CMD 0x84
103
104#define HOST_CLIENT_PROPERTIES_REQ_CMD 0x05
105#define HOST_CLIENT_PROPERTIES_RES_CMD 0x85
106
107#define CLIENT_CONNECT_REQ_CMD 0x06
108#define CLIENT_CONNECT_RES_CMD 0x86
109
110#define CLIENT_DISCONNECT_REQ_CMD 0x07
111#define CLIENT_DISCONNECT_RES_CMD 0x87
112
113#define MEI_FLOW_CONTROL_CMD 0x08
114
115#define MEI_PG_ISOLATION_ENTRY_REQ_CMD 0x0a
116#define MEI_PG_ISOLATION_ENTRY_RES_CMD 0x8a
117#define MEI_PG_ISOLATION_EXIT_REQ_CMD 0x0b
118#define MEI_PG_ISOLATION_EXIT_RES_CMD 0x8b
119
120#define MEI_HBM_ADD_CLIENT_REQ_CMD 0x0f
121#define MEI_HBM_ADD_CLIENT_RES_CMD 0x8f
122
123#define MEI_HBM_NOTIFY_REQ_CMD 0x10
124#define MEI_HBM_NOTIFY_RES_CMD 0x90
125#define MEI_HBM_NOTIFICATION_CMD 0x11
126
127
128
129
130
131enum mei_stop_reason_types {
132 DRIVER_STOP_REQUEST = 0x00,
133 DEVICE_D1_ENTRY = 0x01,
134 DEVICE_D2_ENTRY = 0x02,
135 DEVICE_D3_ENTRY = 0x03,
136 SYSTEM_S1_ENTRY = 0x04,
137 SYSTEM_S2_ENTRY = 0x05,
138 SYSTEM_S3_ENTRY = 0x06,
139 SYSTEM_S4_ENTRY = 0x07,
140 SYSTEM_S5_ENTRY = 0x08
141};
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158enum mei_hbm_status {
159 MEI_HBMS_SUCCESS = 0,
160 MEI_HBMS_CLIENT_NOT_FOUND = 1,
161 MEI_HBMS_ALREADY_EXISTS = 2,
162 MEI_HBMS_REJECTED = 3,
163 MEI_HBMS_INVALID_PARAMETER = 4,
164 MEI_HBMS_NOT_ALLOWED = 5,
165 MEI_HBMS_ALREADY_STARTED = 6,
166 MEI_HBMS_NOT_STARTED = 7,
167
168 MEI_HBMS_MAX
169};
170
171
172
173
174
175
176enum mei_cl_connect_status {
177 MEI_CL_CONN_SUCCESS = MEI_HBMS_SUCCESS,
178 MEI_CL_CONN_NOT_FOUND = MEI_HBMS_CLIENT_NOT_FOUND,
179 MEI_CL_CONN_ALREADY_STARTED = MEI_HBMS_ALREADY_EXISTS,
180 MEI_CL_CONN_OUT_OF_RESOURCES = MEI_HBMS_REJECTED,
181 MEI_CL_CONN_MESSAGE_SMALL = MEI_HBMS_INVALID_PARAMETER,
182 MEI_CL_CONN_NOT_ALLOWED = MEI_HBMS_NOT_ALLOWED,
183};
184
185
186
187
188enum mei_cl_disconnect_status {
189 MEI_CL_DISCONN_SUCCESS = MEI_HBMS_SUCCESS
190};
191
192
193
194
195struct mei_msg_hdr {
196 u32 me_addr:8;
197 u32 host_addr:8;
198 u32 length:9;
199 u32 reserved:5;
200 u32 internal:1;
201 u32 msg_complete:1;
202} __packed;
203
204
205struct mei_bus_message {
206 u8 hbm_cmd;
207 u8 data[0];
208} __packed;
209
210
211
212
213
214
215
216
217
218
219struct mei_hbm_cl_cmd {
220 u8 hbm_cmd;
221 u8 me_addr;
222 u8 host_addr;
223 u8 data;
224};
225
226struct hbm_version {
227 u8 minor_version;
228 u8 major_version;
229} __packed;
230
231struct hbm_host_version_request {
232 u8 hbm_cmd;
233 u8 reserved;
234 struct hbm_version host_version;
235} __packed;
236
237struct hbm_host_version_response {
238 u8 hbm_cmd;
239 u8 host_version_supported;
240 struct hbm_version me_max_version;
241} __packed;
242
243struct hbm_host_stop_request {
244 u8 hbm_cmd;
245 u8 reason;
246 u8 reserved[2];
247} __packed;
248
249struct hbm_host_stop_response {
250 u8 hbm_cmd;
251 u8 reserved[3];
252} __packed;
253
254struct hbm_me_stop_request {
255 u8 hbm_cmd;
256 u8 reason;
257 u8 reserved[2];
258} __packed;
259
260
261
262
263
264
265
266enum hbm_host_enum_flags {
267 MEI_HBM_ENUM_F_ALLOW_ADD = BIT(0),
268 MEI_HBM_ENUM_F_IMMEDIATE_ENUM = BIT(1),
269};
270
271
272
273
274
275
276
277
278struct hbm_host_enum_request {
279 u8 hbm_cmd;
280 u8 flags;
281 u8 reserved[2];
282} __packed;
283
284struct hbm_host_enum_response {
285 u8 hbm_cmd;
286 u8 reserved[3];
287 u8 valid_addresses[32];
288} __packed;
289
290struct mei_client_properties {
291 uuid_le protocol_name;
292 u8 protocol_version;
293 u8 max_number_of_connections;
294 u8 fixed_address;
295 u8 single_recv_buf;
296 u32 max_msg_length;
297} __packed;
298
299struct hbm_props_request {
300 u8 hbm_cmd;
301 u8 me_addr;
302 u8 reserved[2];
303} __packed;
304
305struct hbm_props_response {
306 u8 hbm_cmd;
307 u8 me_addr;
308 u8 status;
309 u8 reserved[1];
310 struct mei_client_properties client_properties;
311} __packed;
312
313
314
315
316
317
318
319
320
321
322struct hbm_add_client_request {
323 u8 hbm_cmd;
324 u8 me_addr;
325 u8 reserved[2];
326 struct mei_client_properties client_properties;
327} __packed;
328
329
330
331
332
333
334
335
336
337
338struct hbm_add_client_response {
339 u8 hbm_cmd;
340 u8 me_addr;
341 u8 status;
342 u8 reserved[1];
343} __packed;
344
345
346
347
348
349
350
351struct hbm_power_gate {
352 u8 hbm_cmd;
353 u8 reserved[3];
354} __packed;
355
356
357
358
359
360
361
362
363
364struct hbm_client_connect_request {
365 u8 hbm_cmd;
366 u8 me_addr;
367 u8 host_addr;
368 u8 reserved;
369} __packed;
370
371
372
373
374
375
376
377
378
379struct hbm_client_connect_response {
380 u8 hbm_cmd;
381 u8 me_addr;
382 u8 host_addr;
383 u8 status;
384} __packed;
385
386
387#define MEI_FC_MESSAGE_RESERVED_LENGTH 5
388
389struct hbm_flow_control {
390 u8 hbm_cmd;
391 u8 me_addr;
392 u8 host_addr;
393 u8 reserved[MEI_FC_MESSAGE_RESERVED_LENGTH];
394} __packed;
395
396#define MEI_HBM_NOTIFICATION_START 1
397#define MEI_HBM_NOTIFICATION_STOP 0
398
399
400
401
402
403
404
405
406struct hbm_notification_request {
407 u8 hbm_cmd;
408 u8 me_addr;
409 u8 host_addr;
410 u8 start;
411} __packed;
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430struct hbm_notification_response {
431 u8 hbm_cmd;
432 u8 me_addr;
433 u8 host_addr;
434 u8 status;
435 u8 start;
436 u8 reserved[3];
437} __packed;
438
439
440
441
442
443
444
445
446
447struct hbm_notification {
448 u8 hbm_cmd;
449 u8 me_addr;
450 u8 host_addr;
451 u8 reserved[1];
452} __packed;
453
454#endif
455