3 * Intel Management Engine Interface (Intel MEI) Linux driver
4 * Copyright (c) 2003-2012, Intel Corporation.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17 #ifndef _MEI_HW_TYPES_H_
18 #define _MEI_HW_TYPES_H_
20 #include <linux/uuid.h>
25 #define MEI_HW_READY_TIMEOUT 2 /* Timeout on ready message */
26 #define MEI_CONNECT_TIMEOUT 3 /* HPS: at least 2 seconds */
28 #define MEI_CL_CONNECT_TIMEOUT 15 /* HPS: Client Connect Timeout */
29 #define MEI_CLIENTS_INIT_TIMEOUT 15 /* HPS: Clients Enumeration Timeout */
31 #define MEI_IAMTHIF_STALL_TIMER 12 /* HPS */
33 #define MEI_PGI_TIMEOUT 1 /* PG Isolation time response 1 sec */
34 #define MEI_D0I3_TIMEOUT 5 /* D0i3 set/unset max response time */
35 #define MEI_HBM_TIMEOUT 1 /* 1 second */
40 #define HBM_MINOR_VERSION 0
41 #define HBM_MAJOR_VERSION 2
44 * MEI version with PGI support
46 #define HBM_MINOR_VERSION_PGI 1
47 #define HBM_MAJOR_VERSION_PGI 1
50 * MEI version with Dynamic clients support
52 #define HBM_MINOR_VERSION_DC 0
53 #define HBM_MAJOR_VERSION_DC 2
56 * MEI version with immediate reply to enum request support
58 #define HBM_MINOR_VERSION_IE 0
59 #define HBM_MAJOR_VERSION_IE 2
62 * MEI version with disconnect on connection timeout support
64 #define HBM_MINOR_VERSION_DOT 0
65 #define HBM_MAJOR_VERSION_DOT 2
68 * MEI version with notifcation support
70 #define HBM_MINOR_VERSION_EV 0
71 #define HBM_MAJOR_VERSION_EV 2
74 * MEI version with fixed address client support
76 #define HBM_MINOR_VERSION_FA 0
77 #define HBM_MAJOR_VERSION_FA 2
79 /* Host bus message command opcode */
80 #define MEI_HBM_CMD_OP_MSK 0x7f
81 /* Host bus message command RESPONSE */
82 #define MEI_HBM_CMD_RES_MSK 0x80
85 * MEI Bus Message Command IDs
87 #define HOST_START_REQ_CMD 0x01
88 #define HOST_START_RES_CMD 0x81
90 #define HOST_STOP_REQ_CMD 0x02
91 #define HOST_STOP_RES_CMD 0x82
93 #define ME_STOP_REQ_CMD 0x03
95 #define HOST_ENUM_REQ_CMD 0x04
96 #define HOST_ENUM_RES_CMD 0x84
98 #define HOST_CLIENT_PROPERTIES_REQ_CMD 0x05
99 #define HOST_CLIENT_PROPERTIES_RES_CMD 0x85
101 #define CLIENT_CONNECT_REQ_CMD 0x06
102 #define CLIENT_CONNECT_RES_CMD 0x86
104 #define CLIENT_DISCONNECT_REQ_CMD 0x07
105 #define CLIENT_DISCONNECT_RES_CMD 0x87
107 #define MEI_FLOW_CONTROL_CMD 0x08
109 #define MEI_PG_ISOLATION_ENTRY_REQ_CMD 0x0a
110 #define MEI_PG_ISOLATION_ENTRY_RES_CMD 0x8a
111 #define MEI_PG_ISOLATION_EXIT_REQ_CMD 0x0b
112 #define MEI_PG_ISOLATION_EXIT_RES_CMD 0x8b
114 #define MEI_HBM_ADD_CLIENT_REQ_CMD 0x0f
115 #define MEI_HBM_ADD_CLIENT_RES_CMD 0x8f
117 #define MEI_HBM_NOTIFY_REQ_CMD 0x10
118 #define MEI_HBM_NOTIFY_RES_CMD 0x90
119 #define MEI_HBM_NOTIFICATION_CMD 0x11
123 * used by hbm_host_stop_request.reason
125 enum mei_stop_reason_types
{
126 DRIVER_STOP_REQUEST
= 0x00,
127 DEVICE_D1_ENTRY
= 0x01,
128 DEVICE_D2_ENTRY
= 0x02,
129 DEVICE_D3_ENTRY
= 0x03,
130 SYSTEM_S1_ENTRY
= 0x04,
131 SYSTEM_S2_ENTRY
= 0x05,
132 SYSTEM_S3_ENTRY
= 0x06,
133 SYSTEM_S4_ENTRY
= 0x07,
134 SYSTEM_S5_ENTRY
= 0x08
139 * enum mei_hbm_status - mei host bus messages return values
141 * @MEI_HBMS_SUCCESS : status success
142 * @MEI_HBMS_CLIENT_NOT_FOUND : client not found
143 * @MEI_HBMS_ALREADY_EXISTS : connection already established
144 * @MEI_HBMS_REJECTED : connection is rejected
145 * @MEI_HBMS_INVALID_PARAMETER : invalid parameter
146 * @MEI_HBMS_NOT_ALLOWED : operation not allowed
147 * @MEI_HBMS_ALREADY_STARTED : system is already started
148 * @MEI_HBMS_NOT_STARTED : system not started
150 * @MEI_HBMS_MAX : sentinel
152 enum mei_hbm_status
{
153 MEI_HBMS_SUCCESS
= 0,
154 MEI_HBMS_CLIENT_NOT_FOUND
= 1,
155 MEI_HBMS_ALREADY_EXISTS
= 2,
156 MEI_HBMS_REJECTED
= 3,
157 MEI_HBMS_INVALID_PARAMETER
= 4,
158 MEI_HBMS_NOT_ALLOWED
= 5,
159 MEI_HBMS_ALREADY_STARTED
= 6,
160 MEI_HBMS_NOT_STARTED
= 7,
167 * Client Connect Status
168 * used by hbm_client_connect_response.status
170 enum mei_cl_connect_status
{
171 MEI_CL_CONN_SUCCESS
= MEI_HBMS_SUCCESS
,
172 MEI_CL_CONN_NOT_FOUND
= MEI_HBMS_CLIENT_NOT_FOUND
,
173 MEI_CL_CONN_ALREADY_STARTED
= MEI_HBMS_ALREADY_EXISTS
,
174 MEI_CL_CONN_OUT_OF_RESOURCES
= MEI_HBMS_REJECTED
,
175 MEI_CL_CONN_MESSAGE_SMALL
= MEI_HBMS_INVALID_PARAMETER
,
176 MEI_CL_CONN_NOT_ALLOWED
= MEI_HBMS_NOT_ALLOWED
,
180 * Client Disconnect Status
182 enum mei_cl_disconnect_status
{
183 MEI_CL_DISCONN_SUCCESS
= MEI_HBMS_SUCCESS
187 * MEI BUS Interface Section
199 struct mei_bus_message
{
205 * struct hbm_cl_cmd - client specific host bus command
206 * CONNECT, DISCONNECT, and FlOW CONTROL
208 * @hbm_cmd: bus message command header
209 * @me_addr: address of the client in ME
210 * @host_addr: address of the client in the driver
211 * @data: generic data
213 struct mei_hbm_cl_cmd
{
225 struct hbm_host_version_request
{
228 struct hbm_version host_version
;
231 struct hbm_host_version_response
{
233 u8 host_version_supported
;
234 struct hbm_version me_max_version
;
237 struct hbm_host_stop_request
{
243 struct hbm_host_stop_response
{
248 struct hbm_me_stop_request
{
255 * enum hbm_host_enum_flags - enumeration request flags (HBM version >= 2.0)
257 * @MEI_HBM_ENUM_F_ALLOW_ADD: allow dynamic clients add
258 * @MEI_HBM_ENUM_F_IMMEDIATE_ENUM: allow FW to send answer immediately
260 enum hbm_host_enum_flags
{
261 MEI_HBM_ENUM_F_ALLOW_ADD
= BIT(0),
262 MEI_HBM_ENUM_F_IMMEDIATE_ENUM
= BIT(1),
266 * struct hbm_host_enum_request - enumeration request from host to fw
268 * @hbm_cmd : bus message command header
269 * @flags : request flags
270 * @reserved: reserved
272 struct hbm_host_enum_request
{
278 struct hbm_host_enum_response
{
281 u8 valid_addresses
[32];
284 struct mei_client_properties
{
285 uuid_le protocol_name
;
287 u8 max_number_of_connections
;
293 struct hbm_props_request
{
299 struct hbm_props_response
{
304 struct mei_client_properties client_properties
;
308 * struct hbm_add_client_request - request to add a client
309 * might be sent by fw after enumeration has already completed
311 * @hbm_cmd: bus message command header
312 * @me_addr: address of the client in ME
313 * @reserved: reserved
314 * @client_properties: client properties
316 struct hbm_add_client_request
{
320 struct mei_client_properties client_properties
;
324 * struct hbm_add_client_response - response to add a client
325 * sent by the host to report client addition status to fw
327 * @hbm_cmd: bus message command header
328 * @me_addr: address of the client in ME
329 * @status: if HBMS_SUCCESS then the client can now accept connections.
330 * @reserved: reserved
332 struct hbm_add_client_response
{
340 * struct hbm_power_gate - power gate request/response
342 * @hbm_cmd: bus message command header
343 * @reserved: reserved
345 struct hbm_power_gate
{
351 * struct hbm_client_connect_request - connect/disconnect request
353 * @hbm_cmd: bus message command header
354 * @me_addr: address of the client in ME
355 * @host_addr: address of the client in the driver
356 * @reserved: reserved
358 struct hbm_client_connect_request
{
366 * struct hbm_client_connect_response - connect/disconnect response
368 * @hbm_cmd: bus message command header
369 * @me_addr: address of the client in ME
370 * @host_addr: address of the client in the driver
371 * @status: status of the request
373 struct hbm_client_connect_response
{
381 #define MEI_FC_MESSAGE_RESERVED_LENGTH 5
383 struct hbm_flow_control
{
387 u8 reserved
[MEI_FC_MESSAGE_RESERVED_LENGTH
];
390 #define MEI_HBM_NOTIFICATION_START 1
391 #define MEI_HBM_NOTIFICATION_STOP 0
393 * struct hbm_notification_request - start/stop notification request
395 * @hbm_cmd: bus message command header
396 * @me_addr: address of the client in ME
397 * @host_addr: address of the client in the driver
398 * @start: start = 1 or stop = 0 asynchronous notifications
400 struct hbm_notification_request
{
408 * struct hbm_notification_response - start/stop notification response
410 * @hbm_cmd: bus message command header
411 * @me_addr: address of the client in ME
412 * @host_addr: - address of the client in the driver
413 * @status: (mei_hbm_status) response status for the request
414 * - MEI_HBMS_SUCCESS: successful stop/start
415 * - MEI_HBMS_CLIENT_NOT_FOUND: if the connection could not be found.
416 * - MEI_HBMS_ALREADY_STARTED: for start requests for a previously
417 * started notification.
418 * - MEI_HBMS_NOT_STARTED: for stop request for a connected client for whom
419 * asynchronous notifications are currently disabled.
421 * @start: start = 1 or stop = 0 asynchronous notifications
422 * @reserved: reserved
424 struct hbm_notification_response
{
434 * struct hbm_notification - notification event
436 * @hbm_cmd: bus message command header
437 * @me_addr: address of the client in ME
438 * @host_addr: address of the client in the driver
439 * @reserved: reserved for alignment
441 struct hbm_notification
{