aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/pci-me.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/mei/pci-me.c')
-rw-r--r--drivers/misc/mei/pci-me.c47
1 files changed, 13 insertions, 34 deletions
diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c
index 6cb9819ac5d5..1b46c64a649f 100644
--- a/drivers/misc/mei/pci-me.c
+++ b/drivers/misc/mei/pci-me.c
@@ -72,15 +72,15 @@ static const struct pci_device_id mei_me_pci_tbl[] = {
72 72
73 {MEI_PCI_DEVICE(MEI_DEV_ID_IBXPK_1, mei_me_pch_cfg)}, 73 {MEI_PCI_DEVICE(MEI_DEV_ID_IBXPK_1, mei_me_pch_cfg)},
74 {MEI_PCI_DEVICE(MEI_DEV_ID_IBXPK_2, mei_me_pch_cfg)}, 74 {MEI_PCI_DEVICE(MEI_DEV_ID_IBXPK_2, mei_me_pch_cfg)},
75 {MEI_PCI_DEVICE(MEI_DEV_ID_CPT_1, mei_me_pch_cfg)}, 75 {MEI_PCI_DEVICE(MEI_DEV_ID_CPT_1, mei_me_pch_cpt_pbg_cfg)},
76 {MEI_PCI_DEVICE(MEI_DEV_ID_PBG_1, mei_me_pch_cfg)}, 76 {MEI_PCI_DEVICE(MEI_DEV_ID_PBG_1, mei_me_pch_cpt_pbg_cfg)},
77 {MEI_PCI_DEVICE(MEI_DEV_ID_PPT_1, mei_me_pch_cfg)}, 77 {MEI_PCI_DEVICE(MEI_DEV_ID_PPT_1, mei_me_pch_cfg)},
78 {MEI_PCI_DEVICE(MEI_DEV_ID_PPT_2, mei_me_pch_cfg)}, 78 {MEI_PCI_DEVICE(MEI_DEV_ID_PPT_2, mei_me_pch_cfg)},
79 {MEI_PCI_DEVICE(MEI_DEV_ID_PPT_3, mei_me_pch_cfg)}, 79 {MEI_PCI_DEVICE(MEI_DEV_ID_PPT_3, mei_me_pch_cfg)},
80 {MEI_PCI_DEVICE(MEI_DEV_ID_LPT_H, mei_me_pch_cfg)}, 80 {MEI_PCI_DEVICE(MEI_DEV_ID_LPT_H, mei_me_lpt_cfg)},
81 {MEI_PCI_DEVICE(MEI_DEV_ID_LPT_W, mei_me_pch_cfg)}, 81 {MEI_PCI_DEVICE(MEI_DEV_ID_LPT_W, mei_me_lpt_cfg)},
82 {MEI_PCI_DEVICE(MEI_DEV_ID_LPT_LP, mei_me_pch_cfg)}, 82 {MEI_PCI_DEVICE(MEI_DEV_ID_LPT_LP, mei_me_pch_cfg)},
83 {MEI_PCI_DEVICE(MEI_DEV_ID_LPT_HR, mei_me_pch_cfg)}, 83 {MEI_PCI_DEVICE(MEI_DEV_ID_LPT_HR, mei_me_lpt_cfg)},
84 {MEI_PCI_DEVICE(MEI_DEV_ID_WPT_LP, mei_me_pch_cfg)}, 84 {MEI_PCI_DEVICE(MEI_DEV_ID_WPT_LP, mei_me_pch_cfg)},
85 85
86 /* required last entry */ 86 /* required last entry */
@@ -101,40 +101,21 @@ static inline void mei_me_unset_pm_domain(struct mei_device *dev) {}
101 * mei_quirk_probe - probe for devices that doesn't valid ME interface 101 * mei_quirk_probe - probe for devices that doesn't valid ME interface
102 * 102 *
103 * @pdev: PCI device structure 103 * @pdev: PCI device structure
104 * @ent: entry into pci_device_table 104 * @cfg: per generation config
105 * 105 *
106 * returns true if ME Interface is valid, false otherwise 106 * returns true if ME Interface is valid, false otherwise
107 */ 107 */
108static bool mei_me_quirk_probe(struct pci_dev *pdev, 108static bool mei_me_quirk_probe(struct pci_dev *pdev,
109 const struct pci_device_id *ent) 109 const struct mei_cfg *cfg)
110{ 110{
111 u32 reg; 111 if (cfg->quirk_probe && cfg->quirk_probe(pdev)) {
112 /* Cougar Point || Patsburg */ 112 dev_info(&pdev->dev, "Device doesn't have valid ME Interface\n");
113 if (ent->device == MEI_DEV_ID_CPT_1 || 113 return false;
114 ent->device == MEI_DEV_ID_PBG_1) {
115 pci_read_config_dword(pdev, PCI_CFG_HFS_2, &reg);
116 /* make sure that bit 9 (NM) is up and bit 10 (DM) is down */
117 if ((reg & 0x600) == 0x200)
118 goto no_mei;
119 }
120
121 /* Lynx Point */
122 if (ent->device == MEI_DEV_ID_LPT_H ||
123 ent->device == MEI_DEV_ID_LPT_W ||
124 ent->device == MEI_DEV_ID_LPT_HR) {
125 /* Read ME FW Status check for SPS Firmware */
126 pci_read_config_dword(pdev, PCI_CFG_HFS_1, &reg);
127 /* if bits [19:16] = 15, running SPS Firmware */
128 if ((reg & 0xf0000) == 0xf0000)
129 goto no_mei;
130 } 114 }
131 115
132 return true; 116 return true;
133
134no_mei:
135 dev_info(&pdev->dev, "Device doesn't have valid ME Interface\n");
136 return false;
137} 117}
118
138/** 119/**
139 * mei_probe - Device Initialization Routine 120 * mei_probe - Device Initialization Routine
140 * 121 *
@@ -151,10 +132,8 @@ static int mei_me_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
151 int err; 132 int err;
152 133
153 134
154 if (!mei_me_quirk_probe(pdev, ent)) { 135 if (!mei_me_quirk_probe(pdev, cfg))
155 err = -ENODEV; 136 return -ENODEV;
156 goto end;
157 }
158 137
159 /* enable pci dev */ 138 /* enable pci dev */
160 err = pci_enable_device(pdev); 139 err = pci_enable_device(pdev);