blob: 15e2db0568ea5164742e94b4de4810f5ccba703c [file] [log] [blame]
Angel Pons182dbde2020-04-02 23:49:05 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Aaron Durbin76c37002012-10-30 09:03:43 -05002
3/*
4 * This is a ramstage driver for the Intel Management Engine found in the
5 * 6-series chipset. It handles the required boot-time messages over the
6 * MMIO-based Management Engine Interface to tell the ME that the BIOS is
7 * finished with POST. Additional messages are defined for debug but are
8 * not used unless the console loglevel is high enough.
9 */
10
Furquan Shaikh76cedd22020-05-02 10:24:23 -070011#include <acpi/acpi.h>
Kyösti Mälkki13f66502019-03-03 08:01:05 +020012#include <device/mmio.h>
Kyösti Mälkkif1b58b72019-03-01 13:43:02 +020013#include <device/pci_ops.h>
Aaron Durbin76c37002012-10-30 09:03:43 -050014#include <console/console.h>
Stefan Reinauer24d1d4b2013-03-21 11:51:41 -070015#include <device/device.h>
16#include <device/pci.h>
Aaron Durbin76c37002012-10-30 09:03:43 -050017#include <device/pci_ids.h>
18#include <device/pci_def.h>
19#include <string.h>
20#include <delay.h>
21#include <elog.h>
Elyes HAOUAS400f9ca2019-06-23 07:01:22 +020022#include <stdlib.h>
Aaron Durbin76c37002012-10-30 09:03:43 -050023
Kyösti Mälkki12b121c2019-08-18 16:33:39 +030024#include "chip.h"
Aaron Durbin76c37002012-10-30 09:03:43 -050025#include "me.h"
26#include "pch.h"
27
Aaron Durbin76c37002012-10-30 09:03:43 -050028#include <vendorcode/google/chromeos/chromeos.h>
Aaron Durbin76c37002012-10-30 09:03:43 -050029
Aaron Durbin76c37002012-10-30 09:03:43 -050030/* Path that the BIOS should take based on ME state */
Angel Pons10274d82021-02-23 14:19:28 +010031static const char *const me_bios_path_values[] = {
Aaron Durbin76c37002012-10-30 09:03:43 -050032 [ME_NORMAL_BIOS_PATH] = "Normal",
33 [ME_S3WAKE_BIOS_PATH] = "S3 Wake",
34 [ME_ERROR_BIOS_PATH] = "Error",
35 [ME_RECOVERY_BIOS_PATH] = "Recovery",
36 [ME_DISABLE_BIOS_PATH] = "Disable",
37 [ME_FIRMWARE_UPDATE_BIOS_PATH] = "Firmware Update",
38};
Aaron Durbin76c37002012-10-30 09:03:43 -050039
40/* MMIO base address for MEI interface */
Angel Ponsa3492d72021-02-23 14:12:25 +010041static u8 *mei_base_address;
Aaron Durbin76c37002012-10-30 09:03:43 -050042
Angel Ponsdf2049b2021-11-24 14:39:10 +010043static void mei_dump(u32 dword, int offset, const char *type)
Aaron Durbin76c37002012-10-30 09:03:43 -050044{
Angel Ponsdf2049b2021-11-24 14:39:10 +010045 union mei_csr csr;
Aaron Durbin76c37002012-10-30 09:03:43 -050046
Kyösti Mälkkic86fc8e2019-11-06 06:32:27 +020047 if (!CONFIG(DEBUG_INTEL_ME))
48 return;
49
Aaron Durbin76c37002012-10-30 09:03:43 -050050 printk(BIOS_SPEW, "%-9s[%02x] : ", type, offset);
51
52 switch (offset) {
53 case MEI_H_CSR:
54 case MEI_ME_CSR_HA:
Angel Ponsdf2049b2021-11-24 14:39:10 +010055 csr.raw = dword;
Aaron Durbin76c37002012-10-30 09:03:43 -050056 printk(BIOS_SPEW, "cbd=%u cbrp=%02u cbwp=%02u ready=%u "
Angel Ponsdf2049b2021-11-24 14:39:10 +010057 "reset=%u ig=%u is=%u ie=%u\n", csr.buffer_depth,
58 csr.buffer_read_ptr, csr.buffer_write_ptr,
59 csr.ready, csr.reset, csr.interrupt_generate,
60 csr.interrupt_status, csr.interrupt_enable);
Aaron Durbin76c37002012-10-30 09:03:43 -050061 break;
62 case MEI_ME_CB_RW:
63 case MEI_H_CB_WW:
64 printk(BIOS_SPEW, "CB: 0x%08x\n", dword);
65 break;
66 default:
67 printk(BIOS_SPEW, "0x%08x\n", offset);
68 break;
69 }
70}
Aaron Durbin76c37002012-10-30 09:03:43 -050071
72/*
73 * ME/MEI access helpers using memcpy to avoid aliasing.
74 */
75
Angel Ponsdf2049b2021-11-24 14:39:10 +010076static inline void read_host_csr(union mei_csr *csr)
Aaron Durbin76c37002012-10-30 09:03:43 -050077{
Angel Ponsdf2049b2021-11-24 14:39:10 +010078 csr->raw = read32(mei_base_address + MEI_H_CSR);
79 mei_dump(csr->raw, MEI_H_CSR, "READ");
Aaron Durbin76c37002012-10-30 09:03:43 -050080}
81
Angel Ponsdf2049b2021-11-24 14:39:10 +010082static inline void write_host_csr(union mei_csr *csr)
Aaron Durbin76c37002012-10-30 09:03:43 -050083{
Angel Ponsdf2049b2021-11-24 14:39:10 +010084 write32(mei_base_address + MEI_H_CSR, csr->raw);
85 mei_dump(csr->raw, MEI_H_CSR, "WRITE");
Aaron Durbin76c37002012-10-30 09:03:43 -050086}
87
Angel Ponsdf2049b2021-11-24 14:39:10 +010088static inline void read_me_csr(union mei_csr *csr)
Aaron Durbin76c37002012-10-30 09:03:43 -050089{
Angel Ponsdf2049b2021-11-24 14:39:10 +010090 csr->raw = read32(mei_base_address + MEI_ME_CSR_HA);
91 mei_dump(csr->raw, MEI_ME_CSR_HA, "READ");
Aaron Durbin76c37002012-10-30 09:03:43 -050092}
93
94static inline void write_cb(u32 dword)
95{
Angel Ponsa3492d72021-02-23 14:12:25 +010096 write32(mei_base_address + MEI_H_CB_WW, dword);
Angel Ponsdf2049b2021-11-24 14:39:10 +010097 mei_dump(dword, MEI_H_CB_WW, "WRITE");
Aaron Durbin76c37002012-10-30 09:03:43 -050098}
99
100static inline u32 read_cb(void)
101{
Angel Ponsa3492d72021-02-23 14:12:25 +0100102 u32 dword = read32(mei_base_address + MEI_ME_CB_RW);
Angel Ponsdf2049b2021-11-24 14:39:10 +0100103 mei_dump(dword, MEI_ME_CB_RW, "READ");
Aaron Durbin76c37002012-10-30 09:03:43 -0500104 return dword;
105}
106
107/* Wait for ME ready bit to be asserted */
108static int mei_wait_for_me_ready(void)
109{
Angel Ponsdf2049b2021-11-24 14:39:10 +0100110 union mei_csr me;
Martin Rothff744bf2019-10-23 21:46:03 -0600111 unsigned int try = ME_RETRY;
Aaron Durbin76c37002012-10-30 09:03:43 -0500112
113 while (try--) {
114 read_me_csr(&me);
115 if (me.ready)
116 return 0;
117 udelay(ME_DELAY);
118 }
119
120 printk(BIOS_ERR, "ME: failed to become ready\n");
121 return -1;
122}
123
124static void mei_reset(void)
125{
Angel Ponsdf2049b2021-11-24 14:39:10 +0100126 union mei_csr host;
Aaron Durbin76c37002012-10-30 09:03:43 -0500127
128 if (mei_wait_for_me_ready() < 0)
129 return;
130
131 /* Reset host and ME circular buffers for next message */
132 read_host_csr(&host);
133 host.reset = 1;
134 host.interrupt_generate = 1;
135 write_host_csr(&host);
136
137 if (mei_wait_for_me_ready() < 0)
138 return;
139
140 /* Re-init and indicate host is ready */
141 read_host_csr(&host);
142 host.interrupt_generate = 1;
143 host.ready = 1;
144 host.reset = 0;
145 write_host_csr(&host);
146}
147
Angel Ponsdf2049b2021-11-24 14:39:10 +0100148static int mei_send_packet(union mei_header *mei, void *req_data)
Aaron Durbin76c37002012-10-30 09:03:43 -0500149{
Angel Ponsdf2049b2021-11-24 14:39:10 +0100150 union mei_csr host;
Martin Rothff744bf2019-10-23 21:46:03 -0600151 unsigned int ndata, n;
Aaron Durbin76c37002012-10-30 09:03:43 -0500152 u32 *data;
153
Duncan Laurie2017b4a2013-08-08 15:07:12 -0700154 /* Number of dwords to write */
Aaron Durbin76c37002012-10-30 09:03:43 -0500155 ndata = mei->length >> 2;
156
157 /* Pad non-dword aligned request message length */
158 if (mei->length & 3)
159 ndata++;
160 if (!ndata) {
Duncan Laurie2017b4a2013-08-08 15:07:12 -0700161 printk(BIOS_DEBUG, "ME: request has no data\n");
Aaron Durbin76c37002012-10-30 09:03:43 -0500162 return -1;
163 }
164 ndata++; /* Add MEI header */
165
166 /*
167 * Make sure there is still room left in the circular buffer.
168 * Reset the buffer pointers if the requested message will not fit.
169 */
170 read_host_csr(&host);
171 if ((host.buffer_depth - host.buffer_write_ptr) < ndata) {
172 printk(BIOS_ERR, "ME: circular buffer full, resetting...\n");
173 mei_reset();
174 read_host_csr(&host);
175 }
176
Duncan Laurie2017b4a2013-08-08 15:07:12 -0700177 /* Ensure the requested length will fit in the circular buffer. */
Aaron Durbin76c37002012-10-30 09:03:43 -0500178 if ((host.buffer_depth - host.buffer_write_ptr) < ndata) {
179 printk(BIOS_ERR, "ME: message (%u) too large for buffer (%u)\n",
180 ndata + 2, host.buffer_depth);
181 return -1;
182 }
183
184 /* Write MEI header */
Angel Ponsdf2049b2021-11-24 14:39:10 +0100185 write_cb(mei->raw);
Aaron Durbin76c37002012-10-30 09:03:43 -0500186 ndata--;
187
Aaron Durbin76c37002012-10-30 09:03:43 -0500188 /* Write message data */
189 data = req_data;
190 for (n = 0; n < ndata; ++n)
191 write_cb(*data++);
192
193 /* Generate interrupt to the ME */
194 read_host_csr(&host);
195 host.interrupt_generate = 1;
196 write_host_csr(&host);
197
198 /* Make sure ME is ready after sending request data */
199 return mei_wait_for_me_ready();
200}
201
Duncan Laurie2017b4a2013-08-08 15:07:12 -0700202static int mei_send_data(u8 me_address, u8 host_address,
203 void *req_data, int req_bytes)
204{
Angel Ponsdf2049b2021-11-24 14:39:10 +0100205 union mei_header header = {
Duncan Laurie2017b4a2013-08-08 15:07:12 -0700206 .client_address = me_address,
207 .host_address = host_address,
208 };
Angel Ponsdf2049b2021-11-24 14:39:10 +0100209 union mei_csr host;
Duncan Laurie2017b4a2013-08-08 15:07:12 -0700210 int current = 0;
211 u8 *req_ptr = req_data;
212
213 while (!header.is_complete) {
214 int remain = req_bytes - current;
215 int buf_len;
216
217 read_host_csr(&host);
218 buf_len = host.buffer_depth - host.buffer_write_ptr;
219
220 if (buf_len > remain) {
221 /* Send all remaining data as final message */
222 header.length = req_bytes - current;
223 header.is_complete = 1;
224 } else {
225 /* Send as much data as the buffer can hold */
226 header.length = buf_len;
227 }
228
229 mei_send_packet(&header, req_ptr);
230
231 req_ptr += header.length;
232 current += header.length;
233 }
234
235 return 0;
236}
237
238static int mei_send_header(u8 me_address, u8 host_address,
239 void *header, int header_len, int complete)
240{
Angel Ponsdf2049b2021-11-24 14:39:10 +0100241 union mei_header mei = {
Duncan Laurie2017b4a2013-08-08 15:07:12 -0700242 .client_address = me_address,
243 .host_address = host_address,
244 .length = header_len,
245 .is_complete = complete,
246 };
247 return mei_send_packet(&mei, header);
248}
249
250static int mei_recv_msg(void *header, int header_bytes,
Aaron Durbin76c37002012-10-30 09:03:43 -0500251 void *rsp_data, int rsp_bytes)
252{
Angel Ponsdf2049b2021-11-24 14:39:10 +0100253 union mei_header mei_rsp;
254 union mei_csr me, host;
Martin Rothff744bf2019-10-23 21:46:03 -0600255 unsigned int ndata, n;
256 unsigned int expected;
Aaron Durbin76c37002012-10-30 09:03:43 -0500257 u32 *data;
258
259 /* Total number of dwords to read from circular buffer */
Duncan Laurie2017b4a2013-08-08 15:07:12 -0700260 expected = (rsp_bytes + sizeof(mei_rsp) + header_bytes) >> 2;
Aaron Durbin76c37002012-10-30 09:03:43 -0500261 if (rsp_bytes & 3)
262 expected++;
263
Duncan Laurie2017b4a2013-08-08 15:07:12 -0700264 if (mei_wait_for_me_ready() < 0)
265 return -1;
266
Aaron Durbin76c37002012-10-30 09:03:43 -0500267 /*
268 * The interrupt status bit does not appear to indicate that the
269 * message has actually been received. Instead we wait until the
270 * expected number of dwords are present in the circular buffer.
271 */
272 for (n = ME_RETRY; n; --n) {
273 read_me_csr(&me);
274 if ((me.buffer_write_ptr - me.buffer_read_ptr) >= expected)
275 break;
276 udelay(ME_DELAY);
277 }
278 if (!n) {
279 printk(BIOS_ERR, "ME: timeout waiting for data: expected "
280 "%u, available %u\n", expected,
281 me.buffer_write_ptr - me.buffer_read_ptr);
282 return -1;
283 }
284
285 /* Read and verify MEI response header from the ME */
Angel Ponsdf2049b2021-11-24 14:39:10 +0100286 mei_rsp.raw = read_cb();
Aaron Durbin76c37002012-10-30 09:03:43 -0500287 if (!mei_rsp.is_complete) {
288 printk(BIOS_ERR, "ME: response is not complete\n");
289 return -1;
290 }
291
Duncan Laurie2017b4a2013-08-08 15:07:12 -0700292 /* Handle non-dword responses and expect at least the header */
Aaron Durbin76c37002012-10-30 09:03:43 -0500293 ndata = mei_rsp.length >> 2;
294 if (mei_rsp.length & 3)
295 ndata++;
296 if (ndata != (expected - 1)) {
297 printk(BIOS_ERR, "ME: response is missing data %d != %d\n",
298 ndata, (expected - 1));
299 return -1;
300 }
301
Duncan Laurie2017b4a2013-08-08 15:07:12 -0700302 /* Read response header from the ME */
303 data = header;
304 for (n = 0; n < (header_bytes >> 2); ++n)
305 *data++ = read_cb();
306 ndata -= header_bytes >> 2;
Aaron Durbin76c37002012-10-30 09:03:43 -0500307
308 /* Make sure caller passed a buffer with enough space */
309 if (ndata != (rsp_bytes >> 2)) {
310 printk(BIOS_ERR, "ME: not enough room in response buffer: "
311 "%u != %u\n", ndata, rsp_bytes >> 2);
312 return -1;
313 }
314
315 /* Read response data from the circular buffer */
316 data = rsp_data;
317 for (n = 0; n < ndata; ++n)
318 *data++ = read_cb();
319
320 /* Tell the ME that we have consumed the response */
321 read_host_csr(&host);
322 host.interrupt_status = 1;
323 host.interrupt_generate = 1;
324 write_host_csr(&host);
325
326 return mei_wait_for_me_ready();
327}
328
Duncan Laurie2017b4a2013-08-08 15:07:12 -0700329static inline int mei_sendrecv_mkhi(struct mkhi_header *mkhi,
330 void *req_data, int req_bytes,
331 void *rsp_data, int rsp_bytes)
Aaron Durbin76c37002012-10-30 09:03:43 -0500332{
Duncan Laurie2017b4a2013-08-08 15:07:12 -0700333 struct mkhi_header mkhi_rsp;
334
335 /* Send header */
336 if (mei_send_header(MEI_ADDRESS_MKHI, MEI_HOST_ADDRESS,
337 mkhi, sizeof(*mkhi), req_bytes ? 0 : 1) < 0)
Aaron Durbin76c37002012-10-30 09:03:43 -0500338 return -1;
Duncan Laurie2017b4a2013-08-08 15:07:12 -0700339
340 /* Send data if available */
341 if (req_bytes && mei_send_data(MEI_ADDRESS_MKHI, MEI_HOST_ADDRESS,
342 req_data, req_bytes) < 0)
Aaron Durbin76c37002012-10-30 09:03:43 -0500343 return -1;
Duncan Laurie2017b4a2013-08-08 15:07:12 -0700344
345 /* Return now if no response expected */
346 if (!rsp_bytes)
347 return 0;
348
349 /* Read header and data */
350 if (mei_recv_msg(&mkhi_rsp, sizeof(mkhi_rsp),
351 rsp_data, rsp_bytes) < 0)
352 return -1;
353
354 if (!mkhi_rsp.is_response ||
355 mkhi->group_id != mkhi_rsp.group_id ||
356 mkhi->command != mkhi_rsp.command) {
357 printk(BIOS_ERR, "ME: invalid response, group %u ?= %u,"
358 "command %u ?= %u, is_response %u\n", mkhi->group_id,
359 mkhi_rsp.group_id, mkhi->command, mkhi_rsp.command,
360 mkhi_rsp.is_response);
361 return -1;
362 }
363
Aaron Durbin76c37002012-10-30 09:03:43 -0500364 return 0;
365}
Duncan Laurie0dc0d132013-08-08 15:31:51 -0700366
Angel Pons7f8da792021-02-23 14:27:39 +0100367static inline int mei_sendrecv_icc(struct icc_header *icc,
368 void *req_data, int req_bytes,
369 void *rsp_data, int rsp_bytes)
370{
371 struct icc_header icc_rsp;
372
373 /* Send header */
374 if (mei_send_header(MEI_ADDRESS_ICC, MEI_HOST_ADDRESS,
375 icc, sizeof(*icc), req_bytes ? 0 : 1) < 0)
376 return -1;
377
378 /* Send data if available */
379 if (req_bytes && mei_send_data(MEI_ADDRESS_ICC, MEI_HOST_ADDRESS,
380 req_data, req_bytes) < 0)
381 return -1;
382
383 /* Read header and data, if needed */
384 if (rsp_bytes && mei_recv_msg(&icc_rsp, sizeof(icc_rsp),
385 rsp_data, rsp_bytes) < 0)
386 return -1;
387
388 return 0;
389}
390
Duncan Laurie3d299c42013-07-19 08:48:05 -0700391/*
392 * mbp give up routine. This path is taken if hfs.mpb_rdy is 0 or the read
393 * state machine on the BIOS end doesn't match the ME's state machine.
394 */
Elyes HAOUAS1dcd8db2018-12-05 10:59:42 +0100395static void intel_me_mbp_give_up(struct device *dev)
Duncan Laurie3d299c42013-07-19 08:48:05 -0700396{
Angel Ponsdf2049b2021-11-24 14:39:10 +0100397 union mei_csr csr;
Duncan Laurie3d299c42013-07-19 08:48:05 -0700398
399 pci_write_config32(dev, PCI_ME_H_GS2, PCI_ME_MBP_GIVE_UP);
400
401 read_host_csr(&csr);
402 csr.reset = 1;
403 csr.interrupt_generate = 1;
404 write_host_csr(&csr);
405}
406
407/*
408 * mbp clear routine. This will wait for the ME to indicate that
409 * the MBP has been read and cleared.
410 */
Angel Pons10274d82021-02-23 14:19:28 +0100411static void intel_me_mbp_clear(struct device *dev)
Duncan Laurie3d299c42013-07-19 08:48:05 -0700412{
413 int count;
Angel Pons032255c2021-11-24 14:12:38 +0100414 union me_hfs2 hfs2;
Duncan Laurie3d299c42013-07-19 08:48:05 -0700415
416 /* Wait for the mbp_cleared indicator */
417 for (count = ME_RETRY; count > 0; --count) {
Angel Pons032255c2021-11-24 14:12:38 +0100418 hfs2.raw = pci_read_config32(dev, PCI_ME_HFS2);
Duncan Laurie3d299c42013-07-19 08:48:05 -0700419 if (hfs2.mbp_cleared)
420 break;
421 udelay(ME_DELAY);
422 }
423
424 if (count == 0) {
425 printk(BIOS_WARNING, "ME: Timeout waiting for mbp_cleared\n");
426 intel_me_mbp_give_up(dev);
427 } else {
428 printk(BIOS_INFO, "ME: MBP cleared\n");
429 }
430}
431
Angel Pons01c9b982021-11-24 11:58:04 +0100432static void me_print_fw_version(struct mbp_fw_version_name *vers_name)
Aaron Durbin76c37002012-10-30 09:03:43 -0500433{
Aaron Durbinbe985242012-12-12 12:40:33 -0600434 if (!vers_name) {
Aaron Durbin76c37002012-10-30 09:03:43 -0500435 printk(BIOS_ERR, "ME: mbp missing version report\n");
436 return;
437 }
438
439 printk(BIOS_DEBUG, "ME: found version %d.%d.%d.%d\n",
440 vers_name->major_version, vers_name->minor_version,
441 vers_name->hotfix_version, vers_name->build_version);
442}
443
Edward O'Callaghan7bf4f482014-06-17 15:12:09 +1000444static inline void print_cap(const char *name, int state)
445{
446 printk(BIOS_DEBUG, "ME Capability: %-41s : %sabled\n",
447 name, state ? " en" : "dis");
448}
449
Aaron Durbin76c37002012-10-30 09:03:43 -0500450/* Get ME Firmware Capabilities */
Angel Pons01c9b982021-11-24 11:58:04 +0100451static int mkhi_get_fwcaps(struct mbp_mefwcaps *cap)
Aaron Durbin76c37002012-10-30 09:03:43 -0500452{
453 u32 rule_id = 0;
454 struct me_fwcaps cap_msg;
455 struct mkhi_header mkhi = {
456 .group_id = MKHI_GROUP_ID_FWCAPS,
457 .command = MKHI_FWCAPS_GET_RULE,
458 };
Aaron Durbin76c37002012-10-30 09:03:43 -0500459
460 /* Send request and wait for response */
Duncan Laurie2017b4a2013-08-08 15:07:12 -0700461 if (mei_sendrecv_mkhi(&mkhi, &rule_id, sizeof(u32),
462 &cap_msg, sizeof(cap_msg)) < 0) {
Aaron Durbin76c37002012-10-30 09:03:43 -0500463 printk(BIOS_ERR, "ME: GET FWCAPS message failed\n");
464 return -1;
Elyes HAOUASba28e8d2016-08-31 19:22:16 +0200465 }
Aaron Durbin76c37002012-10-30 09:03:43 -0500466 *cap = cap_msg.caps_sku;
467 return 0;
468}
469
470/* Get ME Firmware Capabilities */
Angel Pons01c9b982021-11-24 11:58:04 +0100471static void me_print_fwcaps(struct mbp_mefwcaps *cap)
Aaron Durbin76c37002012-10-30 09:03:43 -0500472{
Angel Pons01c9b982021-11-24 11:58:04 +0100473 struct mbp_mefwcaps local_caps;
Aaron Durbinbe985242012-12-12 12:40:33 -0600474 if (!cap) {
475 cap = &local_caps;
Aaron Durbin76c37002012-10-30 09:03:43 -0500476 printk(BIOS_ERR, "ME: mbp missing fwcaps report\n");
477 if (mkhi_get_fwcaps(cap))
478 return;
479 }
480
481 print_cap("Full Network manageability", cap->full_net);
482 print_cap("Regular Network manageability", cap->std_net);
483 print_cap("Manageability", cap->manageability);
Aaron Durbin76c37002012-10-30 09:03:43 -0500484 print_cap("IntelR Anti-Theft (AT)", cap->intel_at);
485 print_cap("IntelR Capability Licensing Service (CLS)", cap->intel_cls);
486 print_cap("IntelR Power Sharing Technology (MPC)", cap->intel_mpc);
487 print_cap("ICC Over Clocking", cap->icc_over_clocking);
Edward O'Callaghan7bf4f482014-06-17 15:12:09 +1000488 print_cap("Protected Audio Video Path (PAVP)", cap->pavp);
Aaron Durbin76c37002012-10-30 09:03:43 -0500489 print_cap("IPV6", cap->ipv6);
490 print_cap("KVM Remote Control (KVM)", cap->kvm);
491 print_cap("Outbreak Containment Heuristic (OCH)", cap->och);
492 print_cap("Virtual LAN (VLAN)", cap->vlan);
493 print_cap("TLS", cap->tls);
494 print_cap("Wireless LAN (WLAN)", cap->wlan);
495}
Aaron Durbin76c37002012-10-30 09:03:43 -0500496
Aaron Durbin76c37002012-10-30 09:03:43 -0500497/* Send END OF POST message to the ME */
Angel Pons10274d82021-02-23 14:19:28 +0100498static int mkhi_end_of_post(void)
Aaron Durbin76c37002012-10-30 09:03:43 -0500499{
500 struct mkhi_header mkhi = {
501 .group_id = MKHI_GROUP_ID_GEN,
502 .command = MKHI_END_OF_POST,
503 };
Aaron Durbin76c37002012-10-30 09:03:43 -0500504 u32 eop_ack;
505
506 /* Send request and wait for response */
Angel Pons08e8cab2020-06-18 15:20:37 +0200507 printk(BIOS_NOTICE, "ME: %s\n", __func__);
Duncan Laurie2017b4a2013-08-08 15:07:12 -0700508 if (mei_sendrecv_mkhi(&mkhi, NULL, 0, &eop_ack, sizeof(eop_ack)) < 0) {
Aaron Durbin76c37002012-10-30 09:03:43 -0500509 printk(BIOS_ERR, "ME: END OF POST message failed\n");
510 return -1;
511 }
512
513 printk(BIOS_INFO, "ME: END OF POST message successful (%d)\n", eop_ack);
514 return 0;
515}
516
Angel Pons10274d82021-02-23 14:19:28 +0100517void intel_me_finalize(struct device *dev)
Duncan Laurieaf980622013-07-18 23:02:18 -0700518{
Angel Pons032255c2021-11-24 14:12:38 +0100519 union me_hfs hfs;
Duncan Laurieaf980622013-07-18 23:02:18 -0700520 u32 reg32;
521
Angel Pons10274d82021-02-23 14:19:28 +0100522 reg32 = pci_read_config32(dev, PCI_BASE_ADDRESS_0);
Angel Ponsa3492d72021-02-23 14:12:25 +0100523 mei_base_address = (u8 *)(uintptr_t)(reg32 & ~PCI_BASE_ADDRESS_MEM_ATTR_MASK);
Duncan Laurieaf980622013-07-18 23:02:18 -0700524
525 /* S3 path will have hidden this device already */
Angel Ponsa3492d72021-02-23 14:12:25 +0100526 if (!mei_base_address || mei_base_address == (u8 *)0xfffffff0)
Duncan Laurieaf980622013-07-18 23:02:18 -0700527 return;
528
Duncan Laurie3d299c42013-07-19 08:48:05 -0700529 /* Wait for ME MBP Cleared indicator */
Angel Pons10274d82021-02-23 14:19:28 +0100530 intel_me_mbp_clear(dev);
Duncan Laurie3d299c42013-07-19 08:48:05 -0700531
Duncan Laurieaf980622013-07-18 23:02:18 -0700532 /* Make sure ME is in a mode that expects EOP */
Angel Pons032255c2021-11-24 14:12:38 +0100533 hfs.raw = pci_read_config32(dev, PCI_ME_HFS);
Duncan Laurieaf980622013-07-18 23:02:18 -0700534
535 /* Abort and leave device alone if not normal mode */
536 if (hfs.fpt_bad ||
537 hfs.working_state != ME_HFS_CWS_NORMAL ||
538 hfs.operation_mode != ME_HFS_MODE_NORMAL)
539 return;
540
541 /* Try to send EOP command so ME stops accepting other commands */
542 mkhi_end_of_post();
543
544 /* Make sure IO is disabled */
Angel Pons10274d82021-02-23 14:19:28 +0100545 pci_and_config16(dev, PCI_COMMAND,
Angel Ponsbf9bc502020-06-08 00:12:43 +0200546 ~(PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY | PCI_COMMAND_IO));
Duncan Laurieaf980622013-07-18 23:02:18 -0700547
548 /* Hide the PCI device */
549 RCBA32_OR(FD2, PCH_DISABLE_MEI1);
550}
551
Duncan Laurie0dc0d132013-08-08 15:31:51 -0700552static int me_icc_set_clock_enables(u32 mask)
553{
554 struct icc_clock_enables_msg clk = {
555 .clock_enables = 0, /* Turn off specified clocks */
556 .clock_mask = mask,
557 .no_response = 1, /* Do not expect response */
558 };
559 struct icc_header icc = {
560 .api_version = ICC_API_VERSION_LYNXPOINT,
561 .icc_command = ICC_SET_CLOCK_ENABLES,
562 .length = sizeof(clk),
563 };
564
565 /* Send request and wait for response */
566 if (mei_sendrecv_icc(&icc, &clk, sizeof(clk), NULL, 0) < 0) {
567 printk(BIOS_ERR, "ME: ICC SET CLOCK ENABLES message failed\n");
568 return -1;
Duncan Laurie0dc0d132013-08-08 15:31:51 -0700569 }
Elyes HAOUAS54f94242018-10-25 10:57:39 +0200570 printk(BIOS_INFO, "ME: ICC SET CLOCK ENABLES 0x%08x\n", mask);
Duncan Laurie0dc0d132013-08-08 15:31:51 -0700571 return 0;
572}
573
Aaron Durbin76c37002012-10-30 09:03:43 -0500574/* Determine the path that we should take based on ME status */
Angel Pons9f043742021-11-24 12:46:12 +0100575static enum me_bios_path intel_me_path(struct device *dev)
Aaron Durbin76c37002012-10-30 09:03:43 -0500576{
Angel Pons9f043742021-11-24 12:46:12 +0100577 enum me_bios_path path = ME_DISABLE_BIOS_PATH;
Angel Pons032255c2021-11-24 14:12:38 +0100578 union me_hfs hfs = { .raw = pci_read_config32(dev, PCI_ME_HFS) };
579 union me_hfs2 hfs2 = { .raw = pci_read_config32(dev, PCI_ME_HFS2) };
Aaron Durbin76c37002012-10-30 09:03:43 -0500580
581 /* Check and dump status */
Aaron Durbin9aa031e2012-11-02 09:16:46 -0500582 intel_me_status(&hfs, &hfs2);
Aaron Durbin76c37002012-10-30 09:03:43 -0500583
584 /* Check Current Working State */
585 switch (hfs.working_state) {
586 case ME_HFS_CWS_NORMAL:
587 path = ME_NORMAL_BIOS_PATH;
588 break;
589 case ME_HFS_CWS_REC:
590 path = ME_RECOVERY_BIOS_PATH;
591 break;
592 default:
593 path = ME_DISABLE_BIOS_PATH;
594 break;
595 }
596
597 /* Check Current Operation Mode */
598 switch (hfs.operation_mode) {
599 case ME_HFS_MODE_NORMAL:
600 break;
601 case ME_HFS_MODE_DEBUG:
602 case ME_HFS_MODE_DIS:
603 case ME_HFS_MODE_OVER_JMPR:
604 case ME_HFS_MODE_OVER_MEI:
605 default:
606 path = ME_DISABLE_BIOS_PATH;
607 break;
608 }
609
610 /* Check for any error code and valid firmware and MBP */
611 if (hfs.error_code || hfs.fpt_bad)
612 path = ME_ERROR_BIOS_PATH;
613
614 /* Check if the MBP is ready */
Aaron Durbin9aa031e2012-11-02 09:16:46 -0500615 if (!hfs2.mbp_rdy) {
Aaron Durbin76c37002012-10-30 09:03:43 -0500616 printk(BIOS_CRIT, "%s: mbp is not ready!\n",
Angel Pons08e8cab2020-06-18 15:20:37 +0200617 __func__);
Aaron Durbin76c37002012-10-30 09:03:43 -0500618 path = ME_ERROR_BIOS_PATH;
619 }
620
Kyösti Mälkkibe5317f2019-11-06 12:07:21 +0200621 if (CONFIG(ELOG) && path != ME_NORMAL_BIOS_PATH) {
Aaron Durbin76c37002012-10-30 09:03:43 -0500622 struct elog_event_data_me_extended data = {
623 .current_working_state = hfs.working_state,
624 .operation_state = hfs.operation_state,
625 .operation_mode = hfs.operation_mode,
626 .error_code = hfs.error_code,
Aaron Durbin9aa031e2012-11-02 09:16:46 -0500627 .progress_code = hfs2.progress_code,
628 .current_pmevent = hfs2.current_pmevent,
629 .current_state = hfs2.current_state,
Aaron Durbin76c37002012-10-30 09:03:43 -0500630 };
631 elog_add_event_byte(ELOG_TYPE_MANAGEMENT_ENGINE, path);
632 elog_add_event_raw(ELOG_TYPE_MANAGEMENT_ENGINE_EXT,
633 &data, sizeof(data));
634 }
Aaron Durbin76c37002012-10-30 09:03:43 -0500635
636 return path;
637}
638
639/* Prepare ME for MEI messages */
Elyes HAOUAS1dcd8db2018-12-05 10:59:42 +0100640static int intel_mei_setup(struct device *dev)
Aaron Durbin76c37002012-10-30 09:03:43 -0500641{
642 struct resource *res;
Angel Ponsdf2049b2021-11-24 14:39:10 +0100643 union mei_csr host;
Aaron Durbin76c37002012-10-30 09:03:43 -0500644
645 /* Find the MMIO base for the ME interface */
Angel Ponsf32ae102021-11-03 13:07:14 +0100646 res = probe_resource(dev, PCI_BASE_ADDRESS_0);
Aaron Durbin76c37002012-10-30 09:03:43 -0500647 if (!res || res->base == 0 || res->size == 0) {
648 printk(BIOS_DEBUG, "ME: MEI resource not present!\n");
649 return -1;
650 }
Angel Ponsd32b5142021-02-23 14:23:49 +0100651 mei_base_address = res2mmio(res, 0, 0);
Aaron Durbin76c37002012-10-30 09:03:43 -0500652
653 /* Ensure Memory and Bus Master bits are set */
Angel Ponsd5d4fbc2020-05-31 01:03:59 +0200654 pci_or_config16(dev, PCI_COMMAND, PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY);
Aaron Durbin76c37002012-10-30 09:03:43 -0500655
656 /* Clean up status for next message */
657 read_host_csr(&host);
658 host.interrupt_generate = 1;
659 host.ready = 1;
660 host.reset = 0;
661 write_host_csr(&host);
662
663 return 0;
664}
665
666/* Read the Extend register hash of ME firmware */
Elyes HAOUAS1dcd8db2018-12-05 10:59:42 +0100667static int intel_me_extend_valid(struct device *dev)
Aaron Durbin76c37002012-10-30 09:03:43 -0500668{
Angel Pons032255c2021-11-24 14:12:38 +0100669 union me_heres status = { .raw = pci_read_config32(dev, PCI_ME_HERES) };
Aaron Durbin76c37002012-10-30 09:03:43 -0500670 u32 extend[8] = {0};
671 int i, count = 0;
672
Aaron Durbin76c37002012-10-30 09:03:43 -0500673 if (!status.extend_feature_present) {
674 printk(BIOS_ERR, "ME: Extend Feature not present\n");
675 return -1;
676 }
677
678 if (!status.extend_reg_valid) {
679 printk(BIOS_ERR, "ME: Extend Register not valid\n");
680 return -1;
681 }
682
683 switch (status.extend_reg_algorithm) {
684 case PCI_ME_EXT_SHA1:
685 count = 5;
686 printk(BIOS_DEBUG, "ME: Extend SHA-1: ");
687 break;
688 case PCI_ME_EXT_SHA256:
689 count = 8;
690 printk(BIOS_DEBUG, "ME: Extend SHA-256: ");
691 break;
692 default:
693 printk(BIOS_ERR, "ME: Extend Algorithm %d unknown\n",
694 status.extend_reg_algorithm);
695 return -1;
696 }
697
698 for (i = 0; i < count; ++i) {
699 extend[i] = pci_read_config32(dev, PCI_ME_HER(i));
700 printk(BIOS_DEBUG, "%08x", extend[i]);
701 }
702 printk(BIOS_DEBUG, "\n");
703
Aaron Durbin76c37002012-10-30 09:03:43 -0500704 /* Save hash in NVS for the OS to verify */
Kyösti Mälkki84d10cc2021-02-10 17:53:34 +0200705 if (CONFIG(CHROMEOS_NVS))
Kyösti Mälkki26e0f4c2020-12-19 19:10:45 +0200706 chromeos_set_me_hash(extend, count);
Aaron Durbin76c37002012-10-30 09:03:43 -0500707
708 return 0;
709}
710
Aaron Durbin76c37002012-10-30 09:03:43 -0500711static u32 me_to_host_words_pending(void)
712{
Angel Ponsdf2049b2021-11-24 14:39:10 +0100713 union mei_csr me;
Aaron Durbin76c37002012-10-30 09:03:43 -0500714 read_me_csr(&me);
715 if (!me.ready)
716 return 0;
717 return (me.buffer_write_ptr - me.buffer_read_ptr) &
718 (me.buffer_depth - 1);
719}
720
Aaron Durbinbe985242012-12-12 12:40:33 -0600721struct mbp_payload {
Angel Ponsdf2049b2021-11-24 14:39:10 +0100722 union mbp_header header;
Aaron Durbinbe985242012-12-12 12:40:33 -0600723 u32 data[0];
724};
725
Aaron Durbin76c37002012-10-30 09:03:43 -0500726/*
Angel Pons7f8da792021-02-23 14:27:39 +0100727 * Read and print ME MBP data
728 *
729 * Return -1 to indicate a problem (give up)
730 * Return 0 to indicate success (send LOCK+EOP)
Aaron Durbin76c37002012-10-30 09:03:43 -0500731 */
Angel Pons01c9b982021-11-24 11:58:04 +0100732static int intel_me_read_mbp(struct me_bios_payload *mbp_data, struct device *dev)
Aaron Durbin76c37002012-10-30 09:03:43 -0500733{
Angel Ponsdf2049b2021-11-24 14:39:10 +0100734 union mbp_header mbp_hdr;
Aaron Durbin76c37002012-10-30 09:03:43 -0500735 u32 me2host_pending;
Angel Ponsdf2049b2021-11-24 14:39:10 +0100736 union mei_csr host;
Angel Pons032255c2021-11-24 14:12:38 +0100737 union me_hfs2 hfs2 = { .raw = pci_read_config32(dev, PCI_ME_HFS2) };
Aaron Durbinbe985242012-12-12 12:40:33 -0600738 struct mbp_payload *mbp;
739 int i;
Aaron Durbin9aa031e2012-11-02 09:16:46 -0500740
Aaron Durbin9aa031e2012-11-02 09:16:46 -0500741 if (!hfs2.mbp_rdy) {
742 printk(BIOS_ERR, "ME: MBP not ready\n");
743 goto mbp_failure;
744 }
Aaron Durbin76c37002012-10-30 09:03:43 -0500745
746 me2host_pending = me_to_host_words_pending();
747 if (!me2host_pending) {
748 printk(BIOS_ERR, "ME: no mbp data!\n");
Aaron Durbin9aa031e2012-11-02 09:16:46 -0500749 goto mbp_failure;
Aaron Durbin76c37002012-10-30 09:03:43 -0500750 }
751
752 /* we know for sure that at least the header is there */
Angel Ponsdf2049b2021-11-24 14:39:10 +0100753 mbp_hdr.raw = read_cb();
Aaron Durbin76c37002012-10-30 09:03:43 -0500754
755 if ((mbp_hdr.num_entries > (mbp_hdr.mbp_size / 2)) ||
756 (me2host_pending < mbp_hdr.mbp_size)) {
757 printk(BIOS_ERR, "ME: mbp of %d entries, total size %d words"
758 " buffer contains %d words\n",
759 mbp_hdr.num_entries, mbp_hdr.mbp_size,
760 me2host_pending);
Aaron Durbin9aa031e2012-11-02 09:16:46 -0500761 goto mbp_failure;
Aaron Durbin76c37002012-10-30 09:03:43 -0500762 }
Aaron Durbinbe985242012-12-12 12:40:33 -0600763 mbp = malloc(mbp_hdr.mbp_size * sizeof(u32));
764 if (!mbp)
765 goto mbp_failure;
Aaron Durbin76c37002012-10-30 09:03:43 -0500766
Aaron Durbinbe985242012-12-12 12:40:33 -0600767 mbp->header = mbp_hdr;
Aaron Durbin76c37002012-10-30 09:03:43 -0500768 me2host_pending--;
Aaron Durbin76c37002012-10-30 09:03:43 -0500769
Aaron Durbinbe985242012-12-12 12:40:33 -0600770 i = 0;
771 while (i != me2host_pending) {
Angel Ponsdf2049b2021-11-24 14:39:10 +0100772 mbp->data[i] = read_cb();
Aaron Durbinbe985242012-12-12 12:40:33 -0600773 i++;
Aaron Durbin76c37002012-10-30 09:03:43 -0500774 }
775
Aaron Durbinbe985242012-12-12 12:40:33 -0600776 /* Signal to the ME that the host has finished reading the MBP. */
Aaron Durbin76c37002012-10-30 09:03:43 -0500777 read_host_csr(&host);
778 host.interrupt_generate = 1;
779 write_host_csr(&host);
780
Aaron Durbinbe985242012-12-12 12:40:33 -0600781 /* Dump out the MBP contents. */
Kyösti Mälkkic86fc8e2019-11-06 06:32:27 +0200782 if (CONFIG_DEFAULT_CONSOLE_LOGLEVEL >= BIOS_DEBUG) {
783 printk(BIOS_INFO, "ME MBP: Header: items: %d, size dw: %d\n",
784 mbp->header.num_entries, mbp->header.mbp_size);
785 if (CONFIG(DEBUG_INTEL_ME)) {
786 for (i = 0; i < mbp->header.mbp_size - 1; i++) {
787 printk(BIOS_INFO, "ME MBP: %04x: 0x%08x\n", i, mbp->data[i]);
788 }
789 }
Aaron Durbinbe985242012-12-12 12:40:33 -0600790 }
Aaron Durbinbe985242012-12-12 12:40:33 -0600791
792 #define ASSIGN_FIELD_PTR(field_,val_) \
793 { \
794 mbp_data->field_ = (typeof(mbp_data->field_))(void *)val_; \
795 break; \
796 }
797 /* Setup the pointers in the me_bios_payload structure. */
798 for (i = 0; i < mbp->header.mbp_size - 1;) {
Angel Pons01c9b982021-11-24 11:58:04 +0100799 struct mbp_item_header *item = (void *)&mbp->data[i];
Aaron Durbinbe985242012-12-12 12:40:33 -0600800
Elyes HAOUASf9de5a42018-05-03 17:21:02 +0200801 switch (MBP_MAKE_IDENT(item->app_id, item->item_id)) {
Aaron Durbinbe985242012-12-12 12:40:33 -0600802 case MBP_IDENT(KERNEL, FW_VER):
803 ASSIGN_FIELD_PTR(fw_version_name, &mbp->data[i+1]);
804
805 case MBP_IDENT(ICC, PROFILE):
806 ASSIGN_FIELD_PTR(icc_profile, &mbp->data[i+1]);
807
808 case MBP_IDENT(INTEL_AT, STATE):
809 ASSIGN_FIELD_PTR(at_state, &mbp->data[i+1]);
810
811 case MBP_IDENT(KERNEL, FW_CAP):
812 ASSIGN_FIELD_PTR(fw_capabilities, &mbp->data[i+1]);
813
814 case MBP_IDENT(KERNEL, ROM_BIST):
815 ASSIGN_FIELD_PTR(rom_bist_data, &mbp->data[i+1]);
816
817 case MBP_IDENT(KERNEL, PLAT_KEY):
818 ASSIGN_FIELD_PTR(platform_key, &mbp->data[i+1]);
819
820 case MBP_IDENT(KERNEL, FW_TYPE):
821 ASSIGN_FIELD_PTR(fw_plat_type, &mbp->data[i+1]);
822
823 case MBP_IDENT(KERNEL, MFS_FAILURE):
824 ASSIGN_FIELD_PTR(mfsintegrity, &mbp->data[i+1]);
825
Duncan Laurie144f7b22013-05-01 11:27:58 -0700826 case MBP_IDENT(KERNEL, PLAT_TIME):
827 ASSIGN_FIELD_PTR(plat_time, &mbp->data[i+1]);
828
829 case MBP_IDENT(NFC, SUPPORT_DATA):
830 ASSIGN_FIELD_PTR(nfc_data, &mbp->data[i+1]);
831
Aaron Durbinbe985242012-12-12 12:40:33 -0600832 default:
Duncan Laurie0b3cd362013-08-08 15:40:01 -0700833 printk(BIOS_ERR, "ME MBP: unknown item 0x%x @ "
834 "dw offset 0x%x\n", mbp->data[i], i);
Aaron Durbinbe985242012-12-12 12:40:33 -0600835 break;
836 }
837 i += item->length;
838 }
839 #undef ASSIGN_FIELD_PTR
840
Aaron Durbin76c37002012-10-30 09:03:43 -0500841 return 0;
Aaron Durbin9aa031e2012-11-02 09:16:46 -0500842
843mbp_failure:
844 intel_me_mbp_give_up(dev);
845 return -1;
Aaron Durbin76c37002012-10-30 09:03:43 -0500846}
Angel Pons7f8da792021-02-23 14:27:39 +0100847
848/* Check whether ME is present and do basic init */
849static void intel_me_init(struct device *dev)
850{
851 struct southbridge_intel_lynxpoint_config *config = dev->chip_info;
Angel Pons9f043742021-11-24 12:46:12 +0100852 enum me_bios_path path = intel_me_path(dev);
Angel Pons01c9b982021-11-24 11:58:04 +0100853 struct me_bios_payload mbp_data;
Angel Pons7f8da792021-02-23 14:27:39 +0100854
855 /* Do initial setup and determine the BIOS path */
856 printk(BIOS_NOTICE, "ME: BIOS path: %s\n", me_bios_path_values[path]);
857
858 if (path == ME_NORMAL_BIOS_PATH) {
859 /* Validate the extend register */
860 intel_me_extend_valid(dev);
861 }
862
863 memset(&mbp_data, 0, sizeof(mbp_data));
864
865 /*
866 * According to the ME9 BWG, BIOS is required to fetch MBP data in
867 * all boot flows except S3 Resume.
868 */
869
870 /* Prepare MEI MMIO interface */
871 if (intel_mei_setup(dev) < 0)
872 return;
873
874 if (intel_me_read_mbp(&mbp_data, dev))
875 return;
876
877 if (CONFIG_DEFAULT_CONSOLE_LOGLEVEL >= BIOS_DEBUG) {
878 me_print_fw_version(mbp_data.fw_version_name);
879
880 if (CONFIG(DEBUG_INTEL_ME))
881 me_print_fwcaps(mbp_data.fw_capabilities);
882
883 if (mbp_data.plat_time) {
884 printk(BIOS_DEBUG, "ME: Wake Event to ME Reset: %u ms\n",
885 mbp_data.plat_time->wake_event_mrst_time_ms);
886 printk(BIOS_DEBUG, "ME: ME Reset to Platform Reset: %u ms\n",
887 mbp_data.plat_time->mrst_pltrst_time_ms);
888 printk(BIOS_DEBUG, "ME: Platform Reset to CPU Reset: %u ms\n",
889 mbp_data.plat_time->pltrst_cpurst_time_ms);
890 }
891 }
892
893 /* Set clock enables according to devicetree */
894 if (config && config->icc_clock_disable)
895 me_icc_set_clock_enables(config->icc_clock_disable);
896
897 /*
898 * Leave the ME unlocked. It will be locked later.
899 */
900}
901
902static void intel_me_enable(struct device *dev)
903{
904 /* Avoid talking to the device in S3 path */
905 if (acpi_is_wakeup_s3()) {
906 dev->enabled = 0;
907 pch_disable_devfn(dev);
908 }
909}
910
911static struct device_operations device_ops = {
912 .read_resources = pci_dev_read_resources,
913 .set_resources = pci_dev_set_resources,
914 .enable_resources = pci_dev_enable_resources,
915 .enable = intel_me_enable,
916 .init = intel_me_init,
917 .final = intel_me_finalize,
918 .ops_pci = &pci_dev_ops_pci,
919};
920
921static const unsigned short pci_device_ids[] = {
922 PCI_DEVICE_ID_INTEL_LPT_H_MEI,
923 PCI_DEVICE_ID_INTEL_LPT_LP_MEI,
924 0
925};
926
927static const struct pci_driver intel_me __pci_driver = {
928 .ops = &device_ops,
929 .vendor = PCI_VENDOR_ID_INTEL,
930 .devices = pci_device_ids,
931};