#ifndef _MEI_HW_MEI_REGS_H_
#define _MEI_HW_MEI_REGS_H_
+#include <linux/bits.h>
+
/*
* MEI device IDs
*/
# define PCI_CFG_HFS_2_PM_CM_RESET_ERROR 0x5000000 /* CME reset due to exception */
# define PCI_CFG_HFS_2_PM_EVENT_MASK 0xf000000
#define PCI_CFG_HFS_3 0x60
+# define PCI_CFG_HFS_3_EXT_SKU_MSK GENMASK(3, 0) /* IOE detection bits */
+# define PCI_CFG_HFS_3_EXT_SKU_IOE 0x00000001
# define PCI_CFG_HFS_3_FW_SKU_MSK 0x00000070
# define PCI_CFG_HFS_3_FW_SKU_IGN 0x00000000
# define PCI_CFG_HFS_3_FW_SKU_SPS 0x00000060
* Intel Management Engine Interface (Intel MEI) Linux driver
*/
-#include <linux/pci.h>
-
-#include <linux/kthread.h>
+#include <linux/bitfield.h>
+#include <linux/delay.h>
#include <linux/interrupt.h>
+#include <linux/kthread.h>
+#include <linux/pci.h>
#include <linux/pm_runtime.h>
#include <linux/sizes.h>
-#include <linux/delay.h>
#include "mei_dev.h"
#include "hbm.h"
#define MEI_CFG_KIND_GSCFI \
.get_kind = mei_cfg_kind_gscfi
+static enum mei_dev_kind mei_cfg_kind_ioe(const struct device *parent)
+{
+ const struct pci_dev *pdev = to_pci_dev(parent);
+ unsigned int devfn;
+ u32 reg;
+ int ret;
+
+ devfn = PCI_DEVFN(PCI_SLOT(pdev->devfn), 0);
+ ret = pci_bus_read_config_dword(pdev->bus, devfn, PCI_CFG_HFS_3, ®);
+ trace_mei_pci_cfg_read(parent, "PCI_CFG_HFS_3", PCI_CFG_HFS_3, reg, ret);
+ return FIELD_GET(PCI_CFG_HFS_3_EXT_SKU_MSK, reg) == PCI_CFG_HFS_3_EXT_SKU_IOE ?
+ MEI_DEV_KIND_IOE : MEI_DEV_KIND_MEI;
+}
+
+#define MEI_CFG_KIND_IOE \
+ .get_kind = mei_cfg_kind_ioe
+
#define MEI_CFG_FW_VER_SUPP \
.fw_ver_supported = 1
MEI_CFG_FW_VER_SUPP,
};
+/* Nova Lake with possible IOE devices */
+static const struct mei_cfg mei_me_pch22_ioe_cfg = {
+ MEI_CFG_KIND_IOE,
+ MEI_CFG_PCH8_HFS,
+ MEI_CFG_FW_VER_SUPP,
+ MEI_CFG_DMA_128,
+ MEI_CFG_TRC,
+};
+
/*
* mei_cfg_list - A list of platform platform specific configurations.
* Note: has to be synchronized with enum mei_cfg_idx.
[MEI_ME_GSC_CFG] = &mei_me_gsc_cfg,
[MEI_ME_GSCFI_CFG] = &mei_me_gscfi_cfg,
[MEI_ME_CSC_CFG] = &mei_me_csc_cfg,
+ [MEI_ME_PCH22_IOE_CFG] = &mei_me_pch22_ioe_cfg,
};
const struct mei_cfg *mei_me_get_cfg(kernel_ulong_t idx)
{PCI_DEVICE_DATA(INTEL, MEI_WCL_P, MEI_ME_PCH15_CFG)},
- {PCI_DEVICE_DATA(INTEL, MEI_NVL_S, MEI_ME_PCH15_CFG)},
+ {PCI_DEVICE_DATA(INTEL, MEI_NVL_S, MEI_ME_PCH22_IOE_CFG)},
{PCI_DEVICE_DATA(INTEL, MEI_NVL_H, MEI_ME_PCH15_CFG)},
/* required last entry */