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 disconnect on connection timeout support
58 #define HBM_MINOR_VERSION_DOT 0
59 #define HBM_MAJOR_VERSION_DOT 2
62 * MEI version with notifcation support
64 #define HBM_MINOR_VERSION_EV 0
65 #define HBM_MAJOR_VERSION_EV 2
67 /* Host bus message command opcode */
68 #define MEI_HBM_CMD_OP_MSK 0x7f
69 /* Host bus message command RESPONSE */
70 #define MEI_HBM_CMD_RES_MSK 0x80
73 * MEI Bus Message Command IDs
75 #define HOST_START_REQ_CMD 0x01
76 #define HOST_START_RES_CMD 0x81
78 #define HOST_STOP_REQ_CMD 0x02
79 #define HOST_STOP_RES_CMD 0x82
81 #define ME_STOP_REQ_CMD 0x03
83 #define HOST_ENUM_REQ_CMD 0x04
84 #define HOST_ENUM_RES_CMD 0x84
86 #define HOST_CLIENT_PROPERTIES_REQ_CMD 0x05
87 #define HOST_CLIENT_PROPERTIES_RES_CMD 0x85
89 #define CLIENT_CONNECT_REQ_CMD 0x06
90 #define CLIENT_CONNECT_RES_CMD 0x86
92 #define CLIENT_DISCONNECT_REQ_CMD 0x07
93 #define CLIENT_DISCONNECT_RES_CMD 0x87
95 #define MEI_FLOW_CONTROL_CMD 0x08
97 #define MEI_PG_ISOLATION_ENTRY_REQ_CMD 0x0a
98 #define MEI_PG_ISOLATION_ENTRY_RES_CMD 0x8a
99 #define MEI_PG_ISOLATION_EXIT_REQ_CMD 0x0b
100 #define MEI_PG_ISOLATION_EXIT_RES_CMD 0x8b
102 #define MEI_HBM_ADD_CLIENT_REQ_CMD 0x0f
103 #define MEI_HBM_ADD_CLIENT_RES_CMD 0x8f
105 #define MEI_HBM_NOTIFY_REQ_CMD 0x10
106 #define MEI_HBM_NOTIFY_RES_CMD 0x90
107 #define MEI_HBM_NOTIFICATION_CMD 0x11
111 * used by hbm_host_stop_request.reason
113 enum mei_stop_reason_types {
114 DRIVER_STOP_REQUEST = 0x00,
115 DEVICE_D1_ENTRY = 0x01,
116 DEVICE_D2_ENTRY = 0x02,
117 DEVICE_D3_ENTRY = 0x03,
118 SYSTEM_S1_ENTRY = 0x04,
119 SYSTEM_S2_ENTRY = 0x05,
120 SYSTEM_S3_ENTRY = 0x06,
121 SYSTEM_S4_ENTRY = 0x07,
122 SYSTEM_S5_ENTRY = 0x08
127 * enum mei_hbm_status - mei host bus messages return values
129 * @MEI_HBMS_SUCCESS : status success
130 * @MEI_HBMS_CLIENT_NOT_FOUND : client not found
131 * @MEI_HBMS_ALREADY_EXISTS : connection already established
132 * @MEI_HBMS_REJECTED : connection is rejected
133 * @MEI_HBMS_INVALID_PARAMETER : invalid parameter
134 * @MEI_HBMS_NOT_ALLOWED : operation not allowed
135 * @MEI_HBMS_ALREADY_STARTED : system is already started
136 * @MEI_HBMS_NOT_STARTED : system not started
138 * @MEI_HBMS_MAX : sentinel
140 enum mei_hbm_status {
141 MEI_HBMS_SUCCESS = 0,
142 MEI_HBMS_CLIENT_NOT_FOUND = 1,
143 MEI_HBMS_ALREADY_EXISTS = 2,
144 MEI_HBMS_REJECTED = 3,
145 MEI_HBMS_INVALID_PARAMETER = 4,
146 MEI_HBMS_NOT_ALLOWED = 5,
147 MEI_HBMS_ALREADY_STARTED = 6,
148 MEI_HBMS_NOT_STARTED = 7,
155 * Client Connect Status
156 * used by hbm_client_connect_response.status
158 enum mei_cl_connect_status {
159 MEI_CL_CONN_SUCCESS = MEI_HBMS_SUCCESS,
160 MEI_CL_CONN_NOT_FOUND = MEI_HBMS_CLIENT_NOT_FOUND,
161 MEI_CL_CONN_ALREADY_STARTED = MEI_HBMS_ALREADY_EXISTS,
162 MEI_CL_CONN_OUT_OF_RESOURCES = MEI_HBMS_REJECTED,
163 MEI_CL_CONN_MESSAGE_SMALL = MEI_HBMS_INVALID_PARAMETER,
164 MEI_CL_CONN_NOT_ALLOWED = MEI_HBMS_NOT_ALLOWED,
168 * Client Disconnect Status
170 enum mei_cl_disconnect_status {
171 MEI_CL_DISCONN_SUCCESS = MEI_HBMS_SUCCESS
175 * MEI BUS Interface Section
187 struct mei_bus_message {
193 * struct hbm_cl_cmd - client specific host bus command
194 * CONNECT, DISCONNECT, and FlOW CONTROL
196 * @hbm_cmd: bus message command header
197 * @me_addr: address of the client in ME
198 * @host_addr: address of the client in the driver
199 * @data: generic data
201 struct mei_hbm_cl_cmd {
213 struct hbm_host_version_request {
216 struct hbm_version host_version;
219 struct hbm_host_version_response {
221 u8 host_version_supported;
222 struct hbm_version me_max_version;
225 struct hbm_host_stop_request {
231 struct hbm_host_stop_response {
236 struct hbm_me_stop_request {
243 * struct hbm_host_enum_request - enumeration request from host to fw
245 * @hbm_cmd: bus message command header
246 * @allow_add: allow dynamic clients add HBM version >= 2.0
247 * @reserved: reserved
249 struct hbm_host_enum_request {
255 struct hbm_host_enum_response {
258 u8 valid_addresses[32];
261 struct mei_client_properties {
262 uuid_le protocol_name;
264 u8 max_number_of_connections;
270 struct hbm_props_request {
276 struct hbm_props_response {
281 struct mei_client_properties client_properties;
285 * struct hbm_add_client_request - request to add a client
286 * might be sent by fw after enumeration has already completed
288 * @hbm_cmd: bus message command header
289 * @me_addr: address of the client in ME
290 * @reserved: reserved
291 * @client_properties: client properties
293 struct hbm_add_client_request {
297 struct mei_client_properties client_properties;
301 * struct hbm_add_client_response - response to add a client
302 * sent by the host to report client addition status to fw
304 * @hbm_cmd: bus message command header
305 * @me_addr: address of the client in ME
306 * @status: if HBMS_SUCCESS then the client can now accept connections.
307 * @reserved: reserved
309 struct hbm_add_client_response {
317 * struct hbm_power_gate - power gate request/response
319 * @hbm_cmd: bus message command header
320 * @reserved: reserved
322 struct hbm_power_gate {
328 * struct hbm_client_connect_request - connect/disconnect request
330 * @hbm_cmd: bus message command header
331 * @me_addr: address of the client in ME
332 * @host_addr: address of the client in the driver
333 * @reserved: reserved
335 struct hbm_client_connect_request {
343 * struct hbm_client_connect_response - connect/disconnect response
345 * @hbm_cmd: bus message command header
346 * @me_addr: address of the client in ME
347 * @host_addr: address of the client in the driver
348 * @status: status of the request
350 struct hbm_client_connect_response {
358 #define MEI_FC_MESSAGE_RESERVED_LENGTH 5
360 struct hbm_flow_control {
364 u8 reserved[MEI_FC_MESSAGE_RESERVED_LENGTH];
367 #define MEI_HBM_NOTIFICATION_START 1
368 #define MEI_HBM_NOTIFICATION_STOP 0
370 * struct hbm_notification_request - start/stop notification request
372 * @hbm_cmd: bus message command header
373 * @me_addr: address of the client in ME
374 * @host_addr: address of the client in the driver
375 * @start: start = 1 or stop = 0 asynchronous notifications
377 struct hbm_notification_request {
385 * struct hbm_notification_response - start/stop notification response
387 * @hbm_cmd: bus message command header
388 * @me_addr: address of the client in ME
389 * @host_addr: - address of the client in the driver
390 * @status: (mei_hbm_status) response status for the request
391 * - MEI_HBMS_SUCCESS: successful stop/start
392 * - MEI_HBMS_CLIENT_NOT_FOUND: if the connection could not be found.
393 * - MEI_HBMS_ALREADY_STARTED: for start requests for a previously
394 * started notification.
395 * - MEI_HBMS_NOT_STARTED: for stop request for a connected client for whom
396 * asynchronous notifications are currently disabled.
398 * @start: start = 1 or stop = 0 asynchronous notifications
399 * @reserved: reserved
401 struct hbm_notification_response {
411 * struct hbm_notification - notification event
413 * @hbm_cmd: bus message command header
414 * @me_addr: address of the client in ME
415 * @host_addr: address of the client in the driver
416 * @reserved: reserved for alignment
418 struct hbm_notification {