[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 05/17] hw/block/nvme: mark fw slot 1 as read-only
From: |
Klaus Jensen |
Subject: |
[PATCH 05/17] hw/block/nvme: mark fw slot 1 as read-only |
Date: |
Mon, 29 Jun 2020 20:26:30 +0200 |
From: Klaus Jensen <k.jensen@samsung.com>
Mark firmware slot 1 as read-only and only support that slot.
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
---
hw/block/nvme.c | 3 ++-
include/block/nvme.h | 4 ++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 5ca50646369e..f8e91a6965ed 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -62,6 +62,7 @@
#define NVME_TEMPERATURE 0x143
#define NVME_TEMPERATURE_WARNING 0x157
#define NVME_TEMPERATURE_CRITICAL 0x175
+#define NVME_NUM_FW_SLOTS 1
#define NVME_GUEST_ERR(trace, fmt, ...) \
do { \
@@ -1652,7 +1653,7 @@ static void nvme_init_ctrl(NvmeCtrl *n, PCIDevice
*pci_dev)
* inconsequential.
*/
id->acl = 3;
- id->frmw = 7 << 1;
+ id->frmw = (NVME_NUM_FW_SLOTS << 1) | NVME_FRMW_SLOT1_RO;
id->lpa = 1 << 0;
/* recommended default value (~70 C) */
diff --git a/include/block/nvme.h b/include/block/nvme.h
index bb651d0cbf5a..003b15af9cd9 100644
--- a/include/block/nvme.h
+++ b/include/block/nvme.h
@@ -842,6 +842,10 @@ enum NvmeIdCtrlOncs {
NVME_ONCS_TIMESTAMP = 1 << 6,
};
+enum NvmeIdCtrlFrmw {
+ NVME_FRMW_SLOT1_RO = 1 << 0,
+};
+
#define NVME_CTRL_SQES_MIN(sqes) ((sqes) & 0xf)
#define NVME_CTRL_SQES_MAX(sqes) (((sqes) >> 4) & 0xf)
#define NVME_CTRL_CQES_MIN(cqes) ((cqes) & 0xf)
--
2.27.0
- [PATCH 00/17] hw/block/nvme: bump to v1.3, Klaus Jensen, 2020/06/29
- [PATCH 04/17] hw/block/nvme: add temperature threshold feature, Klaus Jensen, 2020/06/29
- [PATCH 03/17] hw/block/nvme: add support for the abort command, Klaus Jensen, 2020/06/29
- [PATCH 02/17] hw/block/nvme: additional tracing, Klaus Jensen, 2020/06/29
- [PATCH 01/17] hw/block/nvme: bump spec data structures to v1.3, Klaus Jensen, 2020/06/29
- [PATCH 05/17] hw/block/nvme: mark fw slot 1 as read-only,
Klaus Jensen <=
- [PATCH 06/17] hw/block/nvme: add support for the get log page command, Klaus Jensen, 2020/06/29
- [PATCH 07/17] hw/block/nvme: add support for the asynchronous event request command, Klaus Jensen, 2020/06/29
- [PATCH 10/17] hw/block/nvme: fix missing endian conversion, Klaus Jensen, 2020/06/29
- [PATCH 08/17] hw/block/nvme: move NvmeFeatureVal into hw/block/nvme.h, Klaus Jensen, 2020/06/29
- [PATCH 09/17] hw/block/nvme: flush write cache when disabled, Klaus Jensen, 2020/06/29
- [PATCH 11/17] hw/block/nvme: add remaining mandatory controller parameters, Klaus Jensen, 2020/06/29
- [PATCH 14/17] hw/block/nvme: support identify namespace descriptor list, Klaus Jensen, 2020/06/29
- [PATCH 15/17] hw/block/nvme: enforce valid queue creation sequence, Klaus Jensen, 2020/06/29
- [PATCH 16/17] hw/block/nvme: provide the mandatory subnqn field, Klaus Jensen, 2020/06/29
- [PATCH 17/17] hw/block/nvme: bump supported version to v1.3, Klaus Jensen, 2020/06/29