Re: Universal Flash Storage Driver Proposal

From: Jaeyoon Choi <j_yoon.choi_at_samsung.com>
Date: Tue, 21 Jan 2025 00:26:02 UTC
Hi Warner

Thank you for your reply.
I have learned a lot from your presentation and paper.

Universal Flash Storage (UFS) only attaches one device to a single controller,
meaning there is only one SCSI target.
UFS supports a subset of SCSI commands, so the CAM periph driver may need to
restrict requests for certain commands.
(e.g. UFS does not support the MODE SENSE(6), READ(12)/WRITE(12) commands).

So, I think I can just use the existing SCSI transport. Am I right?
(I'm referring to sys/dev/usb/storage/umass.c and sys/dev/virtio/scsi/virtio_scsi.c).

I would greatly appreciate your advice.

Thank you,
Jaeyoon

> Hi Jaeyoon
> 
> This sounds really cool!
> 
> What layering scheme did you have in mind to allow multiple storage devices
> per
> controller? Will it be a new kind of SIM in the CAM layer, or will it be
> SCSI with
> a different transport? Is this a full SCSI implementation, or will the CAM
> periph
> drivers need to restrict the requests they send down for this? We already
> have a
> number of subsets that we handle in an ad-hoc way, but maybe we need to be
> a little
> more organized about it.
> 
> In the past, I've helped with the MMC and NVMe integration intro CAM, so I
> have
> an interest....
> 
> Warner
> 
> On Thu, Jan 16, 2025 at 9:54 PM Jaeyoon Choi <j_yoon.choi@samsung.com>
> wrote:
> 
> > Hello,
> >
> > As I mentioned in my previous email to the mailing list last year, I am
> > planning
> > to start developing a Universal Flash Storage Driver.
> > - https://lists.freebsd.org/archives/freebsd-hackers/2024-July/003385.html
> > Before I begin working on the driver, I would like to share my development
> > plan
> > with you.
> >
> > Universal Flash Storage (UFS) is a storage device for mobile devices which
> > aims
> > for high performance and low power consumption.
> > UFS is currently used in most smartphones and tablets, and I believe there
> > is a
> > demand for UFS support in FreeBSD.
> >
> > The Universal Flash Storage Driver is named UFSHCI to avoid confusion with
> > the
> > UFS filesystem, and is located in the /sys/dev/ufshci folder.
> >
> > The driver will be developed based on the UFS 4.1 (JESD220G) and UFSHCI 4.1
> > (JESD223F) specification documents, which are the latest versions
> > available.
> > The latest specifications can be found at the following link:
> > -
> > https://www.jedec.org/standards-documents/focus/flash/universal-flash-storage-ufs
> >
> > My plan is to first implement a PCIe-based driver and then make it
> > compatible
> > with various smartphone application processors.
> > Since UFS uses SCSI commands, we need to use the SCSI I/O path of the CAM.
> >
> > Please note that there is currently a UFSHCI driver in development for
> > OpenBSD,
> > but due to its low spec version (UFSHCI 2.1) and lack of compatibility with
> > FreeBSD, I have decided to start from scratch.
> >
> > The following platforms will be used for testing:
> > - QEMU with Emulated UFS device
> > - Samsung Galaxy Book S (Intel Lakefield + eUFS)
> > - Lenovo Duet3 11ian8 (Intel N100 + eUFS)
> >
> > After developing the UFSHCI driver, I will continue to work on additional
> > features and keep the driver up-to-date with the latest specs.
> > The approximate development plan is as follows:
> >
> > - 2025 1H: Implementation of initialization, basic operations, and single
> >            doorbell-based read/write I/O on Intel CPU-based platforms
> > - 2025 2H: Implementation of MCQ-based read/write I/O, and implementation
> > of
> >            additional features such as writebooster
> >
> > I look forward to receiving your feedback and suggestions.
> >
> > Best regards,
> > Jaeyoon
> >
> >