1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
|
.\"
.\" Copyright (c) 2025, Samsung Electronics Co., Ltd.
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" ufshci driver man page.
.\"
.\" Author: Jaeyoon Choi <j_yoon.choi@samsung.com>
.\"
.Dd July 17, 2025
.Dt UFSHCI 4
.Os
.Sh NAME
.Nm ufshci
.Nd Universal Flash Storage Host Controller Interface driver
.Sh SYNOPSIS
To compile this driver into the kernel,
place the following line in the kernel configuration file:
.Bd -ragged -offset indent
.Cd "device ufshci"
.Ed
.Pp
Or, to load the driver as a module at boot, place the following line in
.Xr loader.conf 5 :
.Bd -literal -offset indent
ufshci_load="YES"
.Ed
.Sh DESCRIPTION
Universal Flash Storage (UFS) is a low-power, high-performance storage
standard composed of a host controller and a single target device.
.Pp
The driver currently provides:
.Bl -bullet
.It
Initialization of the host controller and the target device
.It
Handling of UFS Interconnect (UIC) commands
.It
Support for UTP Transfer Requests (UTR) and UTP Task Management Requests (UTMR)
.It
Support for the SCSI command set
.It
Operation in the legacy single-doorbell queue mode
.It
Support for the PCI Express bus
.El
.Pp
After initialization, the controller is registered with the
.Xr cam 4
subsystem and its logical unit appears as the device node
.Pa /dev/daX .
.Pp
The driver is under active development; upcoming work includes full
UFS 4.1 feature coverage, additional power-management modes, and
ACPI/FDT-based attach support.
.Sh HARDWARE
The
.Nm
driver supports both host controllers and devices implementing the
Universal Flash Storage Host Controller Interface 4.1 and earlier.
.Sh CONFIGURATION
The
.Nm
driver currently operates with a single doorbell (one I/O-queue), so any
tunables that change the queue count are ignored.
When Multi-Circular Queue (MCQ) support is added and multiple queues
become available, the following queue count tunable values will take effect:
.Pp
To force a single I/O queue pair shared by all CPUs, set the following
tunable value in loader.conf(5):
.Bd -literal -offset indent
hw.ufshci.per_cpu_io_queues=0
.Ed
.Pp
To assign more than one CPU per I/O queue pair, thereby reducing the
number of MSI-X vectors consumed by the device, set the following tunable
value in loader.conf(5):
.Bd -literal -offset indent
hw.ufshci.min_cpus_per_ioq=X
.Ed
.Pp
To change the I/O command timeout value (in seconds), set the following tunable
value in loader.conf(5):
.Bd -literal -offset indent
hw.ufshci.timeout_period=X
.Ed
.Pp
To change the I/O command retry count, set the following tunable value in
loader.conf(5):
.Bd -literal -offset indent
hw.ufshci.retry_count=X
.Ed
.Pp
To force the driver to use legacy INTx interrupts, set the following tunable
value in loader.conf(5):
.br
(Note: until MCQ support is available the driver always uses legacy INTx, so
this value effectively remains 1)
.Bd -literal -offset indent
hw.ufshci.force_intx=1
.Ed
.Sh SYSCTL VARIABLES
The following controller-level
.Xr sysctl 8
nodes are currently implemented:
.Bl -tag -width indent
.It Va dev.ufshci.0.num_failures
(R) Number of command failures for the entire controller.
.It Va dev.ufshci.0.num_retries
(R) Number of command retries for the entire controller.
.It Va dev.ufshci.0.num_intr_handler_calls
(R) Number of times the interrupt handler has been called.
.It Va dev.ufshci.0.num_cmds
(R) Total number of commands issued by the controller.
.It Va dev.ufshci.0.timeout_period
(RW) Configured timeout period (in seconds).
.It Va dev.ufshci.0.cap
(R) Host controller capabilities register value.
.It Va dev.ufshci.0.num_io_queues
(R) Number of I/O-queue pairs.
.It Va dev.ufshci.0.io_queue_mode
(R) Indicates single doorbell mode or multi circular queue mode.
.It Va dev.ufshci.0.minor_version
(R) Host controller minor version.
.It Va dev.ufshci.0.major_version
(R) Host controller major version.
.It Va dev.ufshci.0.wb_enabled
(R) WriteBooster enable/disable.
.It Va dev.ufshci.0.wb_flush_enabled
(R) WriteBooster flush enable/disable.
.It Va dev.ufshci.0.wb_buffer_type
(R) WriteBooster type.
.It Va dev.ufshci.0.wb_buffer_size_mb
(R) WriteBooster buffer size in MB.
.It Va dev.ufshci.0.wb_user_space_config_option
(R) WriteBooster preserve user space mode.
.It Va dev.ufshci.0.auto_hibernation_supported
(R) Device auto hibernation support.
.It Va dev.ufshci.0.auto_hibernate_idle_timer_value
(R) Auto-Hibernate Idle Timer Value (in microseconds).
.It Va dev.ufshci.0.power_mode_supported
(R) Device power mode support.
.It Va dev.ufshci.0.power_mode
(R) Current device power mode.
.It Va dev.ufshci.0.tx_rx_power_mode
(R) Current TX/RX PA_PWRMode value.
.It Va dev.ufshci.0.max_tx_lanes
(R) Maximum available TX data lanes.
.It Va dev.ufshci.0.max_rx_lanes
(R) Maximum available RX data lanes.
.It Va dev.ufshci.0.tx_lanes
(R) Active TX data lanes.
.It Va dev.ufshci.0.rx_lanes
(R) Active RX data lanes.
.It Va dev.ufshci.0.max_rx_hs_gear
(R) Maximum available RX HS gear.
.It Va dev.ufshci.0.hs_gear
(R) Active HS gear.
.It Va dev.ufshci.0.utmrq.num_failures
(R) Number of failed UTP task-management requests.
.It Va dev.ufshci.0.utmrq.num_retries
(R) Number of retried UTP task-management requests.
.It Va dev.ufshci.0.utmrq.num_intr_handler_calls
(R) Number of interrupt handler calls caused by UTP task-management requests.
.It Va dev.ufshci.0.utmrq.num_cmds
(R) Number of UTP task-management requests issued.
.It Va dev.ufshci.0.utmrq.cq_head
(R) Current location of the UTP task-management completion queue head.
.It Va dev.ufshci.0.utmrq.sq_tail
(R) Current location of the UTP task-management submission queue tail.
.It Va dev.ufshci.0.utmrq.sq_head
(R) Current location of the UTP task-management submission queue head.
.It Va dev.ufshci.0.utmrq.num_trackers
(R) Number of trackers in the UTP task-management queue.
.It Va dev.ufshci.0.utmrq.num_entries
(R) Number of entries in the UTP task-management queue.
.It Va dev.ufshci.0.ioq.0.num_failures
(R) Number of failed UTP transfer requests.
.It Va dev.ufshci.0.ioq.0.num_retries
(R) Number of retried UTP transfer requests.
.It Va dev.ufshci.0.ioq.0.num_intr_handler_calls
(R) Number of interrupt-handler calls caused by UTP transfer requests.
.It Va dev.ufshci.0.ioq.0.num_cmds
(R) Number of UTP transfer requests issued.
.It Va dev.ufshci.0.ioq.0.cq_head
(R) Current location of the UTP transfer completion queue head.
.It Va dev.ufshci.0.ioq.0.sq_tail
(R) Current location of the UTP transfer submission queue tail.
.It Va dev.ufshci.0.ioq.0.sq_head
(R) Current location of the UTP transfer submission queue head.
.It Va dev.ufshci.0.ioq.0.num_trackers
(R) Number of trackers in the UTP transfer queue.
.It Va dev.ufshci.0.ioq.0.num_entries
(R) Number of entries in the UTP transfer queue.
.El
.Sh SEE ALSO
.Xr cam 4 ,
.Xr pci 4 ,
.Xr disk 9
.Sh HISTORY
The
.Nm
driver first appeared in
.Fx 15.0 .
.Sh AUTHORS
.An -nosplit
The
.Nm
driver was developed by Samsung Electronics and originally written by
.An Jaeyoon Choi Aq Mt j_yoon.choi@samsung.com .
.Pp
This manual page was written by
.An Jaeyoon Choi Aq Mt j_yoon.choi@samsung.com .
|