mei: me: disable mei interface on Mehlow server platforms
Subsystems (3)
PATCH 1/7 mei: me: disable mei interface on Mehlow server platforms
For SPS firmware versions 5.0 and newer the way detection has changed. The detection is done now via PCI_CFG_HFS_3 register.
To prevent conflict the previous method will get sps_4 suffix Disable both CNP_H and CNP_H_3 interfaces. CNP_H_3 requires a separate configuration as it doesn't support DMA.
--- drivers/misc/mei/hw-me-regs.h | 2 ++ drivers/misc/mei/hw-me.c | 60 +++++++++++++++++++++++++++++++---- drivers/misc/mei/hw-me.h | 13 +++++--- drivers/misc/mei/pci-me.c | 16 +++++----- 4 files changed, 73 insertions(+), 18 deletions(-)
drivers/misc/mei/hw-me-regs.h +2 -0
@@ -107,6 +107,8 @@# define PCI_CFG_HFS_1_D0I3_MSK 0x80000000#define PCI_CFG_HFS_2 0x48#define PCI_CFG_HFS_3 0x60 +# define PCI_CFG_HFS_3_FW_SKU_MSK 0x00000070 +# define PCI_CFG_HFS_3_FW_SKU_SPS 0x00000060#define PCI_CFG_HFS_4 0x64#define PCI_CFG_HFS_5 0x68#define PCI_CFG_HFS_6 0x6C
drivers/misc/mei/hw-me.c +54 -6
95 lines not on this page · raw message
drivers/misc/mei/hw-me.h +9 -4
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 */ /* -* Copyright (c) 2012-2019, Intel Corporation. All rights reserved. +* Copyright (c) 2012-2020, Intel Corporation. All rights reserved. * Intel Management Engine Interface (Intel MEI) Linux driver */
@@ -76,11 +76,14 @@ struct mei_me_hw {* with quirk for Node Manager exclusion. * @MEI_ME_PCH8_CFG: Platform Controller Hub Gen8 and newer * client platforms. -* @MEI_ME_PCH8_SPS_CFG: Platform Controller Hub Gen8 and newer +* @MEI_ME_PCH8_SPS_4_CFG: Platform Controller Hub Gen8 and newer * servers platforms with quirk for * SPS firmware exclusion. * @MEI_ME_PCH12_CFG: Platform Controller Hub Gen12 and newer -* @MEI_ME_PCH12_SPS_CFG: Platform Controller Hub Gen12 and newer +* @MEI_ME_PCH12_SPS_4_CFG:Platform Controller Hub Gen12 up to 4.0 +* servers platforms with quirk for +* SPS firmware exclusion. +* @MEI_ME_PCH12_SPS_CFG: Platform Controller Hub Gen12 5.0 and newer * servers platforms with quirk for * SPS firmware exclusion. * @MEI_ME_PCH15_CFG: Platform Controller Hub Gen15 and newer
@@ -94,9 +97,11 @@ enum mei_cfg_idx {MEI_ME_PCH7_CFG ,MEI_ME_PCH_CPT_PBG_CFG ,MEI_ME_PCH8_CFG , -MEI_ME_PCH8_SPS_CFG , +MEI_ME_PCH8_SPS_4_CFG ,MEI_ME_PCH12_CFG , +MEI_ME_PCH12_SPS_4_CFG ,MEI_ME_PCH12_SPS_CFG , +MEI_ME_PCH12_SPS_NODMA_CFG ,MEI_ME_PCH15_CFG , MEI_ME_NUM_CFG, };
drivers/misc/mei/pci-me.c +8 -8
@@ -59,18 +59,18 @@ static const struct pci_device_id mei_me_pci_tbl[] = { {MEI_PCI_DEVICE(MEI_DEV_ID_PPT_1, MEI_ME_PCH7_CFG)}, {MEI_PCI_DEVICE(MEI_DEV_ID_PPT_2, MEI_ME_PCH7_CFG)}, {MEI_PCI_DEVICE(MEI_DEV_ID_PPT_3, MEI_ME_PCH7_CFG)}, - {MEI_PCI_DEVICE(MEI_DEV_ID_LPT_H, MEI_ME_PCH8_SPS_CFG)}, - {MEI_PCI_DEVICE(MEI_DEV_ID_LPT_W, MEI_ME_PCH8_SPS_CFG)}, + {MEI_PCI_DEVICE(MEI_DEV_ID_LPT_H, MEI_ME_PCH8_SPS_4_CFG)}, + {MEI_PCI_DEVICE(MEI_DEV_ID_LPT_W, MEI_ME_PCH8_SPS_4_CFG)}, {MEI_PCI_DEVICE(MEI_DEV_ID_LPT_LP, MEI_ME_PCH8_CFG)}, - {MEI_PCI_DEVICE(MEI_DEV_ID_LPT_HR, MEI_ME_PCH8_SPS_CFG)}, + {MEI_PCI_DEVICE(MEI_DEV_ID_LPT_HR, MEI_ME_PCH8_SPS_4_CFG)}, {MEI_PCI_DEVICE(MEI_DEV_ID_WPT_LP, MEI_ME_PCH8_CFG)}, {MEI_PCI_DEVICE(MEI_DEV_ID_WPT_LP_2, MEI_ME_PCH8_CFG)}, {MEI_PCI_DEVICE(MEI_DEV_ID_SPT, MEI_ME_PCH8_CFG)}, {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_2, MEI_ME_PCH8_CFG)}, - {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_H, MEI_ME_PCH8_SPS_CFG)}, - {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_H_2, MEI_ME_PCH8_SPS_CFG)}, - {MEI_PCI_DEVICE(MEI_DEV_ID_LBG, MEI_ME_PCH12_SPS_CFG)}, + {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_H, MEI_ME_PCH8_SPS_4_CFG)}, + {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_H_2, MEI_ME_PCH8_SPS_4_CFG)}, + {MEI_PCI_DEVICE(MEI_DEV_ID_LBG, MEI_ME_PCH12_SPS_4_CFG)}, {MEI_PCI_DEVICE(MEI_DEV_ID_BXT_M, MEI_ME_PCH8_CFG)}, {MEI_PCI_DEVICE(MEI_DEV_ID_APL_I, MEI_ME_PCH8_CFG)},
@@ -84,8 +84,8 @@ static const struct pci_device_id mei_me_pci_tbl[] = { {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_LP, MEI_ME_PCH12_CFG)}, {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_LP_3, MEI_ME_PCH8_CFG)}, - {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_H, MEI_ME_PCH12_CFG)}, - {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_H_3, MEI_ME_PCH8_CFG)}, + {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_H, MEI_ME_PCH12_SPS_CFG)}, + {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_H_3, MEI_ME_PCH12_SPS_NODMA_CFG)}, {MEI_PCI_DEVICE(MEI_DEV_ID_CMP_LP, MEI_ME_PCH12_CFG)}, {MEI_PCI_DEVICE(MEI_DEV_ID_CMP_LP_3, MEI_ME_PCH8_CFG)},
Signature · 1 line
2.25.4
PATCH 2/7 mei: me: constify the device parameter to the probe quirk
The quirk_probe there is no writing to pci device hence we can constify the passed pci_dev pointer.
--- drivers/misc/mei/hw-me.c | 6 +++--- drivers/misc/mei/hw-me.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/misc/mei/hw-me.c +3 -3
@@ -1353,7 +1353,7 @@ static const struct mei_hw_ops mei_me_hw_ops = { .read = mei_me_read_slots }; -static bool mei_me_fw_type_nm (struct pci_dev *pdev) +static bool mei_me_fw_type_nm (const struct pci_dev *pdev) {u32 reg;
@@ -1366,7 +1366,7 @@ static bool mei_me_fw_type_nm(struct pci_dev *pdev)#define MEI_CFG_FW_NM \ .quirk_probe = mei_me_fw_type_nm -static bool mei_me_fw_type_sps_4 (struct pci_dev *pdev) +static bool mei_me_fw_type_sps_4 (const struct pci_dev *pdev) {u32 reg;unsigned int devfn;
@@ -1395,7 +1395,7 @@ static bool mei_me_fw_type_sps_4(struct pci_dev *pdev)* * Return: true in case of SPS firmware */ -static bool mei_me_fw_type_sps (struct pci_dev *pdev) +static bool mei_me_fw_type_sps (const struct pci_dev *pdev) {u32 reg;u32 fw_type;
drivers/misc/mei/hw-me.h +1 -1
@@ -25,7 +25,7 @@*/ struct mei_cfg {const struct mei_fw_status fw_status; -bool (*quirk_probe)(struct pci_dev *pdev); +bool (*quirk_probe)(const struct pci_dev *pdev);size_t dma_size[DMA_DSCR_NUM ];u32 fw_ver_supported:1 ;u32 hw_trc_supported:1 ;
Signature · 1 line
2.25.4
PATCH 3/7 mei: me: make mei_me_fw_sku_sps_4() less cryptic
In reply to Tomas WinklerLast add mei_me_fw_sku_sps_4() kdoc and add descriptive defines for register name and values.
--- drivers/misc/mei/hw-me-regs.h | 2 ++ drivers/misc/mei/hw-me.c | 18 ++++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-)
drivers/misc/mei/hw-me-regs.h +2 -0
@@ -105,6 +105,8 @@/* Host Firmware Status Registers in PCI Config Space */ #define PCI_CFG_HFS_1 0x40# define PCI_CFG_HFS_1_D0I3_MSK 0x80000000 +# define PCI_CFG_HFS_1_OPMODE_MSK 0xf0000/* OP MODE Mask: SPS <= 4.0 */ +# define PCI_CFG_HFS_1_OPMODE_SPS 0xf0000/* SPS SKU : SPS <= 4.0 */ #define PCI_CFG_HFS_2 0x48#define PCI_CFG_HFS_3 0x60# define PCI_CFG_HFS_3_FW_SKU_MSK 0x00000070
drivers/misc/mei/hw-me.c +12 -6
@@ -1366,20 +1366,26 @@ static bool mei_me_fw_type_nm(const struct pci_dev *pdev)#define MEI_CFG_FW_NM \ .quirk_probe = mei_me_fw_type_nm +/** +* mei_me_fw_sku_sps_4() - check for sps 4.0 sku +* +* Read ME FW Status register to check for SPS Firmware. +* The SPS FW is only signaled in the PCI function 0. +* __Note__: Deprecated by SPS 5.0 and newer. +* +* @pdev: pci device +* +* Return: true in case of SPS firmware +*/ static bool mei_me_fw_type_sps_4 (const struct pci_dev *pdev) {u32 reg;unsigned int devfn; -/* -* Read ME FW Status register to check for SPS Firmware -* The SPS FW is only signaled in pci function 0 -*/ devfn =PCI_DEVFN (PCI_SLOT (pdev->devfn),0 );pci_bus_read_config_dword (pdev->bus, devfn,PCI_CFG_HFS_1 , ®);trace_mei_pci_cfg_read (&pdev->dev,"PCI_CFG_HFS_1" ,PCI_CFG_HFS_1 , reg); -/* if bits [19:16] = 15, running SPS Firmware */ -return (reg &0xf0000 ) ==0xf0000 ; +return (reg &PCI_CFG_HFS_1_OPMODE_MSK ) ==PCI_CFG_HFS_1_OPMODE_SPS ; }#define MEI_CFG_FW_SPS_4 \
Signature · 1 line
2.25.4
PATCH 4/7 mei: me: add kdoc for mei_me_fw_type_nm()
In reply to Tomas WinklerAdd kdoc for mei_me_fw_type_nm() function.
--- drivers/misc/mei/hw-me.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
drivers/misc/mei/hw-me.c +14 -1
@@ -1353,11 +1353,24 @@ static const struct mei_hw_ops mei_me_hw_ops = { .read = mei_me_read_slots }; +/** +* mei_me_fw_type_nm() - check for nm sku +* +* Read ME FW Status register to check for the Node Manager (NM) Firmware. +* The NM FW is only signaled in PCI function 0. +* __Note__: Deprecated by PCH8 and newer. +* +* @pdev: pci device +* +* Return: true in case of NM firmware +*/ static bool mei_me_fw_type_nm (const struct pci_dev *pdev) {u32 reg; +unsigned int devfn; -pci_read_config_dword (pdev,PCI_CFG_HFS_2 , ®); + devfn =PCI_DEVFN (PCI_SLOT (pdev->devfn),0 ); +pci_bus_read_config_dword (pdev->bus, devfn,PCI_CFG_HFS_2 , ®);trace_mei_pci_cfg_read (&pdev->dev,"PCI_CFG_HFS_2" ,PCI_CFG_HFS_2 , reg);/* make sure that bit 9 (NM) is up and bit 10 (DM) is down */ return (reg &0x600 ) ==0x200 ;
Signature · 1 line
2.25.4
PATCH 5/7 mei: me: add MEI device for SPT with ITPS capability
In reply to Tomas WinklerAdd device ID for Intel Sunrise Point PCH (Skylake) which has Intel Precise Touch & Stylus IPTS (iTouch).
--- drivers/misc/mei/hw-me-regs.h | 1 + drivers/misc/mei/pci-me.c | 1 + 2 files changed, 2 insertions(+)
drivers/misc/mei/hw-me-regs.h +1 -0
@@ -59,6 +59,7 @@#define MEI_DEV_ID_SPT 0x9D3A/* Sunrise Point */ #define MEI_DEV_ID_SPT_2 0x9D3B/* Sunrise Point 2 */ +#define MEI_DEV_ID_SPT_3 0x9D3E/* Sunrise Point 3 (iToutch) */ #define MEI_DEV_ID_SPT_H 0xA13A/* Sunrise Point H */ #define MEI_DEV_ID_SPT_H_2 0xA13B/* Sunrise Point H 2 */
drivers/misc/mei/pci-me.c +1 -0
@@ -68,6 +68,7 @@ static const struct pci_device_id mei_me_pci_tbl[] = { {MEI_PCI_DEVICE(MEI_DEV_ID_SPT, MEI_ME_PCH8_CFG)}, {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_2, MEI_ME_PCH8_CFG)}, + {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_3, MEI_ME_PCH8_CFG)}, {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_H, MEI_ME_PCH8_SPS_4_CFG)}, {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_H_2, MEI_ME_PCH8_SPS_4_CFG)}, {MEI_PCI_DEVICE(MEI_DEV_ID_LBG, MEI_ME_PCH12_SPS_4_CFG)},
Signature · 1 line
2.25.4
PATCH 6/7 mei: me: add MEI device for KBP with ITPS capability
In reply to Tomas WinklerAdd device ID for Intel Kaby Point PCH (Kabylake) which has Intel Precise Touch & Stylus IPTS (iTouch).
--- drivers/misc/mei/hw-me-regs.h | 1 + drivers/misc/mei/pci-me.c | 1 + 2 files changed, 2 insertions(+)
drivers/misc/mei/hw-me-regs.h +1 -0
@@ -74,6 +74,7 @@#define MEI_DEV_ID_KBP 0xA2BA/* Kaby Point */ #define MEI_DEV_ID_KBP_2 0xA2BB/* Kaby Point 2 */ +#define MEI_DEV_ID_KBP_3 0xA2BE/* Kaby Point 3 (iTouch) */ #define MEI_DEV_ID_CNP_LP 0x9DE0/* Cannon Point LP */ #define MEI_DEV_ID_CNP_LP_3 0x9DE4/* Cannon Point LP 3 (iTouch) */
drivers/misc/mei/pci-me.c +1 -0
@@ -82,6 +82,7 @@ static const struct pci_device_id mei_me_pci_tbl[] = { {MEI_PCI_DEVICE(MEI_DEV_ID_KBP, MEI_ME_PCH8_CFG)}, {MEI_PCI_DEVICE(MEI_DEV_ID_KBP_2, MEI_ME_PCH8_CFG)}, + {MEI_PCI_DEVICE(MEI_DEV_ID_KBP_3, MEI_ME_PCH8_CFG)}, {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_LP, MEI_ME_PCH12_CFG)}, {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_LP_3, MEI_ME_PCH8_CFG)},
Signature · 1 line
2.25.4
PATCH 7/7 mei: me: add tiger lake point device ids for H platforms.
In reply to Tomas WinklerFrom: Alexander Usyskin <[email protected]>
Add Tiger Lake device ids H for HECI1.TGH_H is also used in Tatlow SPS platform we need to disable the mei interface there.
--- drivers/misc/mei/hw-me-regs.h | 1 + drivers/misc/mei/hw-me.c | 10 ++++++++++ drivers/misc/mei/hw-me.h | 4 ++++ drivers/misc/mei/pci-me.c | 1 + 4 files changed, 16 insertions(+)
drivers/misc/mei/hw-me-regs.h +1 -0
@@ -96,6 +96,7 @@#define MEI_DEV_ID_JSP_N 0x4DE0/* Jasper Lake Point N */ #define MEI_DEV_ID_TGP_LP 0xA0E0/* Tiger Lake Point LP */ +#define MEI_DEV_ID_TGP_H 0x43E0/* Tiger Lake Point H */ #define MEI_DEV_ID_MCC 0x4B70/* Mule Creek Canyon (EHL) */ #define MEI_DEV_ID_MCC_4 0x4B75/* Mule Creek Canyon 4 (EHL) */
drivers/misc/mei/hw-me.c +10 -0
@@ -1545,6 +1545,15 @@ static const struct mei_cfg mei_me_pch15_cfg = { MEI_CFG_TRC, }; +/* Tiger Lake with quirk for SPS 5.0 and newer Firmware exclusion */ +static const struct mei_cfg mei_me_pch15_sps_cfg = { +MEI_CFG_PCH8_HFS , +MEI_CFG_FW_VER_SUPP , +MEI_CFG_DMA_128 , +MEI_CFG_TRC , +MEI_CFG_FW_SPS , +}; +/* * mei_cfg_list - A list of platform platform specific configurations. * Note: has to be synchronized with enum mei_cfg_idx.
@@ -1563,6 +1572,7 @@ static const struct mei_cfg *const mei_cfg_list[] = { [MEI_ME_PCH12_SPS_CFG] = &mei_me_pch12_sps_cfg, [MEI_ME_PCH12_SPS_NODMA_CFG] = &mei_me_pch12_nodma_sps_cfg, [MEI_ME_PCH15_CFG] = &mei_me_pch15_cfg, + [MEI_ME_PCH15_SPS_CFG] = &mei_me_pch15_sps_cfg, };const struct mei_cfg *mei_me_get_cfg (kernel_ulong_t idx)
drivers/misc/mei/hw-me.h +4 -0
@@ -87,6 +87,9 @@ struct mei_me_hw {* servers platforms with quirk for * SPS firmware exclusion. * @MEI_ME_PCH15_CFG: Platform Controller Hub Gen15 and newer +* @MEI_ME_PCH15_SPS_CFG: Platform Controller Hub Gen15 and newer +* servers platforms with quirk for +* SPS firmware exclusion. * @MEI_ME_NUM_CFG: Upper Sentinel. */ enum mei_cfg_idx {
@@ -103,6 +106,7 @@ enum mei_cfg_idx {MEI_ME_PCH12_SPS_CFG ,MEI_ME_PCH12_SPS_NODMA_CFG ,MEI_ME_PCH15_CFG , +MEI_ME_PCH15_SPS_CFG , MEI_ME_NUM_CFG, };
drivers/misc/mei/pci-me.c +1 -0
@@ -98,6 +98,7 @@ static const struct pci_device_id mei_me_pci_tbl[] = { {MEI_PCI_DEVICE(MEI_DEV_ID_ICP_LP, MEI_ME_PCH12_CFG)}, {MEI_PCI_DEVICE(MEI_DEV_ID_TGP_LP, MEI_ME_PCH15_CFG)}, + {MEI_PCI_DEVICE(MEI_DEV_ID_TGP_H, MEI_ME_PCH15_SPS_CFG)}, {MEI_PCI_DEVICE(MEI_DEV_ID_JSP_N, MEI_ME_PCH15_CFG)},
Signature · 1 line
2.25.4