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