| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | | - * |
|---|
| 3 | + * Copyright (c) 2012-2020, Intel Corporation. All rights reserved. |
|---|
| 3 | 4 | * Intel Management Engine Interface (Intel MEI) Linux driver |
|---|
| 4 | | - * Copyright (c) 2003-2012, Intel Corporation. |
|---|
| 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 | 5 | */ |
|---|
| 16 | | - |
|---|
| 17 | | - |
|---|
| 18 | 6 | |
|---|
| 19 | 7 | #ifndef _MEI_INTERFACE_H_ |
|---|
| 20 | 8 | #define _MEI_INTERFACE_H_ |
|---|
| .. | .. |
|---|
| 31 | 19 | * |
|---|
| 32 | 20 | * @fw_status: FW status |
|---|
| 33 | 21 | * @quirk_probe: device exclusion quirk |
|---|
| 22 | + * @kind: MEI head kind |
|---|
| 34 | 23 | * @dma_size: device DMA buffers size |
|---|
| 35 | 24 | * @fw_ver_supported: is fw version retrievable from FW |
|---|
| 25 | + * @hw_trc_supported: does the hw support trc register |
|---|
| 36 | 26 | */ |
|---|
| 37 | 27 | struct mei_cfg { |
|---|
| 38 | 28 | const struct mei_fw_status fw_status; |
|---|
| 39 | | - bool (*quirk_probe)(struct pci_dev *pdev); |
|---|
| 29 | + bool (*quirk_probe)(const struct pci_dev *pdev); |
|---|
| 30 | + const char *kind; |
|---|
| 40 | 31 | size_t dma_size[DMA_DSCR_NUM]; |
|---|
| 41 | 32 | u32 fw_ver_supported:1; |
|---|
| 33 | + u32 hw_trc_supported:1; |
|---|
| 42 | 34 | }; |
|---|
| 43 | 35 | |
|---|
| 44 | 36 | |
|---|
| .. | .. |
|---|
| 54 | 46 | * |
|---|
| 55 | 47 | * @cfg: per device generation config and ops |
|---|
| 56 | 48 | * @mem_addr: io memory address |
|---|
| 49 | + * @irq: irq number |
|---|
| 57 | 50 | * @pg_state: power gating state |
|---|
| 58 | 51 | * @d0i3_supported: di03 support |
|---|
| 59 | 52 | * @hbuf_depth: depth of hardware host/write buffer in slots |
|---|
| 53 | + * @read_fws: read FW status register handler |
|---|
| 60 | 54 | */ |
|---|
| 61 | 55 | struct mei_me_hw { |
|---|
| 62 | 56 | const struct mei_cfg *cfg; |
|---|
| 63 | 57 | void __iomem *mem_addr; |
|---|
| 58 | + int irq; |
|---|
| 64 | 59 | enum mei_pg_state pg_state; |
|---|
| 65 | 60 | bool d0i3_supported; |
|---|
| 66 | 61 | u8 hbuf_depth; |
|---|
| 62 | + int (*read_fws)(const struct mei_device *dev, int where, u32 *val); |
|---|
| 67 | 63 | }; |
|---|
| 68 | 64 | |
|---|
| 69 | 65 | #define to_me_hw(dev) (struct mei_me_hw *)((dev)->hw) |
|---|
| .. | .. |
|---|
| 82 | 78 | * with quirk for Node Manager exclusion. |
|---|
| 83 | 79 | * @MEI_ME_PCH8_CFG: Platform Controller Hub Gen8 and newer |
|---|
| 84 | 80 | * client platforms. |
|---|
| 85 | | - * @MEI_ME_PCH8_SPS_CFG: Platform Controller Hub Gen8 and newer |
|---|
| 81 | + * @MEI_ME_PCH8_ITOUCH_CFG:Platform Controller Hub Gen8 and newer |
|---|
| 82 | + * client platforms (iTouch). |
|---|
| 83 | + * @MEI_ME_PCH8_SPS_4_CFG: Platform Controller Hub Gen8 and newer |
|---|
| 86 | 84 | * servers platforms with quirk for |
|---|
| 87 | 85 | * SPS firmware exclusion. |
|---|
| 88 | 86 | * @MEI_ME_PCH12_CFG: Platform Controller Hub Gen12 and newer |
|---|
| 87 | + * @MEI_ME_PCH12_SPS_4_CFG:Platform Controller Hub Gen12 up to 4.0 |
|---|
| 88 | + * servers platforms with quirk for |
|---|
| 89 | + * SPS firmware exclusion. |
|---|
| 90 | + * @MEI_ME_PCH12_SPS_CFG: Platform Controller Hub Gen12 5.0 and newer |
|---|
| 91 | + * servers platforms with quirk for |
|---|
| 92 | + * SPS firmware exclusion. |
|---|
| 93 | + * @MEI_ME_PCH15_CFG: Platform Controller Hub Gen15 and newer |
|---|
| 94 | + * @MEI_ME_PCH15_SPS_CFG: Platform Controller Hub Gen15 and newer |
|---|
| 95 | + * servers platforms with quirk for |
|---|
| 96 | + * SPS firmware exclusion. |
|---|
| 89 | 97 | * @MEI_ME_NUM_CFG: Upper Sentinel. |
|---|
| 90 | 98 | */ |
|---|
| 91 | 99 | enum mei_cfg_idx { |
|---|
| .. | .. |
|---|
| 96 | 104 | MEI_ME_PCH7_CFG, |
|---|
| 97 | 105 | MEI_ME_PCH_CPT_PBG_CFG, |
|---|
| 98 | 106 | MEI_ME_PCH8_CFG, |
|---|
| 99 | | - MEI_ME_PCH8_SPS_CFG, |
|---|
| 107 | + MEI_ME_PCH8_ITOUCH_CFG, |
|---|
| 108 | + MEI_ME_PCH8_SPS_4_CFG, |
|---|
| 100 | 109 | MEI_ME_PCH12_CFG, |
|---|
| 110 | + MEI_ME_PCH12_SPS_4_CFG, |
|---|
| 111 | + MEI_ME_PCH12_SPS_CFG, |
|---|
| 112 | + MEI_ME_PCH12_SPS_ITOUCH_CFG, |
|---|
| 113 | + MEI_ME_PCH15_CFG, |
|---|
| 114 | + MEI_ME_PCH15_SPS_CFG, |
|---|
| 101 | 115 | MEI_ME_NUM_CFG, |
|---|
| 102 | 116 | }; |
|---|
| 103 | 117 | |
|---|
| 104 | 118 | const struct mei_cfg *mei_me_get_cfg(kernel_ulong_t idx); |
|---|
| 105 | 119 | |
|---|
| 106 | | -struct mei_device *mei_me_dev_init(struct pci_dev *pdev, |
|---|
| 120 | +struct mei_device *mei_me_dev_init(struct device *parent, |
|---|
| 107 | 121 | const struct mei_cfg *cfg); |
|---|
| 108 | 122 | |
|---|
| 109 | 123 | int mei_me_pg_enter_sync(struct mei_device *dev); |
|---|