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 */
32 #define MEI_IAMTHIF_READ_TIMER 10 /* HPS */
34 #define MEI_PGI_TIMEOUT 1 /* PG Isolation time response 1 sec */
35 #define MEI_HBM_TIMEOUT 1 /* 1 second */
40 #define HBM_MINOR_VERSION 1
41 #define HBM_MAJOR_VERSION 1
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
55 /* Host bus message command opcode */
56 #define MEI_HBM_CMD_OP_MSK 0x7f
57 /* Host bus message command RESPONSE */
58 #define MEI_HBM_CMD_RES_MSK 0x80
61 * MEI Bus Message Command IDs
63 #define HOST_START_REQ_CMD 0x01
64 #define HOST_START_RES_CMD 0x81
66 #define HOST_STOP_REQ_CMD 0x02
67 #define HOST_STOP_RES_CMD 0x82
69 #define ME_STOP_REQ_CMD 0x03
71 #define HOST_ENUM_REQ_CMD 0x04
72 #define HOST_ENUM_RES_CMD 0x84
74 #define HOST_CLIENT_PROPERTIES_REQ_CMD 0x05
75 #define HOST_CLIENT_PROPERTIES_RES_CMD 0x85
77 #define CLIENT_CONNECT_REQ_CMD 0x06
78 #define CLIENT_CONNECT_RES_CMD 0x86
80 #define CLIENT_DISCONNECT_REQ_CMD 0x07
81 #define CLIENT_DISCONNECT_RES_CMD 0x87
83 #define MEI_FLOW_CONTROL_CMD 0x08
85 #define MEI_PG_ISOLATION_ENTRY_REQ_CMD 0x0a
86 #define MEI_PG_ISOLATION_ENTRY_RES_CMD 0x8a
87 #define MEI_PG_ISOLATION_EXIT_REQ_CMD 0x0b
88 #define MEI_PG_ISOLATION_EXIT_RES_CMD 0x8b
90 #define MEI_HBM_ADD_CLIENT_REQ_CMD 0x0f
91 #define MEI_HBM_ADD_CLIENT_RES_CMD 0x8f
94 * used by hbm_host_stop_request.reason
96 enum mei_stop_reason_types {
97 DRIVER_STOP_REQUEST = 0x00,
98 DEVICE_D1_ENTRY = 0x01,
99 DEVICE_D2_ENTRY = 0x02,
100 DEVICE_D3_ENTRY = 0x03,
101 SYSTEM_S1_ENTRY = 0x04,
102 SYSTEM_S2_ENTRY = 0x05,
103 SYSTEM_S3_ENTRY = 0x06,
104 SYSTEM_S4_ENTRY = 0x07,
105 SYSTEM_S5_ENTRY = 0x08
110 * enum mei_hbm_status - mei host bus messages return values
112 * @MEI_HBMS_SUCCESS : status success
113 * @MEI_HBMS_CLIENT_NOT_FOUND : client not found
114 * @MEI_HBMS_ALREADY_EXISTS : connection already established
115 * @MEI_HBMS_REJECTED : connection is rejected
116 * @MEI_HBMS_INVALID_PARAMETER : invalid parameter
117 * @MEI_HBMS_NOT_ALLOWED : operation not allowed
118 * @MEI_HBMS_ALREADY_STARTED : system is already started
119 * @MEI_HBMS_NOT_STARTED : system not started
121 * @MEI_HBMS_MAX : sentinel
123 enum mei_hbm_status {
124 MEI_HBMS_SUCCESS = 0,
125 MEI_HBMS_CLIENT_NOT_FOUND = 1,
126 MEI_HBMS_ALREADY_EXISTS = 2,
127 MEI_HBMS_REJECTED = 3,
128 MEI_HBMS_INVALID_PARAMETER = 4,
129 MEI_HBMS_NOT_ALLOWED = 5,
130 MEI_HBMS_ALREADY_STARTED = 6,
131 MEI_HBMS_NOT_STARTED = 7,
138 * Client Connect Status
139 * used by hbm_client_connect_response.status
141 enum mei_cl_connect_status {
142 MEI_CL_CONN_SUCCESS = MEI_HBMS_SUCCESS,
143 MEI_CL_CONN_NOT_FOUND = MEI_HBMS_CLIENT_NOT_FOUND,
144 MEI_CL_CONN_ALREADY_STARTED = MEI_HBMS_ALREADY_EXISTS,
145 MEI_CL_CONN_OUT_OF_RESOURCES = MEI_HBMS_REJECTED,
146 MEI_CL_CONN_MESSAGE_SMALL = MEI_HBMS_INVALID_PARAMETER,
150 * Client Disconnect Status
152 enum mei_cl_disconnect_status {
153 MEI_CL_DISCONN_SUCCESS = MEI_HBMS_SUCCESS
157 * MEI BUS Interface Section
169 struct mei_bus_message {
175 * struct hbm_cl_cmd - client specific host bus command
176 * CONNECT, DISCONNECT, and FlOW CONTROL
178 * @hbm_cmd: bus message command header
179 * @me_addr: address of the client in ME
180 * @host_addr: address of the client in the driver
181 * @data: generic data
183 struct mei_hbm_cl_cmd {
195 struct hbm_host_version_request {
198 struct hbm_version host_version;
201 struct hbm_host_version_response {
203 u8 host_version_supported;
204 struct hbm_version me_max_version;
207 struct hbm_host_stop_request {
213 struct hbm_host_stop_response {
218 struct hbm_me_stop_request {
225 * struct hbm_host_enum_request - enumeration request from host to fw
227 * @hbm_cmd: bus message command header
228 * @allow_add: allow dynamic clients add HBM version >= 2.0
229 * @reserved: reserved
231 struct hbm_host_enum_request {
237 struct hbm_host_enum_response {
240 u8 valid_addresses[32];
243 struct mei_client_properties {
244 uuid_le protocol_name;
246 u8 max_number_of_connections;
252 struct hbm_props_request {
258 struct hbm_props_response {
263 struct mei_client_properties client_properties;
267 * struct hbm_add_client_request - request to add a client
268 * might be sent by fw after enumeration has already completed
270 * @hbm_cmd: bus message command header
271 * @me_addr: address of the client in ME
272 * @reserved: reserved
273 * @client_properties: client properties
275 struct hbm_add_client_request {
279 struct mei_client_properties client_properties;
283 * struct hbm_add_client_response - response to add a client
284 * sent by the host to report client addition status to fw
286 * @hbm_cmd: bus message command header
287 * @me_addr: address of the client in ME
288 * @status: if HBMS_SUCCESS then the client can now accept connections.
289 * @reserved: reserved
291 struct hbm_add_client_response {
299 * struct hbm_power_gate - power gate request/response
301 * @hbm_cmd: bus message command header
302 * @reserved: reserved
304 struct hbm_power_gate {
310 * struct hbm_client_connect_request - connect/disconnect request
312 * @hbm_cmd: bus message command header
313 * @me_addr: address of the client in ME
314 * @host_addr: address of the client in the driver
315 * @reserved: reserved
317 struct hbm_client_connect_request {
325 * struct hbm_client_connect_response - connect/disconnect response
327 * @hbm_cmd: bus message command header
328 * @me_addr: address of the client in ME
329 * @host_addr: address of the client in the driver
330 * @status: status of the request
332 struct hbm_client_connect_response {
340 #define MEI_FC_MESSAGE_RESERVED_LENGTH 5
342 struct hbm_flow_control {
346 u8 reserved[MEI_FC_MESSAGE_RESERVED_LENGTH];