mei: me: add power gating isolation register write wrappers
[deliverable/linux.git] / drivers / misc / mei / hw.h
CommitLineData
5a6003f2
OW
1/*
2 *
3 * Intel Management Engine Interface (Intel MEI) Linux driver
733ba91c 4 * Copyright (c) 2003-2012, Intel Corporation.
5a6003f2
OW
5 *
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.
9 *
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
13 * more details.
14 *
15 */
16
17#ifndef _MEI_HW_TYPES_H_
18#define _MEI_HW_TYPES_H_
19
20#include <linux/uuid.h>
21
22/*
3870c320 23 * Timeouts in Seconds
5a6003f2 24 */
7d93e58d 25#define MEI_HW_READY_TIMEOUT 2 /* Timeout on ready message */
3870c320 26#define MEI_CONNECT_TIMEOUT 3 /* HPS: at least 2 seconds */
5a6003f2 27
3870c320
TW
28#define MEI_CL_CONNECT_TIMEOUT 15 /* HPS: Client Connect Timeout */
29#define MEI_CLIENTS_INIT_TIMEOUT 15 /* HPS: Clients Enumeration Timeout */
5a6003f2 30
3870c320
TW
31#define MEI_IAMTHIF_STALL_TIMER 12 /* HPS */
32#define MEI_IAMTHIF_READ_TIMER 10 /* HPS */
5a6003f2 33
7d93e58d 34#define MEI_HBM_TIMEOUT 1 /* 1 second */
5a6003f2
OW
35
36/*
37 * MEI Version
38 */
39#define HBM_MINOR_VERSION 0
40#define HBM_MAJOR_VERSION 1
5a6003f2 41
1ca7e782
TW
42/* Host bus message command opcode */
43#define MEI_HBM_CMD_OP_MSK 0x7f
44/* Host bus message command RESPONSE */
45#define MEI_HBM_CMD_RES_MSK 0x80
46
5a6003f2
OW
47/*
48 * MEI Bus Message Command IDs
49 */
50#define HOST_START_REQ_CMD 0x01
51#define HOST_START_RES_CMD 0x81
52
53#define HOST_STOP_REQ_CMD 0x02
54#define HOST_STOP_RES_CMD 0x82
55
56#define ME_STOP_REQ_CMD 0x03
57
58#define HOST_ENUM_REQ_CMD 0x04
59#define HOST_ENUM_RES_CMD 0x84
60
61#define HOST_CLIENT_PROPERTIES_REQ_CMD 0x05
62#define HOST_CLIENT_PROPERTIES_RES_CMD 0x85
63
64#define CLIENT_CONNECT_REQ_CMD 0x06
65#define CLIENT_CONNECT_RES_CMD 0x86
66
67#define CLIENT_DISCONNECT_REQ_CMD 0x07
68#define CLIENT_DISCONNECT_RES_CMD 0x87
69
1ca7e782 70#define MEI_FLOW_CONTROL_CMD 0x08
5a6003f2 71
4fcbc99b
TW
72#define MEI_PG_ISOLATION_ENTRY_REQ_CMD 0x0a
73#define MEI_PG_ISOLATION_ENTRY_RES_CMD 0x8a
74#define MEI_PG_ISOLATION_EXIT_REQ_CMD 0x0b
75#define MEI_PG_ISOLATION_EXIT_RES_CMD 0x8b
76
5a6003f2
OW
77/*
78 * MEI Stop Reason
79 * used by hbm_host_stop_request.reason
80 */
81enum mei_stop_reason_types {
82 DRIVER_STOP_REQUEST = 0x00,
83 DEVICE_D1_ENTRY = 0x01,
84 DEVICE_D2_ENTRY = 0x02,
85 DEVICE_D3_ENTRY = 0x03,
86 SYSTEM_S1_ENTRY = 0x04,
87 SYSTEM_S2_ENTRY = 0x05,
88 SYSTEM_S3_ENTRY = 0x06,
89 SYSTEM_S4_ENTRY = 0x07,
90 SYSTEM_S5_ENTRY = 0x08
91};
92
93/*
94 * Client Connect Status
95 * used by hbm_client_connect_response.status
96 */
285e2996
AU
97enum mei_cl_connect_status {
98 MEI_CL_CONN_SUCCESS = 0x00,
99 MEI_CL_CONN_NOT_FOUND = 0x01,
100 MEI_CL_CONN_ALREADY_STARTED = 0x02,
101 MEI_CL_CONN_OUT_OF_RESOURCES = 0x03,
102 MEI_CL_CONN_MESSAGE_SMALL = 0x04
5a6003f2
OW
103};
104
105/*
106 * Client Disconnect Status
107 */
285e2996
AU
108enum mei_cl_disconnect_status {
109 MEI_CL_DISCONN_SUCCESS = 0x00
5a6003f2
OW
110};
111
112/*
113 * MEI BUS Interface Section
114 */
115struct mei_msg_hdr {
116 u32 me_addr:8;
117 u32 host_addr:8;
118 u32 length:9;
479327fc
TW
119 u32 reserved:5;
120 u32 internal:1;
5a6003f2
OW
121 u32 msg_complete:1;
122} __packed;
123
124
5a6003f2 125struct mei_bus_message {
1ca7e782
TW
126 u8 hbm_cmd;
127 u8 data[0];
5a6003f2
OW
128} __packed;
129
cd51ed64
TW
130/**
131 * struct hbm_cl_cmd - client specific host bus command
132 * CONNECT, DISCONNECT, and FlOW CONTROL
133 *
134 * @hbm_cmd - bus message command header
135 * @me_addr - address of the client in ME
136 * @host_addr - address of the client in the driver
137 * @data
138 */
139struct mei_hbm_cl_cmd {
140 u8 hbm_cmd;
141 u8 me_addr;
142 u8 host_addr;
143 u8 data;
144};
145
5a6003f2
OW
146struct hbm_version {
147 u8 minor_version;
148 u8 major_version;
149} __packed;
150
151struct hbm_host_version_request {
1ca7e782 152 u8 hbm_cmd;
5a6003f2
OW
153 u8 reserved;
154 struct hbm_version host_version;
155} __packed;
156
157struct hbm_host_version_response {
1ca7e782 158 u8 hbm_cmd;
4b00706c 159 u8 host_version_supported;
5a6003f2
OW
160 struct hbm_version me_max_version;
161} __packed;
162
163struct hbm_host_stop_request {
1ca7e782 164 u8 hbm_cmd;
5a6003f2
OW
165 u8 reason;
166 u8 reserved[2];
167} __packed;
168
169struct hbm_host_stop_response {
1ca7e782 170 u8 hbm_cmd;
5a6003f2
OW
171 u8 reserved[3];
172} __packed;
173
174struct hbm_me_stop_request {
1ca7e782 175 u8 hbm_cmd;
5a6003f2
OW
176 u8 reason;
177 u8 reserved[2];
178} __packed;
179
180struct hbm_host_enum_request {
1ca7e782 181 u8 hbm_cmd;
5a6003f2
OW
182 u8 reserved[3];
183} __packed;
184
185struct hbm_host_enum_response {
1ca7e782 186 u8 hbm_cmd;
5a6003f2
OW
187 u8 reserved[3];
188 u8 valid_addresses[32];
189} __packed;
190
191struct mei_client_properties {
192 uuid_le protocol_name;
193 u8 protocol_version;
194 u8 max_number_of_connections;
195 u8 fixed_address;
196 u8 single_recv_buf;
197 u32 max_msg_length;
198} __packed;
199
200struct hbm_props_request {
1ca7e782 201 u8 hbm_cmd;
5a6003f2
OW
202 u8 address;
203 u8 reserved[2];
204} __packed;
205
206
207struct hbm_props_response {
1ca7e782 208 u8 hbm_cmd;
5a6003f2
OW
209 u8 address;
210 u8 status;
211 u8 reserved[1];
212 struct mei_client_properties client_properties;
213} __packed;
214
4fcbc99b
TW
215/**
216 * struct hbm_power_gate - power gate request/response
217 *
218 * @hbm_cmd - bus message command header
219 * @reserved[3]
220 */
221struct hbm_power_gate {
222 u8 hbm_cmd;
223 u8 reserved[3];
224} __packed;
225
aeba4a06
TW
226/**
227 * struct hbm_client_connect_request - connect/disconnect request
228 *
229 * @hbm_cmd - bus message command header
230 * @me_addr - address of the client in ME
231 * @host_addr - address of the client in the driver
232 * @reserved
233 */
5a6003f2 234struct hbm_client_connect_request {
1ca7e782 235 u8 hbm_cmd;
5a6003f2
OW
236 u8 me_addr;
237 u8 host_addr;
238 u8 reserved;
239} __packed;
240
aeba4a06
TW
241/**
242 * struct hbm_client_connect_response - connect/disconnect response
243 *
244 * @hbm_cmd - bus message command header
245 * @me_addr - address of the client in ME
246 * @host_addr - address of the client in the driver
247 * @status - status of the request
248 */
5a6003f2 249struct hbm_client_connect_response {
1ca7e782 250 u8 hbm_cmd;
5a6003f2
OW
251 u8 me_addr;
252 u8 host_addr;
253 u8 status;
254} __packed;
255
5a6003f2
OW
256
257#define MEI_FC_MESSAGE_RESERVED_LENGTH 5
258
259struct hbm_flow_control {
1ca7e782 260 u8 hbm_cmd;
5a6003f2
OW
261 u8 me_addr;
262 u8 host_addr;
263 u8 reserved[MEI_FC_MESSAGE_RESERVED_LENGTH];
264} __packed;
265
5a6003f2
OW
266
267#endif
This page took 0.19652 seconds and 5 git commands to generate.