OPNsense - FreeBSD source
Find a file
Jaeyoon Choi 1349a733cf ufshci: Introduce the ufshci(4) driver
This commit adds a storage driver that supports the Universal Flash
Storage Host Controller Interface (UFSHCI) on FreeBSD.

Universal Flash Storage (UFS) is a flash-based mobile storage device
that replaces eMMC, aiming for high performance with low power. The UFS
Host Controller Interface (UFSHCI) is the host side controller and
connects UFS device to a system bus, such as PCIe.

The code targets the latest standards:
- UFS 4.1: https://www.jedec.org/standards-documents/docs/jesd220g
- UFSHCI 4.1: https://www.jedec.org/standards-documents/docs/jesd223f

The ufshci(4) driver implements controller/device initialization,
interrupt, single-doorbell(SDB) queue based IO requests. Support for
multi-queue (MCQ) IO requests is planned for a later commit.

Implemented features:
- PCIe bus support
- legacy(INTx) Interrupt Handling
- UIC command support
- UTP Transfer Request (UTR) support
- UTP Task Management Request (UTMR) support
- single doorbell queue (SDB) with multiple queue depth
- SCSI command set support
- sysctl

Work in progress:
- multi-Circular Queue (per-CPU IO queues)
- MSI-X interrupt Support
- write booster
- write Protect
- Host Performance Booster (HPB)
- interrupt aggregation
- ARM based system bus support
- ufs-utils port

Tests were performed on QEMU and an Intel-based laptop.
Since QEMU has an emulated UFS device, I tested on QEMU.

How to test on QEMU:
1. Run QEMU
    $ qemu-system-x86_64 ... -device ufs -drive file=blk1g.bin,format=raw,if=none,id=luimg -device ufs-lu,drive=luimg,lun=0
2. Loading/unloading the ufshci module on QEMU
    $ kldload /usr/obj/usr/src/amd64.amd64/sys/modules/ufshci/ufshci.ko
    $ kldunload ufshci

Testing on real hardware:
- Samsung Galaxy Book S (Intel Lakefield) with UFS 3.0
- Lenovo duet 3 11ian8 (Intel N100) with UFS 2.1

Sponsored by:		Samsung Electronics
Reviewed by:		imp
Differential Revision:	https://reviews.freebsd.org/D50370
2025-06-15 00:08:56 -06:00
.cirrus-ci Cirrus-CI: add some timing info on pkg install failure 2021-08-04 15:02:00 -04:00
.github github: Fix checklist action 2025-04-28 15:27:29 -06:00
bin bin/cat: add test for reading data from stdin 2025-06-13 08:25:54 -06:00
cddl dtrace.1: Mention providers in SEE ALSO 2025-06-14 19:49:56 +02:00
contrib bin/cat: add test for reading data from stdin 2025-06-13 08:25:54 -06:00
crypto krb5: Apply patches to build under FreeBSD 2025-06-04 19:53:04 -07:00
etc packages: fix ownership of /tmp and /dev 2025-06-04 06:38:48 +01:00
gnu build: remove the last vestiges of lint support 2025-06-06 00:55:34 +01:00
include ssp: Protect sig2str with proper visibility markers 2025-06-11 21:19:05 -06:00
kerberos5 build: remove the last vestiges of lint support 2025-06-06 00:55:34 +01:00
lib bectl: Use SPDX only license 2025-06-13 15:09:22 -04:00
libexec rc.d/mountcritlocal: Make sure zpools are imported for legacy ZFS 2025-06-14 21:39:36 -07:00
release packages: fix ownership of /tmp and /dev 2025-06-04 06:38:48 +01:00
rescue nvmf: Switch several ioctls to using nvlists 2024-12-30 13:52:21 -05:00
sbin ufshci: Introduce the ufshci(4) driver 2025-06-15 00:08:56 -06:00
secure build: remove the last vestiges of lint support 2025-06-06 00:55:34 +01:00
share wlan_gcmp.4: hook up to the build 2025-06-14 22:42:55 +00:00
stand stand: lua: add a more productive comment 2025-06-12 21:33:11 -05:00
sys ufshci: Introduce the ufshci(4) driver 2025-06-15 00:08:56 -06:00
targets build: remove the last vestiges of lint support 2025-06-06 00:55:34 +01:00
tests fusefs: add more checks for buggy FUSE servers 2025-06-13 15:00:25 -06:00
tools src.conf.5: Update MALLOC_PRODUCTION diag options 2025-06-13 15:20:59 -04:00
usr.bin fstat: identify kqueue, mqueue, and procdesc file descriptors 2025-06-13 14:33:02 -06:00
usr.sbin config.5: Document CONF_CFLAGS under 'makeoptions' 2025-06-13 16:57:51 -04:00
.arcconfig arcanist: use FreeBSD/git project repository instead of FreeBSD/svn 2022-08-23 14:16:41 +00:00
.arclint arc lint: ignore /tests/ in chmod 2017-12-19 03:38:06 +00:00
.cirrus.yml tests/ci: Pre-commit CI with CIRRUS-CI 2025-05-27 18:22:58 +02:00
.clang-format clang-format: Minor tweaks 2024-04-30 17:33:43 -04:00
.git-blame-ignore-revs git-blame-ignore-revs: iflib style(9) tweaks 2025-06-06 18:07:06 +08:00
.gitattributes Remove SVN related Git attributes 2023-12-26 10:28:28 -07:00
.gitignore .gitignore: add sys/*/compile 2024-02-02 09:20:36 -07:00
.mailmap mailmap: add my personal address 2025-05-07 12:35:12 +01:00
CONTRIBUTING.md CONTRIBUTING.md/style: spring cleaning 2024-05-10 15:07:03 -06:00
COPYRIGHT copyright: Happy New Year 2025 2025-01-01 00:04:28 +00:00
LOCKS Update LOCKS for Git 2023-12-26 10:28:25 -07:00
MAINTAINERS man filesystems: fix more xrefs after move to s4 2024-06-27 18:32:05 -06:00
Makefile universe: Update the default GCC toolchain to GCC 14 2025-03-03 11:51:53 -05:00
Makefile.inc1 Makefile.inc1: allow real-update-packages to be called independently 2025-06-12 19:21:44 -06:00
Makefile.libcompat build: remove the last vestiges of lint support 2025-06-06 00:55:34 +01:00
Makefile.sys.inc Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
ObsoleteFiles.inc zoneinfo: don't install version 2025-05-22 01:17:49 +08:00
README.md Update README.md to add pointer to release page. 2024-05-09 20:40:46 -06:00
RELNOTES RELNOTES: Add note for INADDR_ANY change 2025-05-24 14:21:22 -04:00
UPDATING UPDATING: document recent pf changes 2025-06-06 13:16:01 +02:00

FreeBSD Source:

This is the top level of the FreeBSD source directory.

FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms. A large community has continually developed it for more than thirty years. Its advanced networking, security, and storage features have made FreeBSD the platform of choice for many of the busiest web sites and most pervasive embedded networking and storage devices.

For copyright information, please see the file COPYRIGHT in this directory. Additional copyright information also exists for some sources in this tree - please see the specific source directories for more information.

The Makefile in this directory supports a number of targets for building components (or all) of the FreeBSD source tree. See build(7), config(8), FreeBSD handbook on building userland, and Handbook for kernels for more information, including setting make(1) variables.

For information on the CPU architectures and platforms supported by FreeBSD, see the FreeBSD website's Platforms page.

For official FreeBSD bootable images, see the release page.

Source Roadmap:

Directory Description
bin System/user commands.
cddl Various commands and libraries under the Common Development and Distribution License.
contrib Packages contributed by 3rd parties.
crypto Cryptography stuff (see crypto/README).
etc Template files for /etc.
gnu Commands and libraries under the GNU General Public License (GPL) or Lesser General Public License (LGPL). Please see gnu/COPYING and gnu/COPYING.LIB for more information.
include System include files.
kerberos5 Kerberos5 (Heimdal) package.
lib System libraries.
libexec System daemons.
release Release building Makefile & associated tools.
rescue Build system for statically linked /rescue utilities.
sbin System commands.
secure Cryptographic libraries and commands.
share Shared resources.
stand Boot loader sources.
sys Kernel sources (see sys/README.md).
targets Support for experimental DIRDEPS_BUILD
tests Regression tests which can be run by Kyua. See tests/README for additional information.
tools Utilities for regression testing and miscellaneous tasks.
usr.bin User commands.
usr.sbin System administration commands.

For information on synchronizing your source tree with one or more of the FreeBSD Project's development branches, please see FreeBSD Handbook.