2011-05-15 17:43:45 +07:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Intel Management Engine Interface (Intel MEI) Linux driver
|
2012-02-10 00:25:53 +07:00
|
|
|
* Copyright (c) 2003-2012, Intel Corporation.
|
2011-05-15 17:43:45 +07:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms and conditions of the GNU General Public License,
|
|
|
|
* version 2, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _MEI_HW_TYPES_H_
|
|
|
|
#define _MEI_HW_TYPES_H_
|
|
|
|
|
|
|
|
#include <linux/uuid.h>
|
|
|
|
|
|
|
|
/*
|
2012-11-02 02:17:14 +07:00
|
|
|
* Timeouts in Seconds
|
2011-05-15 17:43:45 +07:00
|
|
|
*/
|
2014-01-15 04:10:10 +07:00
|
|
|
#define MEI_HW_READY_TIMEOUT 2 /* Timeout on ready message */
|
2012-11-02 02:17:14 +07:00
|
|
|
#define MEI_CONNECT_TIMEOUT 3 /* HPS: at least 2 seconds */
|
2011-05-15 17:43:45 +07:00
|
|
|
|
2012-11-02 02:17:14 +07:00
|
|
|
#define MEI_CL_CONNECT_TIMEOUT 15 /* HPS: Client Connect Timeout */
|
|
|
|
#define MEI_CLIENTS_INIT_TIMEOUT 15 /* HPS: Clients Enumeration Timeout */
|
2011-05-15 17:43:45 +07:00
|
|
|
|
2012-11-02 02:17:14 +07:00
|
|
|
#define MEI_IAMTHIF_STALL_TIMER 12 /* HPS */
|
|
|
|
#define MEI_IAMTHIF_READ_TIMER 10 /* HPS */
|
2011-05-15 17:43:45 +07:00
|
|
|
|
2014-03-19 03:52:00 +07:00
|
|
|
#define MEI_PGI_TIMEOUT 1 /* PG Isolation time response 1 sec */
|
2014-01-15 04:10:10 +07:00
|
|
|
#define MEI_HBM_TIMEOUT 1 /* 1 second */
|
2011-05-15 17:43:45 +07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* MEI Version
|
|
|
|
*/
|
|
|
|
#define HBM_MINOR_VERSION 0
|
|
|
|
#define HBM_MAJOR_VERSION 1
|
|
|
|
|
2014-03-19 03:51:58 +07:00
|
|
|
/*
|
|
|
|
* MEI version with PGI support
|
|
|
|
*/
|
|
|
|
#define HBM_MINOR_VERSION_PGI 1
|
|
|
|
#define HBM_MAJOR_VERSION_PGI 1
|
|
|
|
|
2012-02-27 04:18:57 +07:00
|
|
|
/* Host bus message command opcode */
|
|
|
|
#define MEI_HBM_CMD_OP_MSK 0x7f
|
|
|
|
/* Host bus message command RESPONSE */
|
|
|
|
#define MEI_HBM_CMD_RES_MSK 0x80
|
|
|
|
|
2011-05-15 17:43:45 +07:00
|
|
|
/*
|
|
|
|
* MEI Bus Message Command IDs
|
|
|
|
*/
|
|
|
|
#define HOST_START_REQ_CMD 0x01
|
|
|
|
#define HOST_START_RES_CMD 0x81
|
|
|
|
|
|
|
|
#define HOST_STOP_REQ_CMD 0x02
|
|
|
|
#define HOST_STOP_RES_CMD 0x82
|
|
|
|
|
|
|
|
#define ME_STOP_REQ_CMD 0x03
|
|
|
|
|
|
|
|
#define HOST_ENUM_REQ_CMD 0x04
|
|
|
|
#define HOST_ENUM_RES_CMD 0x84
|
|
|
|
|
|
|
|
#define HOST_CLIENT_PROPERTIES_REQ_CMD 0x05
|
|
|
|
#define HOST_CLIENT_PROPERTIES_RES_CMD 0x85
|
|
|
|
|
|
|
|
#define CLIENT_CONNECT_REQ_CMD 0x06
|
|
|
|
#define CLIENT_CONNECT_RES_CMD 0x86
|
|
|
|
|
|
|
|
#define CLIENT_DISCONNECT_REQ_CMD 0x07
|
|
|
|
#define CLIENT_DISCONNECT_RES_CMD 0x87
|
|
|
|
|
2012-02-27 04:18:57 +07:00
|
|
|
#define MEI_FLOW_CONTROL_CMD 0x08
|
2011-05-15 17:43:45 +07:00
|
|
|
|
2014-03-19 03:51:55 +07:00
|
|
|
#define MEI_PG_ISOLATION_ENTRY_REQ_CMD 0x0a
|
|
|
|
#define MEI_PG_ISOLATION_ENTRY_RES_CMD 0x8a
|
|
|
|
#define MEI_PG_ISOLATION_EXIT_REQ_CMD 0x0b
|
|
|
|
#define MEI_PG_ISOLATION_EXIT_RES_CMD 0x8b
|
|
|
|
|
2011-05-15 17:43:45 +07:00
|
|
|
/*
|
|
|
|
* MEI Stop Reason
|
|
|
|
* used by hbm_host_stop_request.reason
|
|
|
|
*/
|
|
|
|
enum mei_stop_reason_types {
|
|
|
|
DRIVER_STOP_REQUEST = 0x00,
|
|
|
|
DEVICE_D1_ENTRY = 0x01,
|
|
|
|
DEVICE_D2_ENTRY = 0x02,
|
|
|
|
DEVICE_D3_ENTRY = 0x03,
|
|
|
|
SYSTEM_S1_ENTRY = 0x04,
|
|
|
|
SYSTEM_S2_ENTRY = 0x05,
|
|
|
|
SYSTEM_S3_ENTRY = 0x06,
|
|
|
|
SYSTEM_S4_ENTRY = 0x07,
|
|
|
|
SYSTEM_S5_ENTRY = 0x08
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Client Connect Status
|
|
|
|
* used by hbm_client_connect_response.status
|
|
|
|
*/
|
2014-02-17 20:13:20 +07:00
|
|
|
enum mei_cl_connect_status {
|
|
|
|
MEI_CL_CONN_SUCCESS = 0x00,
|
|
|
|
MEI_CL_CONN_NOT_FOUND = 0x01,
|
|
|
|
MEI_CL_CONN_ALREADY_STARTED = 0x02,
|
|
|
|
MEI_CL_CONN_OUT_OF_RESOURCES = 0x03,
|
|
|
|
MEI_CL_CONN_MESSAGE_SMALL = 0x04
|
2011-05-15 17:43:45 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Client Disconnect Status
|
|
|
|
*/
|
2014-02-17 20:13:20 +07:00
|
|
|
enum mei_cl_disconnect_status {
|
|
|
|
MEI_CL_DISCONN_SUCCESS = 0x00
|
2011-05-15 17:43:45 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* MEI BUS Interface Section
|
|
|
|
*/
|
|
|
|
struct mei_msg_hdr {
|
|
|
|
u32 me_addr:8;
|
|
|
|
u32 host_addr:8;
|
|
|
|
u32 length:9;
|
2013-12-17 20:56:56 +07:00
|
|
|
u32 reserved:5;
|
|
|
|
u32 internal:1;
|
2011-05-15 17:43:45 +07:00
|
|
|
u32 msg_complete:1;
|
|
|
|
} __packed;
|
|
|
|
|
|
|
|
|
|
|
|
struct mei_bus_message {
|
2012-02-27 04:18:57 +07:00
|
|
|
u8 hbm_cmd;
|
|
|
|
u8 data[0];
|
2011-05-15 17:43:45 +07:00
|
|
|
} __packed;
|
|
|
|
|
2012-12-26 00:06:09 +07:00
|
|
|
/**
|
|
|
|
* struct hbm_cl_cmd - client specific host bus command
|
|
|
|
* CONNECT, DISCONNECT, and FlOW CONTROL
|
|
|
|
*
|
|
|
|
* @hbm_cmd - bus message command header
|
|
|
|
* @me_addr - address of the client in ME
|
|
|
|
* @host_addr - address of the client in the driver
|
|
|
|
* @data
|
|
|
|
*/
|
|
|
|
struct mei_hbm_cl_cmd {
|
|
|
|
u8 hbm_cmd;
|
|
|
|
u8 me_addr;
|
|
|
|
u8 host_addr;
|
|
|
|
u8 data;
|
|
|
|
};
|
|
|
|
|
2011-05-15 17:43:45 +07:00
|
|
|
struct hbm_version {
|
|
|
|
u8 minor_version;
|
|
|
|
u8 major_version;
|
|
|
|
} __packed;
|
|
|
|
|
|
|
|
struct hbm_host_version_request {
|
2012-02-27 04:18:57 +07:00
|
|
|
u8 hbm_cmd;
|
2011-05-15 17:43:45 +07:00
|
|
|
u8 reserved;
|
|
|
|
struct hbm_version host_version;
|
|
|
|
} __packed;
|
|
|
|
|
|
|
|
struct hbm_host_version_response {
|
2012-02-27 04:18:57 +07:00
|
|
|
u8 hbm_cmd;
|
2012-02-24 02:52:55 +07:00
|
|
|
u8 host_version_supported;
|
2011-05-15 17:43:45 +07:00
|
|
|
struct hbm_version me_max_version;
|
|
|
|
} __packed;
|
|
|
|
|
|
|
|
struct hbm_host_stop_request {
|
2012-02-27 04:18:57 +07:00
|
|
|
u8 hbm_cmd;
|
2011-05-15 17:43:45 +07:00
|
|
|
u8 reason;
|
|
|
|
u8 reserved[2];
|
|
|
|
} __packed;
|
|
|
|
|
|
|
|
struct hbm_host_stop_response {
|
2012-02-27 04:18:57 +07:00
|
|
|
u8 hbm_cmd;
|
2011-05-15 17:43:45 +07:00
|
|
|
u8 reserved[3];
|
|
|
|
} __packed;
|
|
|
|
|
|
|
|
struct hbm_me_stop_request {
|
2012-02-27 04:18:57 +07:00
|
|
|
u8 hbm_cmd;
|
2011-05-15 17:43:45 +07:00
|
|
|
u8 reason;
|
|
|
|
u8 reserved[2];
|
|
|
|
} __packed;
|
|
|
|
|
|
|
|
struct hbm_host_enum_request {
|
2012-02-27 04:18:57 +07:00
|
|
|
u8 hbm_cmd;
|
2011-05-15 17:43:45 +07:00
|
|
|
u8 reserved[3];
|
|
|
|
} __packed;
|
|
|
|
|
|
|
|
struct hbm_host_enum_response {
|
2012-02-27 04:18:57 +07:00
|
|
|
u8 hbm_cmd;
|
2011-05-15 17:43:45 +07:00
|
|
|
u8 reserved[3];
|
|
|
|
u8 valid_addresses[32];
|
|
|
|
} __packed;
|
|
|
|
|
|
|
|
struct mei_client_properties {
|
|
|
|
uuid_le protocol_name;
|
|
|
|
u8 protocol_version;
|
|
|
|
u8 max_number_of_connections;
|
|
|
|
u8 fixed_address;
|
|
|
|
u8 single_recv_buf;
|
|
|
|
u32 max_msg_length;
|
|
|
|
} __packed;
|
|
|
|
|
|
|
|
struct hbm_props_request {
|
2012-02-27 04:18:57 +07:00
|
|
|
u8 hbm_cmd;
|
2011-05-15 17:43:45 +07:00
|
|
|
u8 address;
|
|
|
|
u8 reserved[2];
|
|
|
|
} __packed;
|
|
|
|
|
|
|
|
|
|
|
|
struct hbm_props_response {
|
2012-02-27 04:18:57 +07:00
|
|
|
u8 hbm_cmd;
|
2011-05-15 17:43:45 +07:00
|
|
|
u8 address;
|
|
|
|
u8 status;
|
|
|
|
u8 reserved[1];
|
|
|
|
struct mei_client_properties client_properties;
|
|
|
|
} __packed;
|
|
|
|
|
2014-03-19 03:51:55 +07:00
|
|
|
/**
|
|
|
|
* struct hbm_power_gate - power gate request/response
|
|
|
|
*
|
|
|
|
* @hbm_cmd - bus message command header
|
|
|
|
* @reserved[3]
|
|
|
|
*/
|
|
|
|
struct hbm_power_gate {
|
|
|
|
u8 hbm_cmd;
|
|
|
|
u8 reserved[3];
|
|
|
|
} __packed;
|
|
|
|
|
2012-11-11 22:38:04 +07:00
|
|
|
/**
|
|
|
|
* struct hbm_client_connect_request - connect/disconnect request
|
|
|
|
*
|
|
|
|
* @hbm_cmd - bus message command header
|
|
|
|
* @me_addr - address of the client in ME
|
|
|
|
* @host_addr - address of the client in the driver
|
|
|
|
* @reserved
|
|
|
|
*/
|
2011-05-15 17:43:45 +07:00
|
|
|
struct hbm_client_connect_request {
|
2012-02-27 04:18:57 +07:00
|
|
|
u8 hbm_cmd;
|
2011-05-15 17:43:45 +07:00
|
|
|
u8 me_addr;
|
|
|
|
u8 host_addr;
|
|
|
|
u8 reserved;
|
|
|
|
} __packed;
|
|
|
|
|
2012-11-11 22:38:04 +07:00
|
|
|
/**
|
|
|
|
* struct hbm_client_connect_response - connect/disconnect response
|
|
|
|
*
|
|
|
|
* @hbm_cmd - bus message command header
|
|
|
|
* @me_addr - address of the client in ME
|
|
|
|
* @host_addr - address of the client in the driver
|
|
|
|
* @status - status of the request
|
|
|
|
*/
|
2011-05-15 17:43:45 +07:00
|
|
|
struct hbm_client_connect_response {
|
2012-02-27 04:18:57 +07:00
|
|
|
u8 hbm_cmd;
|
2011-05-15 17:43:45 +07:00
|
|
|
u8 me_addr;
|
|
|
|
u8 host_addr;
|
|
|
|
u8 status;
|
|
|
|
} __packed;
|
|
|
|
|
|
|
|
|
|
|
|
#define MEI_FC_MESSAGE_RESERVED_LENGTH 5
|
|
|
|
|
|
|
|
struct hbm_flow_control {
|
2012-02-27 04:18:57 +07:00
|
|
|
u8 hbm_cmd;
|
2011-05-15 17:43:45 +07:00
|
|
|
u8 me_addr;
|
|
|
|
u8 host_addr;
|
|
|
|
u8 reserved[MEI_FC_MESSAGE_RESERVED_LENGTH];
|
|
|
|
} __packed;
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|