Skip to contentSkip to conversation

board: sifive: unmatched: enable booting on a second NVME device

PATCH In review Aurelien Jarno 3 participants 3 messages Jan 7, 2023 – Jan 8, 2023 SiFive drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 board: sifive: unmatched: enable booting on a second NVME device

The HiFive Unmatched board has a M2 slot for NVME and a PCIe slot that can also be used for NVME. Enable support for a second NVME device, so that software RAID-1 configurations can be supported at the u-boot level.

---
 include/configs/sifive-unmatched.h | 1 +
 1 file changed, 1 insertion(+)
include/configs/sifive-unmatched.h +1 -0
index 85fab92719..9261932af9 100644
@@ -19,6 +19,7 @@
 
 #define BOOT_TARGET_DEVICES(func) \
 	func(NVME, nvme, 0) \
+	func(NVME, nvme, 1) \
 	func(USB, usb, 0) \
 	func(MMC, mmc, 0) \
 	func(SCSI, scsi, 0) \
Signature · 1 line
2.35.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · Aurelien Jarno

The HiFive Unmatched board has a M2 slot for NVME and a PCIe slot that can also be used for NVME. Enable support for a second NVME device, so that software RAID-1 configurations can be supported at the u-boot level.

---
  include/configs/sifive-unmatched.h | 1 +
  1 file changed, 1 insertion(+)
include/configs/sifive-unmatched.h +0 -0
index 85fab92719..9261932af9 100644

include/configs/sifive-unmatched.h line 22

Quoted 4 lines
include/configs/sifive-unmatched.h +1 -0
@@ -19,6 +19,7 @@
 
  #define BOOT_TARGET_DEVICES(func) \
  	func(NVME, nvme, 0) \
+	func(NVME, nvme, 1) \

We can have up to three NVMe drives directly connected. Just put an adapter into the 2230 m.2 slot (e.g.
https://www.aliexpress.com/item/32968036136.html, NGFF M.2 Key M to Key A+E Extension Cable NGFF Key M to A+E Adapter Card Board).

include/configs/sifive-unmatched.h line 25

Quoted 3 lines
include/configs/sifive-unmatched.h +0 -0
  	func(USB, usb, 0) \
  	func(MMC, mmc, 0) \
  	func(SCSI, scsi, 0) \

It is a generic problem that include/config_distro_bootcmd.h requires explicitly enumerating the device numbers instead of scanning all devices.

With a SATA adapter you can have more than one instance of SCSI too (cf. IOCREST M.2 NGFF to Sata3 Adapter Card A-Key + E-Key to 2 Ports SATA 6Gb/S
https://www.walmart.ca/en/ip/IOCREST-M-2-NGFF-to-Sata3-Adapter-Card-A-Key-E-Key-to-2-Ports-SATA-6Gb-S-Free-Driver-PCIe-3-0-Bus-for-Wifi-SSD-HDD-PC-Black/PRD67D114EQV1VO).

#2 lore raw
Quoted 7 lines · Heinrich Schuchardt
Quoted 7 lines
include/configs/sifive-unmatched.h +0 -0
index 85fab92719..9261932af9 100644
@@ -19,6 +19,7 @@
 
Quoted 8 lines

include/configs/sifive-unmatched.h line 22

Quoted 3 lines
include/configs/sifive-unmatched.h +1 -0
  #define BOOT_TARGET_DEVICES(func) \
  	func(NVME, nvme, 0) \
+	func(NVME, nvme, 1) \

We can have up to three NVMe drives directly connected. Just put an adapter into the 2230 m.2 slot (e.g.
https://www.aliexpress.com/item/32968036136.html, NGFF M.2 Key M to Key A+E Extension Cable NGFF Key M to A+E Adapter Card Board).

Or you can have an adapter with a PCIe switch such as the SI-PEX40152
<https://www.sybausa.com/index.php?route=product/product&product_id=1052>
plugged with up to 4 NVMe devices. So it really looks to me like this should be dynamic or at least set to a reasonably high static limit such as 16.

NB I have 12 buses present with various devices in the PCIe hierarchy
with my Unmatched system, so it's up to the user really how far to extend the system and it has to be taken into account while arranging firmware configuration IMHO:

00:00.0 PCI bridge: SiFive, Inc. FU740-C000 RISC-V SoC PCI Express x8 to AXI4 Bridge
01:00.0 PCI bridge: ASMedia Technology Inc. ASM2824 PCIe Gen3 Packet Switch (rev 01)
02:00.0 PCI bridge: ASMedia Technology Inc. ASM2824 PCIe Gen3 Packet Switch (rev 01)
02:02.0 PCI bridge: ASMedia Technology Inc. ASM2824 PCIe Gen3 Packet Switch (rev 01)
02:03.0 PCI bridge: ASMedia Technology Inc. ASM2824 PCIe Gen3 Packet Switch (rev 01)
02:04.0 PCI bridge: ASMedia Technology Inc. ASM2824 PCIe Gen3 Packet Switch (rev 01)
02:08.0 PCI bridge: ASMedia Technology Inc. ASM2824 PCIe Gen3 Packet Switch (rev 01)
04:00.0 USB controller: ASMedia Technology Inc. ASM1042A USB 3.0 Host Controller
05:00.0 PCI bridge: Pericom Semiconductor PI7C9X2G304 EL/SL PCIe2 3-Port/4-Lane Packet Switch (rev 05) 06:01.0 PCI bridge: Pericom Semiconductor PI7C9X2G304 EL/SL PCIe2 3-Port/4-Lane Packet Switch (rev 05) 06:02.0 PCI bridge: Pericom Semiconductor PI7C9X2G304 EL/SL PCIe2 3-Port/4-Lane Packet Switch (rev 05) 07:00.0 Parallel controller: Oxford Semiconductor Ltd OXPCIe952 Parallel Port
07:00.3 Serial controller: Oxford Semiconductor Ltd OXPCIe952 Native 950 UART
08:00.0 PCI bridge: ASMedia Technology Inc. ASM1083/1085 PCIe to PCI Bridge (rev 04)
09:01.0 FDDI network controller: Digital Equipment Corporation PCI-to-PDQ Interface Chip [PFI] FDDI (DEFPA) (rev 02) 09:02.0 ATM network controller: Microsemi / PMC / IDT IDT77201/77211 155Mbps ATM SAR Controller [NICStAR] (rev 03) 0a:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller SM981/PM981/PM983 0b:00.0 SATA controller: Marvell Technology Group Ltd. 88SE9120 SATA 6Gb/s Controller (rev 20) 0b:00.1 IDE interface: Marvell Technology Group Ltd. 88SE912x IDE Controller (rev 20)

Maciej