2012-02-29 06:41:50 +00:00
|
|
|
#
|
|
|
|
# Kernel configuration file for the UFS Host Controller
|
|
|
|
#
|
|
|
|
# This code is based on drivers/scsi/ufs/Kconfig
|
2013-02-25 16:14:32 +00:00
|
|
|
# Copyright (C) 2011-2013 Samsung India Software Operations
|
|
|
|
#
|
|
|
|
# Authors:
|
|
|
|
# Santosh Yaraganavi <santosh.sy@samsung.com>
|
|
|
|
# Vinayak Holikatti <h.vinayak@samsung.com>
|
2012-02-29 06:41:50 +00:00
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
2013-02-25 16:14:32 +00:00
|
|
|
# See the COPYING file in the top-level directory or visit
|
|
|
|
# <http://www.gnu.org/licenses/gpl-2.0.html>
|
|
|
|
#
|
2012-02-29 06:41:50 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2013-02-25 16:14:32 +00:00
|
|
|
#
|
|
|
|
# This program is provided "AS IS" and "WITH ALL FAULTS" and
|
|
|
|
# without warranty of any kind. You are solely responsible for
|
|
|
|
# determining the appropriateness of using and distributing
|
|
|
|
# the program and assume all risks associated with your exercise
|
|
|
|
# of rights with respect to the program, including but not limited
|
|
|
|
# to infringement of third party rights, the risks and costs of
|
|
|
|
# program errors, damage to or loss of data, programs or equipment,
|
|
|
|
# and unavailability or interruption of operations. Under no
|
|
|
|
# circumstances will the contributor of this Program be liable for
|
|
|
|
# any damages of any kind arising from your use or distribution of
|
|
|
|
# this program.
|
2012-02-29 06:41:50 +00:00
|
|
|
|
|
|
|
config SCSI_UFSHCD
|
2013-02-25 16:14:33 +00:00
|
|
|
tristate "Universal Flash Storage Controller Driver Core"
|
2013-05-14 16:04:14 +00:00
|
|
|
depends on SCSI && SCSI_DMA
|
2014-09-25 12:32:34 +00:00
|
|
|
select PM_DEVFREQ
|
|
|
|
select DEVFREQ_GOV_SIMPLE_ONDEMAND
|
2016-03-17 12:29:52 +00:00
|
|
|
select NLS
|
2020-06-13 16:50:22 +00:00
|
|
|
help
|
2021-01-06 20:55:54 +00:00
|
|
|
This selects the support for UFS devices in Linux, say Y and make
|
2013-02-25 16:14:33 +00:00
|
|
|
sure that you know the name of your UFS host adapter (the card
|
|
|
|
inside your computer that "speaks" the UFS protocol, also
|
|
|
|
called UFS Host Controller), because you will be asked for it.
|
|
|
|
The module will be called ufshcd.
|
|
|
|
|
|
|
|
To compile this driver as a module, choose M here and read
|
2020-03-02 08:16:13 +00:00
|
|
|
<file:Documentation/scsi/ufs.rst>.
|
2013-02-25 16:14:33 +00:00
|
|
|
However, do not compile this as a module if your root file system
|
|
|
|
(the one containing the directory /) is located on a UFS device.
|
|
|
|
|
|
|
|
config SCSI_UFSHCD_PCI
|
|
|
|
tristate "PCI bus based UFS Controller support"
|
|
|
|
depends on SCSI_UFSHCD && PCI
|
2020-06-13 16:50:22 +00:00
|
|
|
help
|
2021-01-06 20:55:54 +00:00
|
|
|
This selects the PCI UFS Host Controller Interface. Select this if
|
|
|
|
you have UFS Host Controller with PCI Interface.
|
2013-02-25 16:14:33 +00:00
|
|
|
|
|
|
|
If you have a controller with this interface, say Y or M here.
|
|
|
|
|
|
|
|
If unsure, say N.
|
2016-05-11 11:21:33 +00:00
|
|
|
|
|
|
|
config SCSI_UFS_DWC_TC_PCI
|
|
|
|
tristate "DesignWare pci support using a G210 Test Chip"
|
2016-09-23 11:52:52 +00:00
|
|
|
depends on SCSI_UFSHCD_PCI
|
2020-06-13 16:50:22 +00:00
|
|
|
help
|
2016-05-11 11:21:33 +00:00
|
|
|
Synopsys Test Chip is a PHY for prototyping purposes.
|
|
|
|
|
|
|
|
If unsure, say N.
|
2013-02-26 12:34:45 +00:00
|
|
|
|
|
|
|
config SCSI_UFSHCD_PLATFORM
|
|
|
|
tristate "Platform bus based UFS Controller support"
|
|
|
|
depends on SCSI_UFSHCD
|
2021-01-06 04:08:22 +00:00
|
|
|
depends on HAS_IOMEM
|
2020-06-13 16:50:22 +00:00
|
|
|
help
|
2021-01-06 20:55:54 +00:00
|
|
|
This selects the UFS host controller support. Select this if
|
|
|
|
you have an UFS controller on Platform bus.
|
2013-02-26 12:34:45 +00:00
|
|
|
|
2021-01-06 20:55:54 +00:00
|
|
|
If you have a controller with this interface, say Y or M here.
|
2013-02-26 12:34:45 +00:00
|
|
|
|
|
|
|
If unsure, say N.
|
2015-01-15 14:32:37 +00:00
|
|
|
|
2018-09-20 13:08:30 +00:00
|
|
|
config SCSI_UFS_CDNS_PLATFORM
|
|
|
|
tristate "Cadence UFS Controller platform driver"
|
|
|
|
depends on SCSI_UFSHCD_PLATFORM
|
|
|
|
help
|
2021-01-06 20:55:54 +00:00
|
|
|
This selects the Cadence-specific additions to UFSHCD platform driver.
|
2018-09-20 13:08:30 +00:00
|
|
|
|
|
|
|
If unsure, say N.
|
|
|
|
|
2016-05-11 11:21:32 +00:00
|
|
|
config SCSI_UFS_DWC_TC_PLATFORM
|
|
|
|
tristate "DesignWare platform support using a G210 Test Chip"
|
|
|
|
depends on SCSI_UFSHCD_PLATFORM
|
2020-06-13 16:50:22 +00:00
|
|
|
help
|
2016-05-11 11:21:32 +00:00
|
|
|
Synopsys Test Chip is a PHY for prototyping purposes.
|
|
|
|
|
|
|
|
If unsure, say N.
|
|
|
|
|
2015-01-15 14:32:37 +00:00
|
|
|
config SCSI_UFS_QCOM
|
2015-10-28 11:15:46 +00:00
|
|
|
tristate "QCOM specific hooks to UFS controller platform driver"
|
2015-04-10 23:11:06 +00:00
|
|
|
depends on SCSI_UFSHCD_PLATFORM && ARCH_QCOM
|
2020-11-14 00:47:54 +00:00
|
|
|
select QCOM_SCM if SCSI_UFS_CRYPTO
|
2019-03-21 17:17:58 +00:00
|
|
|
select RESET_CONTROLLER
|
2015-01-15 14:32:37 +00:00
|
|
|
help
|
|
|
|
This selects the QCOM specific additions to UFSHCD platform driver.
|
|
|
|
UFS host on QCOM needs some vendor specific configuration before
|
|
|
|
accessing the hardware which includes PHY configuration and vendor
|
|
|
|
specific registers.
|
|
|
|
|
|
|
|
Select this if you have UFS controller on QCOM chipset.
|
|
|
|
If unsure, say N.
|
2018-07-17 09:36:56 +00:00
|
|
|
|
2019-03-16 05:04:47 +00:00
|
|
|
config SCSI_UFS_MEDIATEK
|
|
|
|
tristate "Mediatek specific hooks to UFS controller platform driver"
|
|
|
|
depends on SCSI_UFSHCD_PLATFORM && ARCH_MEDIATEK
|
|
|
|
select PHY_MTK_UFS
|
2021-06-02 02:42:00 +00:00
|
|
|
select RESET_TI_SYSCON
|
2019-03-16 05:04:47 +00:00
|
|
|
help
|
|
|
|
This selects the Mediatek specific additions to UFSHCD platform driver.
|
|
|
|
UFS host on Mediatek needs some vendor specific configuration before
|
|
|
|
accessing the hardware which includes PHY configuration and vendor
|
|
|
|
specific registers.
|
|
|
|
|
|
|
|
Select this if you have UFS controller on Mediatek chipset.
|
|
|
|
|
|
|
|
If unsure, say N.
|
|
|
|
|
2018-07-17 09:36:56 +00:00
|
|
|
config SCSI_UFS_HISI
|
|
|
|
tristate "Hisilicon specific hooks to UFS controller platform driver"
|
|
|
|
depends on (ARCH_HISI || COMPILE_TEST) && SCSI_UFSHCD_PLATFORM
|
2020-06-13 16:50:22 +00:00
|
|
|
help
|
2018-07-17 09:36:56 +00:00
|
|
|
This selects the Hisilicon specific additions to UFSHCD platform driver.
|
|
|
|
|
|
|
|
Select this if you have UFS controller on Hisilicon chipset.
|
|
|
|
If unsure, say N.
|
scsi: ufs: Add a bsg endpoint that supports UPIUs
For now, just provide an API to allocate and remove ufs-bsg node. We
will use this framework to manage ufs devices by sending UPIU
transactions.
For the time being, implements an empty bsg_request() - will add some
more functionality in coming patches.
Nonetheless, we reveal here the protocol we are planning to use: UFS
Transport Protocol Transactions. UFS transactions consist of packets
called UFS Protocol Information Units (UPIU).
There are UPIU’s defined for UFS SCSI commands, responses, data in and
data out, task management, utility functions, vendor functions,
transaction synchronization and control, and more.
By using UPIUs, we get access to the most fine-grained internals of this
protocol, and able to communicate with the device in ways, that are
sometimes beyond the capacity of the ufs driver.
Moreover and as a result, our core structure - ufs_bsg_node has a pretty
lean structure: using upiu transactions that contains the outmost
detailed info, so we don't really need complex constructs to support it.
Signed-off-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <Bart.VanAssche@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-10-07 14:30:35 +00:00
|
|
|
|
2019-11-08 16:48:57 +00:00
|
|
|
config SCSI_UFS_TI_J721E
|
|
|
|
tristate "TI glue layer for Cadence UFS Controller"
|
|
|
|
depends on OF && HAS_IOMEM && (ARCH_K3 || COMPILE_TEST)
|
|
|
|
help
|
|
|
|
This selects driver for TI glue layer for Cadence UFS Host
|
|
|
|
Controller IP.
|
|
|
|
|
|
|
|
Selects this if you have TI platform with UFS controller.
|
|
|
|
If unsure, say N.
|
|
|
|
|
scsi: ufs: Add a bsg endpoint that supports UPIUs
For now, just provide an API to allocate and remove ufs-bsg node. We
will use this framework to manage ufs devices by sending UPIU
transactions.
For the time being, implements an empty bsg_request() - will add some
more functionality in coming patches.
Nonetheless, we reveal here the protocol we are planning to use: UFS
Transport Protocol Transactions. UFS transactions consist of packets
called UFS Protocol Information Units (UPIU).
There are UPIU’s defined for UFS SCSI commands, responses, data in and
data out, task management, utility functions, vendor functions,
transaction synchronization and control, and more.
By using UPIUs, we get access to the most fine-grained internals of this
protocol, and able to communicate with the device in ways, that are
sometimes beyond the capacity of the ufs driver.
Moreover and as a result, our core structure - ufs_bsg_node has a pretty
lean structure: using upiu transactions that contains the outmost
detailed info, so we don't really need complex constructs to support it.
Signed-off-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <Bart.VanAssche@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-10-07 14:30:35 +00:00
|
|
|
config SCSI_UFS_BSG
|
|
|
|
bool "Universal Flash Storage BSG device node"
|
|
|
|
depends on SCSI_UFSHCD
|
|
|
|
select BLK_DEV_BSGLIB
|
|
|
|
help
|
|
|
|
Universal Flash Storage (UFS) is SCSI transport specification for
|
|
|
|
accessing flash storage on digital cameras, mobile phones and
|
|
|
|
consumer electronic devices.
|
|
|
|
A UFS controller communicates with a UFS device by exchanging
|
|
|
|
UFS Protocol Information Units (UPIUs).
|
|
|
|
UPIUs can not only be used as a transport layer for the SCSI protocol
|
|
|
|
but are also used by the UFS native command set.
|
|
|
|
This transport driver supports exchanging UFS protocol information units
|
|
|
|
with a UFS device. See also the ufshcd driver, which is a SCSI driver
|
|
|
|
that supports UFS devices.
|
|
|
|
|
|
|
|
Select this if you need a bsg device node for your UFS controller.
|
|
|
|
If unsure, say N.
|
2020-05-28 01:16:57 +00:00
|
|
|
|
|
|
|
config SCSI_UFS_EXYNOS
|
2021-09-24 13:26:58 +00:00
|
|
|
tristate "Exynos specific hooks to UFS controller platform driver"
|
2020-05-28 01:16:57 +00:00
|
|
|
depends on SCSI_UFSHCD_PLATFORM && (ARCH_EXYNOS || COMPILE_TEST)
|
|
|
|
help
|
2021-09-24 13:26:58 +00:00
|
|
|
This selects the Samsung Exynos SoC specific additions to UFSHCD
|
|
|
|
platform driver. UFS host on Samsung Exynos SoC includes HCI and
|
|
|
|
UNIPRO layer, and associates with UFS-PHY driver.
|
2020-05-28 01:16:57 +00:00
|
|
|
|
2021-09-24 13:26:58 +00:00
|
|
|
Select this if you have UFS host controller on Samsung Exynos SoC.
|
2020-05-28 01:16:57 +00:00
|
|
|
If unsure, say N.
|
2020-07-06 20:04:13 +00:00
|
|
|
|
|
|
|
config SCSI_UFS_CRYPTO
|
|
|
|
bool "UFS Crypto Engine Support"
|
|
|
|
depends on SCSI_UFSHCD && BLK_INLINE_ENCRYPTION
|
|
|
|
help
|
|
|
|
Enable Crypto Engine Support in UFS.
|
|
|
|
Enabling this makes it possible for the kernel to use the crypto
|
|
|
|
capabilities of the UFS device (if present) to perform crypto
|
|
|
|
operations on data being transferred to/from the device.
|
scsi: ufs: ufshpb: Introduce Host Performance Buffer feature
Implement Host Performance Buffer (HPB) initialization and add function
calls to UFS core driver.
NAND flash-based storage devices, including UFS, have mechanisms to
translate logical addresses of I/O requests to the corresponding physical
addresses of the flash storage. In UFS, logical-to-physical-address (L2P)
map data, which is required to identify the physical address for the
requested I/Os, can only be partially stored in SRAM from NAND flash. Due
to this partial loading, accessing the flash address area, where the L2P
information for that address is not loaded in the SRAM, can result in
serious performance degradation.
The basic concept of HPB is to cache L2P mapping entries in host system
memory so that both physical block address (PBA) and logical block address
(LBA) can be delivered in HPB read command. The HPB read command allows to
read data faster than a regular read command in UFS since it provides the
physical address (HPB Entry) of the desired logical block in addition to
its logical address. The UFS device can access the physical block in NAND
directly without searching and uploading L2P mapping table. This improves
read performance because the NAND read operation for uploading L2P mapping
table is removed.
In HPB initialization, the host checks if the UFS device supports HPB
feature and retrieves related device capabilities. Then, HPB parameters are
configured in the device.
Total start-up time of popular applications was measured and the difference
observed between HPB being enabled and disabled. Popular applications are
12 game apps and 24 non-game apps. Each test cycle consists of running 36
applications in sequence. We repeated the cycle for observing performance
improvement by L2P mapping cache hit in HPB.
The following is the test environment:
- kernel version: 4.4.0
- RAM: 8GB
- UFS 2.1 (64GB)
Results:
+-------+----------+----------+-------+
| cycle | baseline | with HPB | diff |
+-------+----------+----------+-------+
| 1 | 272.4 | 264.9 | -7.5 |
| 2 | 250.4 | 248.2 | -2.2 |
| 3 | 226.2 | 215.6 | -10.6 |
| 4 | 230.6 | 214.8 | -15.8 |
| 5 | 232.0 | 218.1 | -13.9 |
| 6 | 231.9 | 212.6 | -19.3 |
+-------+----------+----------+-------+
We also measured HPB performance using iozone:
$ iozone -r 4k -+n -i2 -ecI -t 16 -l 16 -u 16 -s $IO_RANGE/16 -F \
mnt/tmp_1 mnt/tmp_2 mnt/tmp_3 mnt/tmp_4 mnt/tmp_5 mnt/tmp_6 mnt/tmp_7 \
mnt/tmp_8 mnt/tmp_9 mnt/tmp_10 mnt/tmp_11 mnt/tmp_12 mnt/tmp_13 \
mnt/tmp_14 mnt/tmp_15 mnt/tmp_16
Results:
+----------+--------+---------+
| IO range | HPB on | HPB off |
+----------+--------+---------+
| 1 GB | 294.8 | 300.87 |
| 4 GB | 293.51 | 179.35 |
| 8 GB | 294.85 | 162.52 |
| 16 GB | 293.45 | 156.26 |
| 32 GB | 277.4 | 153.25 |
+----------+--------+---------+
Link: https://lore.kernel.org/r/20210712085830epcms2p8c1288b7f7a81b044158a18232617b572@epcms2p8
Reported-by: kernel test robot <lkp@intel.com>
Tested-by: Bean Huo <beanhuo@micron.com>
Tested-by: Can Guo <cang@codeaurora.org>
Tested-by: Stanley Chu <stanley.chu@mediatek.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Can Guo <cang@codeaurora.org>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Acked-by: Avri Altman <Avri.Altman@wdc.com>
Signed-off-by: Daejun Park <daejun7.park@samsung.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-07-12 08:58:30 +00:00
|
|
|
|
|
|
|
config SCSI_UFS_HPB
|
|
|
|
bool "Support UFS Host Performance Booster"
|
|
|
|
depends on SCSI_UFSHCD
|
|
|
|
help
|
|
|
|
The UFS HPB feature improves random read performance. It caches
|
|
|
|
L2P (logical to physical) map of UFS to host DRAM. The driver uses HPB
|
|
|
|
read command by piggybacking physical page number for bypassing FTL (flash
|
|
|
|
translation layer)'s L2P address translation.
|
2021-07-22 03:34:39 +00:00
|
|
|
|
|
|
|
config SCSI_UFS_FAULT_INJECTION
|
|
|
|
bool "UFS Fault Injection Support"
|
|
|
|
depends on SCSI_UFSHCD && FAULT_INJECTION
|
|
|
|
help
|
|
|
|
Enable fault injection support in the UFS driver. This makes it easier
|
|
|
|
to test the UFS error handler and abort handler.
|
2021-09-15 06:04:06 +00:00
|
|
|
|
|
|
|
config SCSI_UFS_HWMON
|
|
|
|
bool "UFS Temperature Notification"
|
2021-09-27 08:46:15 +00:00
|
|
|
depends on SCSI_UFSHCD=HWMON || HWMON=y
|
2021-09-15 06:04:06 +00:00
|
|
|
help
|
|
|
|
This provides support for UFS hardware monitoring. If enabled,
|
|
|
|
a hardware monitoring device will be created for the UFS device.
|
|
|
|
|
|
|
|
If unsure, say N.
|