Skip to contentSkip to conversation

nvme: Add NVM Express driver support

PATCH New Bin Meng 2 participants 29 messages Aug 3, 2017 – Aug 14, 2017 Block layer

lore
Share & tools
lore

Bin Meng

author
#0 lore raw

cover nvme: Add NVM Express driver support

This series adds NVM Express driver support to U-Boot.

This series is based on previous RFC v2 patchset [1][2] done by Zhikang Zhang and Wenbin Song, as well as Jon Nettleton's fixes
[3] on top of the RFC v1.

The patches are organized in a way that meets the requirement of upstream. Jon's fixes were squashed/integrated with a proper order in this series.

The original RFC driver was cleaned up a lot, to remove the compilation limitation on non-ARMv8 architecture (including a header file from armv8), drop the board_r.c modification, drop unnecessary PCI configuration space initialization, add 32-bit architecture support of readq/writeq operations, eliminate compiler warnings, as well as coding convention clean up, plus a fix to a bug that is exposed by QEMU platform.

Tested with an Intel SSD 750 series NVMe 400GB card, a Plextor NVMe SSD M8Pe Series 256GB card, on Intel Crown Bay board, as well as QEMU x86 emulation platform.

This series is available at u-boot-x86/nvme-working for testing.

[1] http://patchwork.ozlabs.org/patch/753088/
[2] http://patchwork.ozlabs.org/patch/753089/
[3] http://patchwork.ozlabs.org/patch/794909/

Bin Meng (2):
nvme: Handle zero Maximum Data Transfer Size (MDTS)
x86: qemu: Enable NVMe driver

Jon Nettleton (2):
nvme: Detect devices that are class Storage Express
nvme: Fix number of blocks detection

Zhikang Zhang (4):
dm: blk: part: Add UCLASS_NVME and IF_TYPE_NVME
nvme: Add NVM Express driver support
nvme: Add show routine to print detailed information
nvme: Add nvme commands

 cmd/Kconfig                |   7 +
 cmd/Makefile               |   1 +
 cmd/nvme.c                 | 197 +++++++++++
 configs/qemu-x86_defconfig |   1 +
 disk/part.c                |   6 +-
 doc/README.nvme            |  86 +++++
 drivers/Kconfig            |   2 +
 drivers/Makefile           |   1 +
 drivers/block/blk-uclass.c |   2 +
 drivers/nvme/Kconfig       |  12 +
 drivers/nvme/Makefile      |   7 +
 drivers/nvme/nvme-uclass.c |  62 ++++
 drivers/nvme/nvme.c        | 860 +++++++++++++++++++++++++++++++++++++++++++++
 drivers/nvme/nvme.h        | 717 +++++++++++++++++++++++++++++++++++++
 drivers/nvme/nvme_show.c   | 127 +++++++
 include/blk.h              |   1 +
 include/dm/uclass-id.h     |   1 +
 include/nvme.h             |  82 +++++
 include/pci_ids.h          |   1 +
 19 files changed, 2172 insertions(+), 1 deletion(-)
 create mode 100644 cmd/nvme.c
 create mode 100644 doc/README.nvme
 create mode 100644 drivers/nvme/Kconfig
 create mode 100644 drivers/nvme/Makefile
 create mode 100644 drivers/nvme/nvme-uclass.c
 create mode 100644 drivers/nvme/nvme.c
 create mode 100644 drivers/nvme/nvme.h
 create mode 100644 drivers/nvme/nvme_show.c
 create mode 100644 include/nvme.h
Signature · 1 line
2.9.2
author
#1 lore raw

PATCH 1/8 dm: blk: part: Add UCLASS_NVME and IF_TYPE_NVME

From: Zhikang Zhang <[email protected]>

This adds a new uclass id and block interface type for NVMe.

---

 disk/part.c                | 6 +++++-
 drivers/block/blk-uclass.c | 2 ++
 include/blk.h              | 1 +
 include/dm/uclass-id.h     | 1 +
 4 files changed, 9 insertions(+), 1 deletion(-)
disk/part.c +5 -1
index 491b02d..2a1929a 100644
@@ -132,6 +132,7 @@ void dev_print (struct blk_desc *dev_desc)
 	case IF_TYPE_SD:
 	case IF_TYPE_MMC:
 	case IF_TYPE_USB:
+	case IF_TYPE_NVME:
 		printf ("Vendor: %s Rev: %s Prod: %s\n",
 			dev_desc->vendor,
 			dev_desc->revision,
@@ -263,7 +264,10 @@ static void print_part_header(const char *type, struct blk_desc *dev_desc)
 		puts ("MMC");
 		break;
 	case IF_TYPE_HOST:
-		puts("HOST");
+		puts ("HOST");
+		break;
+	case IF_TYPE_NVME:
+		puts ("NVMe");
 		break;
 	default:
 		puts ("UNKNOWN");
drivers/block/blk-uclass.c +2 -0
index 23f131b..a3737ba 100644
@@ -22,6 +22,7 @@ static const char *if_typename_str[IF_TYPE_COUNT] = {
 	[IF_TYPE_SATA]		= "sata",
 	[IF_TYPE_HOST]		= "host",
 	[IF_TYPE_SYSTEMACE]	= "ace",
+	[IF_TYPE_NVME]		= "nvme",
 };
 
 static enum uclass_id if_type_uclass_id[IF_TYPE_COUNT] = {
@@ -34,6 +35,7 @@ static enum uclass_id if_type_uclass_id[IF_TYPE_COUNT] = {
 	[IF_TYPE_SD]		= UCLASS_INVALID,
 	[IF_TYPE_SATA]		= UCLASS_AHCI,
 	[IF_TYPE_HOST]		= UCLASS_ROOT,
+	[IF_TYPE_NVME]		= UCLASS_NVME,
 	[IF_TYPE_SYSTEMACE]	= UCLASS_INVALID,
 };
 
include/blk.h +1 -0
index 1e6239a..61b5628 100644
@@ -31,6 +31,7 @@ enum if_type {
 	IF_TYPE_SATA,
 	IF_TYPE_HOST,
 	IF_TYPE_SYSTEMACE,
+	IF_TYPE_NVME,
 
 	IF_TYPE_COUNT,			/* Number of interface types */
 };
include/dm/uclass-id.h +1 -0
index 2e6498b..1a50199 100644
@@ -52,6 +52,7 @@ enum uclass_id {
 	UCLASS_MOD_EXP,		/* RSA Mod Exp device */
 	UCLASS_MTD,		/* Memory Technology Device (MTD) device */
 	UCLASS_NORTHBRIDGE,	/* Intel Northbridge / SDRAM controller */
+	UCLASS_NVME,		/* NVM Express device */
 	UCLASS_PANEL,		/* Display panel, such as an LCD */
 	UCLASS_PANEL_BACKLIGHT,	/* Backlight controller for panel */
 	UCLASS_PCH,		/* x86 platform controller hub */
Signature · 1 line
2.9.2
#2 lore raw

PATCH 1/8 dm: blk: part: Add UCLASS_NVME and IF_TYPE_NVME

Quoted 8 lines · Bin Meng

From: Zhikang Zhang <[email protected]>

This adds a new uclass id and block interface type for NVMe.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170809/f356d88b/attachment.sig>
#3 lore raw

PATCH 1/8 dm: blk: part: Add UCLASS_NVME and IF_TYPE_NVME

In reply to Bin Meng
Quoted 9 lines · Bin Meng

From: Zhikang Zhang <[email protected]>

This adds a new uclass id and block interface type for NVMe.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170813/fa93d46d/attachment.sig>
author
#4 lore raw

PATCH 2/8 nvme: Add NVM Express driver support

In reply to Bin Meng

From: Zhikang Zhang <[email protected]>

NVM Express (NVMe) is a register level interface that allows host software to communicate with a non-volatile memory subsystem. This interface is optimized for enterprise and client solid state drives, typically attached to the PCI express interface.

This adds a U-Boot driver support of devices that follow the NVMe standard [1] and supports basic read/write operations.

Tested with a 400GB Intel SSD 750 series NVMe card with controller id 8086:0953.

[1] http://www.nvmexpress.org/resources/specifications/

---

 doc/README.nvme            |  42 +++
 drivers/Kconfig            |   2 +
 drivers/Makefile           |   1 +
 drivers/nvme/Kconfig       |  12 +
 drivers/nvme/Makefile      |   7 +
 drivers/nvme/nvme-uclass.c |  62 ++++
 drivers/nvme/nvme.c        | 839 +++++++++++++++++++++++++++++++++++++++++++++
 drivers/nvme/nvme.h        | 717 ++++++++++++++++++++++++++++++++++++++
 include/nvme.h             |  71 ++++
 9 files changed, 1753 insertions(+)
 create mode 100644 doc/README.nvme
 create mode 100644 drivers/nvme/Kconfig
 create mode 100644 drivers/nvme/Makefile
 create mode 100644 drivers/nvme/nvme-uclass.c
 create mode 100644 drivers/nvme/nvme.c
 create mode 100644 drivers/nvme/nvme.h
 create mode 100644 include/nvme.h
doc/README.nvme new file +42 -0
new file mode 100644
index 0000000..d2b917d
@@ -0,0 +1,42 @@
+#
+# Copyright (C) 2017 NXP Semiconductors
+# Copyright (C) 2017 Bin Meng <[email protected]>
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+What is NVMe
+============
+
+NVM Express (NVMe) is a register level interface that allows host software to
+communicate with a non-volatile memory subsystem. This interface is optimized
+for enterprise and client solid state drives, typically attached to the PCI
+express interface. It is a scalable host controller interface designed to
+address the needs of enterprise and client systems that utilize PCI express
+based solid state drives (SSD). The interface provides optimized command
+submission and completion paths. It includes support for parallel operation by
+supporting up to 64K I/O queues with up to 64K commands per I/O queue.
+
+The device is comprised of some number of controllers, where each controller
+is comprised of some number of namespaces, where each namespace is comprised
+of some number of logical blocks. A namespace is a quantity of non-volatile
+memory that is formatted into logical blocks. An NVMe namespace is equivalent
+to a SCSI LUN. Each namespace is operated as an independent "device".
+
+How it works
+------------
+There is an NVMe uclass driver (driver name "nvme"), an NVMe host controller
+driver (driver name "nvme") and an NVMe namespace block driver (driver name
+"nvme-blk"). The host controller driver is supposed to probe the hardware and
+do necessary initialization to put the controller into a ready state at which
+it is able to scan all available namespaces attached to it. Scanning namespace
+is triggered by the NVMe uclass driver and the actual work is done in the NVMe
+namespace block driver.
+
+Status
+------
+It only support basic block read/write functions in the NVMe driver.
+
+Config options
+--------------
+CONFIG_NVME	Enable NVMe device support
drivers/Kconfig +2 -0
index 2e03133..613e602 100644
@@ -50,6 +50,8 @@ source "drivers/mtd/Kconfig"
 
 source "drivers/net/Kconfig"
 
+source "drivers/nvme/Kconfig"
+
 source "drivers/pci/Kconfig"
 
 source "drivers/pcmcia/Kconfig"
drivers/Makefile +1 -0
index e4a9cb4..0cbfa5d 100644
@@ -78,6 +78,7 @@ obj-y += firmware/
 obj-$(CONFIG_FPGA) += fpga/
 obj-y += misc/
 obj-$(CONFIG_MMC) += mmc/
+obj-$(CONFIG_NVME) += nvme/
 obj-y += pcmcia/
 obj-y += dfu/
 obj-$(CONFIG_X86) += pch/
drivers/nvme/Kconfig new file +12 -0
new file mode 100644
index 0000000..cad8dbc
@@ -0,0 +1,12 @@
+#
+# Copyright (C) 2017, Bin Meng <[email protected]>
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+config NVME
+	bool "NVM Express device support"
+	depends on BLK && PCI
+	help
+	  This option enables support for NVM Express devices.
+	  It supports basic functions of NVMe (read/write).
drivers/nvme/Makefile new file +7 -0
new file mode 100644
index 0000000..7bd9fa4
@@ -0,0 +1,7 @@
+#
+# Copyright (C) 2017, Bin Meng <[email protected]>
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y += nvme-uclass.o nvme.o
drivers/nvme/nvme-uclass.c new file +62 -0

62 lines not on this page · raw message

drivers/nvme/nvme.c new file +839 -0

839 lines not on this page · raw message

drivers/nvme/nvme.h new file +717 -0

717 lines not on this page · raw message

include/nvme.h new file +71 -0

71 lines not on this page · raw message

Signature · 1 line
2.9.2
#5 lore raw

PATCH 2/8 nvme: Add NVM Express driver support

Quoted 10 lines · Bin Meng

From: Zhikang Zhang <[email protected]>

NVM Express (NVMe) is a register level interface that allows host software to communicate with a non-volatile memory subsystem. This interface is optimized for enterprise and client solid state drives, typically attached to the PCI express interface.

This adds a U-Boot driver support of devices that follow the NVMe standard [1] and supports basic read/write operations.

Quoted 8 lines

Tested with a 400GB Intel SSD 750 series NVMe card with controller id 8086:0953.

[1] http://www.nvmexpress.org/resources/specifications/

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170809/2d78bfe3/attachment.sig>
#6 lore raw

PATCH 2/8 nvme: Add NVM Express driver support

In reply to Bin Meng
Quoted 13 lines · Bin Meng

From: Zhikang Zhang <[email protected]>

NVM Express (NVMe) is a register level interface that allows host software to communicate with a non-volatile memory subsystem. This interface is optimized for enterprise and client solid state drives, typically attached to the PCI express interface.

This adds a U-Boot driver support of devices that follow the NVMe standard [1] and supports basic read/write operations.

Tested with a 400GB Intel SSD 750 series NVMe card with controller id 8086:0953.

Quoted 6 lines

[1] http://www.nvmexpress.org/resources/specifications/

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170813/bb728c20/attachment-0001.sig>
author
#7 lore raw

PATCH 3/8 nvme: Add show routine to print detailed information

In reply to Bin Meng

From: Zhikang Zhang <[email protected]>

This adds nvme_print_info() to show detailed NVMe controller and namespace information.

---

 drivers/nvme/Makefile    |   2 +-
 drivers/nvme/nvme_show.c | 127 +++++++++++++++++++++++++++++++++++++++++++++++
 include/nvme.h           |  11 ++++
 3 files changed, 139 insertions(+), 1 deletion(-)
 create mode 100644 drivers/nvme/nvme_show.c
drivers/nvme/Makefile +1 -1
index 7bd9fa4..1f3010a 100644
@@ -4,4 +4,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-obj-y += nvme-uclass.o nvme.o
+obj-y += nvme-uclass.o nvme.o nvme_show.o
drivers/nvme/nvme_show.c new file +127 -0

127 lines not on this page · raw message

include/nvme.h +11 -0
index 3624408..8375d61 100644
@@ -68,4 +68,15 @@ int nvme_set_features(struct nvme_dev *dev, unsigned fid, unsigned dword11,
  */
 int nvme_scan_namespace(void);
 
+/**
+ * nvme_print_info - print detailed NVMe controller and namespace information
+ *
+ * This prints out detailed human readable NVMe controller and namespace
+ * information which is very useful for debugging.
+ *
+ * @udev:	NVMe controller device
+ * @return:	0 on success, -EIO if NVMe identify command fails
+ */
+int nvme_print_info(struct udevice *udev);
+
 #endif /* __NVME_H__ */
Signature · 1 line
2.9.2
#8 lore raw

PATCH 3/8 nvme: Add show routine to print detailed information

Quoted 8 lines · Bin Meng

From: Zhikang Zhang <[email protected]>

This adds nvme_print_info() to show detailed NVMe controller and namespace information.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170809/1951599f/attachment.sig>
#9 lore raw

PATCH 3/8 nvme: Add show routine to print detailed information

In reply to Bin Meng
Quoted 9 lines · Bin Meng

From: Zhikang Zhang <[email protected]>

This adds nvme_print_info() to show detailed NVMe controller and namespace information.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170813/40a6b8bc/attachment.sig>
author
#10 lore raw

PATCH 4/8 nvme: Add nvme commands

In reply to Bin Meng

From: Zhikang Zhang <[email protected]>

Add nvme commands in U-Boot command line.

1. "nvme scan" - scan NVMe blk devices
2. "nvme list" - show all available NVMe blk devices
3. "nvme info" - show current or a specific NVMe blk device
4. "nvme device" - show or set current device
5. "nvme part" - print partition table
6. "nvme read" - read data from NVMe blk device
7. "nvme write" - write data to NVMe blk device

---

 cmd/Kconfig     |   7 ++
 cmd/Makefile    |   1 +
 cmd/nvme.c      | 197 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 doc/README.nvme |  36 +++++++++++
 4 files changed, 241 insertions(+)
 create mode 100644 cmd/nvme.c
cmd/Kconfig +7 -0
index f18efc1..a9faea4 100644
@@ -631,6 +631,13 @@ config CMD_NAND_TORTURE
 
 endif # CMD_NAND
 
+config CMD_NVME
+	bool "nvme"
+	depends on NVME
+	default y if NVME
+	help
+	  NVM Express device support
+
 config CMD_PART
 	bool "part"
 	select PARTITION_UUIDS
cmd/Makefile +1 -0
index bd231f2..ffabb66 100644
@@ -106,6 +106,7 @@ obj-$(CONFIG_CMD_REISER) += reiser.o
 obj-$(CONFIG_CMD_REMOTEPROC) += remoteproc.o
 obj-$(CONFIG_SANDBOX) += host.o
 obj-$(CONFIG_CMD_SATA) += sata.o
+obj-$(CONFIG_CMD_NVME) += nvme.o
 obj-$(CONFIG_CMD_SF) += sf.o
 obj-$(CONFIG_SCSI) += scsi.o disk.o
 obj-$(CONFIG_CMD_SHA1SUM) += sha1sum.o
cmd/nvme.c new file +197 -0

197 lines not on this page · raw message

doc/README.nvme +36 -0
index d2b917d..28ecf54 100644
@@ -40,3 +40,39 @@ It only support basic block read/write functions in the NVMe driver.
 Config options
 --------------
 CONFIG_NVME	Enable NVMe device support
+CONFIG_CMD_NVME	Enable basic NVMe commands
+
+Usage in U-Boot
+---------------
+To use an NVMe hard disk from U-Boot shell, a 'nvme scan' command needs to
+be executed for all NVMe hard disks attached to the NVMe controller to be
+identified.
+
+To list all of the NVMe hard disks, try:
+
+  => nvme list
+  Device 0: Vendor: 0x8086 Rev: 8DV10131 Prod: CVFT535600LS400BGN
+	    Type: Hard Disk
+	    Capacity: 381554.0 MB = 372.6 GB (781422768 x 512)
+
+and print out detailed information for controller and namespaces via:
+
+  => nvme info
+
+Raw block read/write to can be done via the 'nvme read/write' commands:
+
+  => nvme read a0000000 0 11000
+
+  => tftp 80000000 /tftpboot/kernel.itb
+  => nvme write 80000000 0 11000
+
+Of course, file system command can be used on the NVMe hard disk as well:
+
+  => fatls nvme 0:1
+	32376967   kernel.itb
+	22929408   100m
+
+	2 file(s), 0 dir(s)
+
+  => fatload nvme 0:1 a0000000 /kernel.itb
+  => bootm a0000000
Signature · 1 line
2.9.2
#11 lore raw

PATCH 4/8 nvme: Add nvme commands

Quoted 12 lines · Bin Meng

From: Zhikang Zhang <[email protected]>

Add nvme commands in U-Boot command line.

1. "nvme scan" - scan NVMe blk devices
2. "nvme list" - show all available NVMe blk devices
3. "nvme info" - show current or a specific NVMe blk device
4. "nvme device" - show or set current device
5. "nvme part" - print partition table
6. "nvme read" - read data from NVMe blk device
7. "nvme write" - write data to NVMe blk device

Quoted 4 lines
Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170809/7e9fe4e6/attachment.sig>
#12 lore raw

PATCH 4/8 nvme: Add nvme commands

In reply to Bin Meng
Quoted 12 lines · Bin Meng

From: Zhikang Zhang <[email protected]>

Add nvme commands in U-Boot command line.

1. "nvme scan" - scan NVMe blk devices
2. "nvme list" - show all available NVMe blk devices
3. "nvme info" - show current or a specific NVMe blk device
4. "nvme device" - show or set current device
5. "nvme part" - print partition table
6. "nvme read" - read data from NVMe blk device
7. "nvme write" - write data to NVMe blk device

Quoted 4 lines

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170813/434fd231/attachment.sig>
author
#13 lore raw

PATCH 5/8 nvme: Detect devices that are class Storage Express

In reply to Bin Meng

From: Jon Nettleton <[email protected]>

This adds support to detect the catchall PCI class for NVMe devices. It allows the drivers to work with most NVMe devices that don't need specific detection due to quirks etc.

Tested against a Samsung 960 EVO drive.

---

 drivers/nvme/nvme.c | 2 +-
 include/pci_ids.h   | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/nvme/nvme.c +1 -1
index a60682a..feea02a 100644
@@ -832,7 +832,7 @@ U_BOOT_DRIVER(nvme) = {
 };
 
 struct pci_device_id nvme_supported[] = {
-	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x0953) },
+	{ PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, ~0) },
 	{}
 };
 
include/pci_ids.h +1 -0
index ab6aa58..fdda679 100644
@@ -21,6 +21,7 @@
 #define PCI_CLASS_STORAGE_SATA		0x0106
 #define PCI_CLASS_STORAGE_SATA_AHCI	0x010601
 #define PCI_CLASS_STORAGE_SAS		0x0107
+#define PCI_CLASS_STORAGE_EXPRESS	0x010802
 #define PCI_CLASS_STORAGE_OTHER		0x0180
 
 #define PCI_BASE_CLASS_NETWORK		0x02
Signature · 1 line
2.9.2
#14 lore raw

PATCH 5/8 nvme: Detect devices that are class Storage Express

Quoted 10 lines · Bin Meng

From: Jon Nettleton <[email protected]>

This adds support to detect the catchall PCI class for NVMe devices. It allows the drivers to work with most NVMe devices that don't need specific detection due to quirks etc.

Tested against a Samsung 960 EVO drive.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170809/671eb5c2/attachment.sig>
#15 lore raw

PATCH 5/8 nvme: Detect devices that are class Storage Express

In reply to Bin Meng
Quoted 11 lines · Bin Meng

From: Jon Nettleton <[email protected]>

This adds support to detect the catchall PCI class for NVMe devices. It allows the drivers to work with most NVMe devices that don't need specific detection due to quirks etc.

Tested against a Samsung 960 EVO drive.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170813/310beaed/attachment.sig>
author
#16 lore raw

PATCH 6/8 nvme: Fix number of blocks detection

In reply to Bin Meng

From: Jon Nettleton <[email protected]>

NVMe should use the nsze value from the queried device. This will reflect the total number of blocks of the device and fix detecting my Samsung 960 EVO 256GB.

Original:
Capacity: 40386.6 MB = 39.4 GB (82711872 x 512)

Fixed:
Capacity: 238475.1 MB = 232.8 GB (488397168 x 512)

---

 drivers/nvme/nvme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/nvme.c +1 -1
index feea02a..bac253a 100644
@@ -620,7 +620,7 @@ static int nvme_blk_probe(struct udevice *udev)
 	flbas = id->flbas & NVME_NS_FLBAS_LBA_MASK;
 	ns->flbas = flbas;
 	ns->lba_shift = id->lbaf[flbas].ds;
-	ns->mode_select_num_blocks = le64_to_cpu(id->nuse);
+	ns->mode_select_num_blocks = le64_to_cpu(id->nsze);
 	ns->mode_select_block_len = 1 << ns->lba_shift;
 	list_add(&ns->list, &ndev->namespaces);
 
Signature · 1 line
2.9.2
#17 lore raw

PATCH 6/8 nvme: Fix number of blocks detection

Quoted 9 lines · Bin Meng

From: Jon Nettleton <[email protected]>

NVMe should use the nsze value from the queried device. This will reflect the total number of blocks of the device and fix detecting my Samsung 960 EVO 256GB.

Original:
Capacity: 40386.6 MB = 39.4 GB (82711872 x 512)

Quoted 6 lines

Fixed:
Capacity: 238475.1 MB = 232.8 GB (488397168 x 512)

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170809/7a7ddb2f/attachment.sig>
#18 lore raw

PATCH 6/8 nvme: Fix number of blocks detection

In reply to Bin Meng
Quoted 9 lines · Bin Meng

From: Jon Nettleton <[email protected]>

NVMe should use the nsze value from the queried device. This will reflect the total number of blocks of the device and fix detecting my Samsung 960 EVO 256GB.

Original:
Capacity: 40386.6 MB = 39.4 GB (82711872 x 512)

Quoted 7 lines

Fixed:
Capacity: 238475.1 MB = 232.8 GB (488397168 x 512)

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170813/a00dc422/attachment.sig>
author
#19 lore raw

PATCH 7/8 nvme: Handle zero Maximum Data Transfer Size (MDTS)

In reply to Bin Meng

Maximum Data Transfer Size (MDTS) field indicates the maximum data transfer size between the host and the controller. The host should not submit a command that exceeds this transfer size. The value is in units of the minimum memory page size and is reported as a power of two (2^n).

The spec also says: a value of 0h indicates no restrictions on transfer size. On the real NVMe card this is normally not 0 due to hardware restrictions, but with QEMU emulated NVMe device it reports as 0. In nvme_blk_read/write() below we have the following algorithm for maximum number of logic blocks per transfer:

u16 lbas = 1 << (dev->max_transfer_shift - ns->lba_shift);

dev->max_transfer_shift being 0 will for sure cause lbas to overflow. Let's use 20. With this fix, the NVMe driver works on QEMU emulated NVMe device.

---

 drivers/nvme/nvme.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
drivers/nvme/nvme.c +21 -0
index bac253a..151fe92 100644
@@ -563,6 +563,27 @@ static int nvme_get_info_from_identify(struct nvme_dev *dev)
 	memcpy(dev->firmware_rev, ctrl->fr, sizeof(ctrl->fr));
 	if (ctrl->mdts)
 		dev->max_transfer_shift = (ctrl->mdts + shift);
+	else {
+		/*
+		 * Maximum Data Transfer Size (MDTS) field indicates the maximum
+		 * data transfer size between the host and the controller. The
+		 * host should not submit a command that exceeds this transfer
+		 * size. The value is in units of the minimum memory page size
+		 * and is reported as a power of two (2^n).
+		 *
+		 * The spec also says: a value of 0h indicates no restrictions
+		 * on transfer size. But in nvme_blk_read/write() below we have
+		 * the following algorithm for maximum number of logic blocks
+		 * per transfer:
+		 *
+		 * u16 lbas = 1 << (dev->max_transfer_shift - ns->lba_shift);
+		 *
+		 * In order for lbas not to overflow, the maximum number is 15
+		 * which means dev->max_transfer_shift = 15 + 9 (ns->lba_shift).
+		 * Let's use 20 which provides 1MB size.
+		 */
+		dev->max_transfer_shift = 20;
+	}
 
 	/* Apply quirk stuff */
 	dm_pci_read_config16(dev->pdev, PCI_VENDOR_ID, &vendor);
Signature · 1 line
2.9.2
#20 lore raw

PATCH 7/8 nvme: Handle zero Maximum Data Transfer Size (MDTS)

Quoted 13 lines · Bin Meng

Maximum Data Transfer Size (MDTS) field indicates the maximum data transfer size between the host and the controller. The host should not submit a command that exceeds this transfer size. The value is in units of the minimum memory page size and is reported as a power of two (2^n).

The spec also says: a value of 0h indicates no restrictions on transfer size. On the real NVMe card this is normally not 0 due to hardware restrictions, but with QEMU emulated NVMe device it reports as 0. In nvme_blk_read/write() below we have the following algorithm for maximum number of logic blocks per transfer:

Quoted 7 lines

u16 lbas = 1 << (dev->max_transfer_shift - ns->lba_shift);

dev->max_transfer_shift being 0 will for sure cause lbas to overflow. Let's use 20. With this fix, the NVMe driver works on QEMU emulated NVMe device.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170809/9cbbd3fb/attachment.sig>
#21 lore raw

PATCH 7/8 nvme: Handle zero Maximum Data Transfer Size (MDTS)

In reply to Bin Meng
Quoted 13 lines · Bin Meng

Maximum Data Transfer Size (MDTS) field indicates the maximum data transfer size between the host and the controller. The host should not submit a command that exceeds this transfer size. The value is in units of the minimum memory page size and is reported as a power of two (2^n).

The spec also says: a value of 0h indicates no restrictions on transfer size. On the real NVMe card this is normally not 0 due to hardware restrictions, but with QEMU emulated NVMe device it reports as 0. In nvme_blk_read/write() below we have the following algorithm for maximum number of logic blocks per transfer:

Quoted 8 lines

u16 lbas = 1 << (dev->max_transfer_shift - ns->lba_shift);

dev->max_transfer_shift being 0 will for sure cause lbas to overflow. Let's use 20. With this fix, the NVMe driver works on QEMU emulated NVMe device.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170813/ecdada43/attachment.sig>
author
#22 lore raw

PATCH 8/8 x86: qemu: Enable NVMe driver

In reply to Bin Meng

QEMU supports NVMe emulation. Enable the NVMe driver on QEMU x86.

---

 configs/qemu-x86_defconfig | 1 +
 doc/README.nvme            | 8 ++++++++
 2 files changed, 9 insertions(+)
configs/qemu-x86_defconfig +1 -0
index 068b1cd..91eb33e 100644
@@ -36,6 +36,7 @@ CONFIG_EFI_PARTITION=y
 CONFIG_REGMAP=y
 CONFIG_SYSCON=y
 CONFIG_CPU=y
+CONFIG_NVME=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
doc/README.nvme +8 -0
index 28ecf54..3afa912 100644
@@ -76,3 +76,11 @@ Of course, file system command can be used on the NVMe hard disk as well:
 
   => fatload nvme 0:1 a0000000 /kernel.itb
   => bootm a0000000
+
+Testing NVMe with QEMU x86
+--------------------------
+QEMU supports NVMe emulation and we can test NVMe driver with QEMU x86 running
+U-Boot. Please see README.x86 for how to build u-boot.rom image for QEMU x86.
+
+Example command line to call QEMU x86 below with emulated NVMe device:
+$ ./qemu-system-i386 -drive file=nvme.img,if=none,id=drv0 -device nvme,drive=drv0,serial=QEMUNVME0001 -bios u-boot.rom
Signature · 1 line
2.9.2
#23 lore raw

PATCH 8/8 x86: qemu: Enable NVMe driver

Quoted 3 lines · Bin Meng

QEMU supports NVMe emulation. Enable the NVMe driver on QEMU x86.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170809/4a9e987b/attachment.sig>
#24 lore raw

PATCH 8/8 x86: qemu: Enable NVMe driver

In reply to Bin Meng
Quoted 4 lines · Bin Meng

QEMU supports NVMe emulation. Enable the NVMe driver on QEMU x86.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170813/d7e30464/attachment.sig>
author
#25 lore raw

cover nvme: Add NVM Express driver support

In reply to Bin Meng

Hi Tom,

Quoted 64 lines · Bin Meng

This series adds NVM Express driver support to U-Boot.

This series is based on previous RFC v2 patchset [1][2] done by Zhikang Zhang and Wenbin Song, as well as Jon Nettleton's fixes
[3] on top of the RFC v1.

The patches are organized in a way that meets the requirement of upstream. Jon's fixes were squashed/integrated with a proper order in this series.

The original RFC driver was cleaned up a lot, to remove the compilation limitation on non-ARMv8 architecture (including a header file from armv8), drop the board_r.c modification, drop unnecessary PCI configuration space initialization, add 32-bit architecture support of readq/writeq operations, eliminate compiler warnings, as well as coding convention clean up, plus a fix to a bug that is exposed by QEMU platform.

Tested with an Intel SSD 750 series NVMe 400GB card, a Plextor NVMe SSD M8Pe Series 256GB card, on Intel Crown Bay board, as well as QEMU x86 emulation platform.

This series is available at u-boot-x86/nvme-working for testing.

[1] http://patchwork.ozlabs.org/patch/753088/
[2] http://patchwork.ozlabs.org/patch/753089/
[3] http://patchwork.ozlabs.org/patch/794909/

Bin Meng (2):
nvme: Handle zero Maximum Data Transfer Size (MDTS)
x86: qemu: Enable NVMe driver

Jon Nettleton (2):
nvme: Detect devices that are class Storage Express
nvme: Fix number of blocks detection

Zhikang Zhang (4):
dm: blk: part: Add UCLASS_NVME and IF_TYPE_NVME
nvme: Add NVM Express driver support
nvme: Add show routine to print detailed information
nvme: Add nvme commands

 cmd/Kconfig                |   7 +
 cmd/Makefile               |   1 +
 cmd/nvme.c                 | 197 +++++++++++
 configs/qemu-x86_defconfig |   1 +
 disk/part.c                |   6 +-
 doc/README.nvme            |  86 +++++
 drivers/Kconfig            |   2 +
 drivers/Makefile           |   1 +
 drivers/block/blk-uclass.c |   2 +
 drivers/nvme/Kconfig       |  12 +
 drivers/nvme/Makefile      |   7 +
 drivers/nvme/nvme-uclass.c |  62 ++++
 drivers/nvme/nvme.c        | 860 +++++++++++++++++++++++++++++++++++++++++++++
 drivers/nvme/nvme.h        | 717 +++++++++++++++++++++++++++++++++++++
 drivers/nvme/nvme_show.c   | 127 +++++++
 include/blk.h              |   1 +
 include/dm/uclass-id.h     |   1 +
 include/nvme.h             |  82 +++++
 include/pci_ids.h          |   1 +
 19 files changed, 2172 insertions(+), 1 deletion(-)
 create mode 100644 cmd/nvme.c
Quoted 9 lines
 create mode 100644 doc/README.nvme
 create mode 100644 drivers/nvme/Kconfig
 create mode 100644 drivers/nvme/Makefile
 create mode 100644 drivers/nvme/nvme-uclass.c
 create mode 100644 drivers/nvme/nvme.c
 create mode 100644 drivers/nvme/nvme.h
 create mode 100644 drivers/nvme/nvme_show.c
 create mode 100644 include/nvme.h

Do you think this NVMe support can be included in 2017.09? If yes (and no other review comments from the list), I can apply and for you to pull via the x86 tree.

Regards,
Bin

#26 lore raw

cover nvme: Add NVM Express driver support

Quoted 76 lines · Bin Meng

Hi Tom,

Quoted 64 lines · Bin Meng

This series adds NVM Express driver support to U-Boot.

This series is based on previous RFC v2 patchset [1][2] done by Zhikang Zhang and Wenbin Song, as well as Jon Nettleton's fixes
[3] on top of the RFC v1.

The patches are organized in a way that meets the requirement of upstream. Jon's fixes were squashed/integrated with a proper order in this series.

The original RFC driver was cleaned up a lot, to remove the compilation limitation on non-ARMv8 architecture (including a header file from armv8), drop the board_r.c modification, drop unnecessary PCI configuration space initialization, add 32-bit architecture support of readq/writeq operations, eliminate compiler warnings, as well as coding convention clean up, plus a fix to a bug that is exposed by QEMU platform.

Tested with an Intel SSD 750 series NVMe 400GB card, a Plextor NVMe SSD M8Pe Series 256GB card, on Intel Crown Bay board, as well as QEMU x86 emulation platform.

This series is available at u-boot-x86/nvme-working for testing.

[1] http://patchwork.ozlabs.org/patch/753088/
[2] http://patchwork.ozlabs.org/patch/753089/
[3] http://patchwork.ozlabs.org/patch/794909/

Bin Meng (2):
nvme: Handle zero Maximum Data Transfer Size (MDTS)
x86: qemu: Enable NVMe driver

Jon Nettleton (2):
nvme: Detect devices that are class Storage Express
nvme: Fix number of blocks detection

Zhikang Zhang (4):
dm: blk: part: Add UCLASS_NVME and IF_TYPE_NVME
nvme: Add NVM Express driver support
nvme: Add show routine to print detailed information
nvme: Add nvme commands

 cmd/Kconfig                |   7 +
 cmd/Makefile               |   1 +
 cmd/nvme.c                 | 197 +++++++++++
 configs/qemu-x86_defconfig |   1 +
 disk/part.c                |   6 +-
 doc/README.nvme            |  86 +++++
 drivers/Kconfig            |   2 +
 drivers/Makefile           |   1 +
 drivers/block/blk-uclass.c |   2 +
 drivers/nvme/Kconfig       |  12 +
 drivers/nvme/Makefile      |   7 +
 drivers/nvme/nvme-uclass.c |  62 ++++
 drivers/nvme/nvme.c        | 860 +++++++++++++++++++++++++++++++++++++++++++++
 drivers/nvme/nvme.h        | 717 +++++++++++++++++++++++++++++++++++++
 drivers/nvme/nvme_show.c   | 127 +++++++
 include/blk.h              |   1 +
 include/dm/uclass-id.h     |   1 +
 include/nvme.h             |  82 +++++
 include/pci_ids.h          |   1 +
 19 files changed, 2172 insertions(+), 1 deletion(-)
 create mode 100644 cmd/nvme.c
Quoted 8 lines
 create mode 100644 doc/README.nvme
 create mode 100644 drivers/nvme/Kconfig
 create mode 100644 drivers/nvme/Makefile
 create mode 100644 drivers/nvme/nvme-uclass.c
 create mode 100644 drivers/nvme/nvme.c
 create mode 100644 drivers/nvme/nvme.h
 create mode 100644 drivers/nvme/nvme_show.c
 create mode 100644 include/nvme.h
Quoted 3 lines

Do you think this NVMe support can be included in 2017.09? If yes (and no other review comments from the list), I can apply and for you to pull via the x86 tree.

I've reviewed it, and things look good. I'll pick it up in a day or two. My question now is, can this also be enabled for sandbox, given that we have PCI there? Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170809/5acfba2f/attachment.sig>
author
#27 lore raw

cover nvme: Add NVM Express driver support

Hi Tom,

Quoted 77 lines · Tom Rini
Quoted 76 lines · Bin Meng

Hi Tom,

Quoted 72 lines · Bin Meng

This series adds NVM Express driver support to U-Boot.

This series is based on previous RFC v2 patchset [1][2] done by Zhikang Zhang and Wenbin Song, as well as Jon Nettleton's fixes
[3] on top of the RFC v1.

The patches are organized in a way that meets the requirement of upstream. Jon's fixes were squashed/integrated with a proper order in this series.

The original RFC driver was cleaned up a lot, to remove the compilation limitation on non-ARMv8 architecture (including a header file from armv8), drop the board_r.c modification, drop unnecessary PCI configuration space initialization, add 32-bit architecture support of readq/writeq operations, eliminate compiler warnings, as well as coding convention clean up, plus a fix to a bug that is exposed by QEMU platform.

Tested with an Intel SSD 750 series NVMe 400GB card, a Plextor NVMe SSD M8Pe Series 256GB card, on Intel Crown Bay board, as well as QEMU x86 emulation platform.

This series is available at u-boot-x86/nvme-working for testing.

[1] http://patchwork.ozlabs.org/patch/753088/
[2] http://patchwork.ozlabs.org/patch/753089/
[3] http://patchwork.ozlabs.org/patch/794909/

Bin Meng (2):
nvme: Handle zero Maximum Data Transfer Size (MDTS)
x86: qemu: Enable NVMe driver

Jon Nettleton (2):
nvme: Detect devices that are class Storage Express
nvme: Fix number of blocks detection

Zhikang Zhang (4):
dm: blk: part: Add UCLASS_NVME and IF_TYPE_NVME
nvme: Add NVM Express driver support
nvme: Add show routine to print detailed information
nvme: Add nvme commands

 cmd/Kconfig                |   7 +
 cmd/Makefile               |   1 +
 cmd/nvme.c                 | 197 +++++++++++
 configs/qemu-x86_defconfig |   1 +
 disk/part.c                |   6 +-
 doc/README.nvme            |  86 +++++
 drivers/Kconfig            |   2 +
 drivers/Makefile           |   1 +
 drivers/block/blk-uclass.c |   2 +
 drivers/nvme/Kconfig       |  12 +
 drivers/nvme/Makefile      |   7 +
 drivers/nvme/nvme-uclass.c |  62 ++++
 drivers/nvme/nvme.c        | 860 +++++++++++++++++++++++++++++++++++++++++++++
 drivers/nvme/nvme.h        | 717 +++++++++++++++++++++++++++++++++++++
 drivers/nvme/nvme_show.c   | 127 +++++++
 include/blk.h              |   1 +
 include/dm/uclass-id.h     |   1 +
 include/nvme.h             |  82 +++++
 include/pci_ids.h          |   1 +
 19 files changed, 2172 insertions(+), 1 deletion(-)
 create mode 100644 cmd/nvme.c
 create mode 100644 doc/README.nvme
 create mode 100644 drivers/nvme/Kconfig
 create mode 100644 drivers/nvme/Makefile
 create mode 100644 drivers/nvme/nvme-uclass.c
 create mode 100644 drivers/nvme/nvme.c
 create mode 100644 drivers/nvme/nvme.h
 create mode 100644 drivers/nvme/nvme_show.c
 create mode 100644 include/nvme.h
Quoted 7 lines
Quoted 3 lines

Do you think this NVMe support can be included in 2017.09? If yes (and no other review comments from the list), I can apply and for you to pull via the x86 tree.

I've reviewed it, and things look good. I'll pick it up in a day or two. My question now is, can this also be enabled for sandbox, given that we have PCI there? Thanks!

Thanks for the review! I've reassigned the patches to you in the patchwork.

For the sandbox, I believe you want this driver to be included for build testing? I think it can be enabled on sandbox, but I have not tried that yet.

Regards,
Bin

#28 lore raw

cover nvme: Add NVM Express driver support

Quoted 88 lines · Bin Meng

Hi Tom,

Quoted 77 lines · Tom Rini
Quoted 76 lines · Bin Meng

Hi Tom,

Quoted 72 lines · Bin Meng

This series adds NVM Express driver support to U-Boot.

This series is based on previous RFC v2 patchset [1][2] done by Zhikang Zhang and Wenbin Song, as well as Jon Nettleton's fixes
[3] on top of the RFC v1.

The patches are organized in a way that meets the requirement of upstream. Jon's fixes were squashed/integrated with a proper order in this series.

The original RFC driver was cleaned up a lot, to remove the compilation limitation on non-ARMv8 architecture (including a header file from armv8), drop the board_r.c modification, drop unnecessary PCI configuration space initialization, add 32-bit architecture support of readq/writeq operations, eliminate compiler warnings, as well as coding convention clean up, plus a fix to a bug that is exposed by QEMU platform.

Tested with an Intel SSD 750 series NVMe 400GB card, a Plextor NVMe SSD M8Pe Series 256GB card, on Intel Crown Bay board, as well as QEMU x86 emulation platform.

This series is available at u-boot-x86/nvme-working for testing.

[1] http://patchwork.ozlabs.org/patch/753088/
[2] http://patchwork.ozlabs.org/patch/753089/
[3] http://patchwork.ozlabs.org/patch/794909/

Bin Meng (2):
nvme: Handle zero Maximum Data Transfer Size (MDTS)
x86: qemu: Enable NVMe driver

Jon Nettleton (2):
nvme: Detect devices that are class Storage Express
nvme: Fix number of blocks detection

Zhikang Zhang (4):
dm: blk: part: Add UCLASS_NVME and IF_TYPE_NVME
nvme: Add NVM Express driver support
nvme: Add show routine to print detailed information
nvme: Add nvme commands

 cmd/Kconfig                |   7 +
 cmd/Makefile               |   1 +
 cmd/nvme.c                 | 197 +++++++++++
 configs/qemu-x86_defconfig |   1 +
 disk/part.c                |   6 +-
 doc/README.nvme            |  86 +++++
 drivers/Kconfig            |   2 +
 drivers/Makefile           |   1 +
 drivers/block/blk-uclass.c |   2 +
 drivers/nvme/Kconfig       |  12 +
 drivers/nvme/Makefile      |   7 +
 drivers/nvme/nvme-uclass.c |  62 ++++
 drivers/nvme/nvme.c        | 860 +++++++++++++++++++++++++++++++++++++++++++++
 drivers/nvme/nvme.h        | 717 +++++++++++++++++++++++++++++++++++++
 drivers/nvme/nvme_show.c   | 127 +++++++
 include/blk.h              |   1 +
 include/dm/uclass-id.h     |   1 +
 include/nvme.h             |  82 +++++
 include/pci_ids.h          |   1 +
 19 files changed, 2172 insertions(+), 1 deletion(-)
 create mode 100644 cmd/nvme.c
 create mode 100644 doc/README.nvme
 create mode 100644 drivers/nvme/Kconfig
 create mode 100644 drivers/nvme/Makefile
 create mode 100644 drivers/nvme/nvme-uclass.c
 create mode 100644 drivers/nvme/nvme.c
 create mode 100644 drivers/nvme/nvme.h
 create mode 100644 drivers/nvme/nvme_show.c
 create mode 100644 include/nvme.h
Quoted 7 lines
Quoted 3 lines

Do you think this NVMe support can be included in 2017.09? If yes (and no other review comments from the list), I can apply and for you to pull via the x86 tree.

I've reviewed it, and things look good. I'll pick it up in a day or two. My question now is, can this also be enabled for sandbox, given that we have PCI there? Thanks!

Quoted 5 lines

Thanks for the review! I've reassigned the patches to you in the patchwork.

For the sandbox, I believe you want this driver to be included for build testing? I think it can be enabled on sandbox, but I have not tried that yet.

Build testing and coverity coverage to start with. A follow up (that would require some work in places) would be adding test.py tests of some sort.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170809/6b6a4643/attachment.sig>