Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Jul 2020 00:35:42 +0000 (UTC)
From:      Chuck Tuffli <chuck@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r363355 - stable/12/usr.sbin/bhyve
Message-ID:  <202007200035.06K0ZgTa002148@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: chuck
Date: Mon Jul 20 00:35:42 2020
New Revision: 363355
URL: https://svnweb.freebsd.org/changeset/base/363355

Log:
  MFC r362762 bhyve: add basic NVMe Firmware Commit support

Modified:
  stable/12/usr.sbin/bhyve/pci_nvme.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.sbin/bhyve/pci_nvme.c
==============================================================================
--- stable/12/usr.sbin/bhyve/pci_nvme.c	Mon Jul 20 00:33:16 2020	(r363354)
+++ stable/12/usr.sbin/bhyve/pci_nvme.c	Mon Jul 20 00:35:42 2020	(r363355)
@@ -468,6 +468,9 @@ pci_nvme_init_ctrldata(struct pci_nvme_softc *sc)
 	cd->acl = 2;
 	cd->aerl = 4;
 
+	/* Advertise 1, Read-only firmware slot */
+	cd->frmw = NVME_CTRLR_DATA_FRMW_SLOT1_RO_MASK |
+	    (1 << NVME_CTRLR_DATA_FRMW_NUM_SLOTS_SHIFT);
 	cd->lpa = 0;	/* TODO: support some simple things like SMART */
 	cd->elpe = 0;	/* max error log page entries */
 	cd->npss = 1;	/* number of power states support */
@@ -1555,6 +1558,12 @@ pci_nvme_handle_admin_cmd(struct pci_nvme_softc* sc, u
 		case NVME_OPC_GET_FEATURES:
 			DPRINTF("%s command GET_FEATURES", __func__);
 			nvme_opc_get_features(sc, cmd, &compl);
+			break;
+		case NVME_OPC_FIRMWARE_ACTIVATE:
+			DPRINTF("%s command FIRMWARE_ACTIVATE", __func__);
+			pci_nvme_status_tc(&compl.status,
+			    NVME_SCT_COMMAND_SPECIFIC,
+			    NVME_SC_INVALID_FIRMWARE_SLOT);
 			break;
 		case NVME_OPC_ASYNC_EVENT_REQUEST:
 			DPRINTF("%s command ASYNC_EVENT_REQ", __func__);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202007200035.06K0ZgTa002148>