scsi: ufs: UFS crypto API
authorSatya Tangirala <satyat@google.com>
Mon, 6 Jul 2020 20:04:13 +0000 (20:04 +0000)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 8 Jul 2020 05:23:29 +0000 (01:23 -0400)
commit70297a8ac7a7a4a3284c2eb20fefefbe72dab338
treedbfb9029c89a6ecea3d25fa59ebd4e955df018a5
parent5e7341e1f9ecaee99d47d1f602c3d728c7fcb956
scsi: ufs: UFS crypto API

Introduce functions to manipulate UFS inline encryption hardware in line
with the JEDEC UFSHCI v2.1 specification and to work with the block keyslot
manager.

The UFS crypto API will assume by default that a vendor driver doesn't
support UFS crypto, even if the hardware advertises the capability, because
a lot of hardware requires some special handling that's not specified in
the aforementioned JEDEC spec. Each vendor driver must explicitly set
hba->caps |= UFSHCD_CAP_CRYPTO before ufshcd_hba_init_crypto_capabilities()
is called to opt-in to UFS crypto support.

Link: https://lore.kernel.org/r/20200706200414.2027450-3-satyat@google.com
Reviewed-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: Satya Tangirala <satyat@google.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/Kconfig
drivers/scsi/ufs/Makefile
drivers/scsi/ufs/ufshcd-crypto.c [new file with mode: 0644]
drivers/scsi/ufs/ufshcd-crypto.h [new file with mode: 0644]
drivers/scsi/ufs/ufshcd.h