clear-pkgs-linux-iot-lts2018/0139-mei-restrict-vm-tag-su...

88 lines
3.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Alexander Usyskin <alexander.usyskin@intel.com>
Date: Sun, 6 May 2018 15:36:13 +0300
Subject: [PATCH] mei: restrict vm tag support to hbm version 2.2
Only a firmware with version 2.2 and above supports vm tag feature.
Change-Id: Ic1fbe9826a7cd02662e55786518a9a83e1f830cb
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
drivers/misc/mei/debugfs.c | 2 ++
drivers/misc/mei/hbm.c | 6 ++++++
drivers/misc/mei/hw.h | 6 ++++++
drivers/misc/mei/mei_dev.h | 2 ++
4 files changed, 16 insertions(+)
diff --git a/drivers/misc/mei/debugfs.c b/drivers/misc/mei/debugfs.c
index 7b5df8fd6c5a..e3beb2a93f71 100644
--- a/drivers/misc/mei/debugfs.c
+++ b/drivers/misc/mei/debugfs.c
@@ -185,6 +185,8 @@ static ssize_t mei_dbgfs_read_devstate(struct file *fp, char __user *ubuf,
dev->hbm_f_os_supported);
pos += scnprintf(buf + pos, bufsz - pos, "\tDR: %01d\n",
dev->hbm_f_dr_supported);
+ pos += scnprintf(buf + pos, bufsz - pos, "\tVM: %01d\n",
+ dev->hbm_f_vm_supported);
}
pos += scnprintf(buf + pos, bufsz - pos, "pg: %s, %s\n",
diff --git a/drivers/misc/mei/hbm.c b/drivers/misc/mei/hbm.c
index 13922e43f406..364f848be180 100644
--- a/drivers/misc/mei/hbm.c
+++ b/drivers/misc/mei/hbm.c
@@ -1064,6 +1064,12 @@ static void mei_hbm_config_features(struct mei_device *dev)
(dev->version.major_version == HBM_MAJOR_VERSION_DR &&
dev->version.minor_version >= HBM_MINOR_VERSION_DR))
dev->hbm_f_dr_supported = 1;
+
+ /* VM Tag Support */
+ if (dev->version.major_version > HBM_MAJOR_VERSION_VM ||
+ (dev->version.major_version == HBM_MAJOR_VERSION_VM &&
+ dev->version.minor_version >= HBM_MINOR_VERSION_VM))
+ dev->hbm_f_vm_supported = 1;
}
/**
diff --git a/drivers/misc/mei/hw.h b/drivers/misc/mei/hw.h
index b7d2487b8409..69a59e3cda17 100644
--- a/drivers/misc/mei/hw.h
+++ b/drivers/misc/mei/hw.h
@@ -86,6 +86,12 @@
#define HBM_MINOR_VERSION_DR 1
#define HBM_MAJOR_VERSION_DR 2
+/*
+ * MEI version with vm tag support
+ */
+#define HBM_MINOR_VERSION_VM 2
+#define HBM_MAJOR_VERSION_VM 2
+
/* Host bus message command opcode */
#define MEI_HBM_CMD_OP_MSK 0x7f
/* Host bus message command RESPONSE */
diff --git a/drivers/misc/mei/mei_dev.h b/drivers/misc/mei/mei_dev.h
index 6552b41e47a1..f5110d9900f9 100644
--- a/drivers/misc/mei/mei_dev.h
+++ b/drivers/misc/mei/mei_dev.h
@@ -433,6 +433,7 @@ struct mei_fw_version {
* @hbm_f_ie_supported : hbm feature immediate reply to enum request
* @hbm_f_os_supported : hbm feature support OS ver message
* @hbm_f_dr_supported : hbm feature dma ring supported
+ * @hbm_f_vm_supported : hbm feature vm tag supported
*
* @fw_ver : FW versions
*
@@ -515,6 +516,7 @@ struct mei_device {
unsigned int hbm_f_ie_supported:1;
unsigned int hbm_f_os_supported:1;
unsigned int hbm_f_dr_supported:1;
+ unsigned int hbm_f_vm_supported:1;
struct mei_fw_version fw_ver[MEI_MAX_FW_VER_BLOCKS];
--
https://clearlinux.org