aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ufs/ufshcd.h
diff options
context:
space:
mode:
authorSatya Tangirala <satyat@google.com>2020-07-06 20:04:13 +0000
committerMartin K. Petersen <martin.petersen@oracle.com>2020-07-08 01:23:29 -0400
commit70297a8ac7a7a4a3284c2eb20fefefbe72dab338 (patch)
treedbfb9029c89a6ecea3d25fa59ebd4e955df018a5 /drivers/scsi/ufs/ufshcd.h
parentscsi: ufs: UFS driver v2.1 spec crypto additions (diff)
downloadlinux-dev-70297a8ac7a7a4a3284c2eb20fefefbe72dab338.tar.xz
linux-dev-70297a8ac7a7a4a3284c2eb20fefefbe72dab338.zip
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>
Diffstat (limited to '')
-rw-r--r--drivers/scsi/ufs/ufshcd.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
index 22c035110208..0fe95887cb93 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -32,6 +32,7 @@
#include <linux/regulator/consumer.h>
#include <linux/bitfield.h>
#include <linux/devfreq.h>
+#include <linux/keyslot-manager.h>
#include "unipro.h"
#include <asm/irq.h>
@@ -620,6 +621,10 @@ struct ufs_hba_variant_params {
* @is_urgent_bkops_lvl_checked: keeps track if the urgent bkops level for
* device is known or not.
* @scsi_block_reqs_cnt: reference counting for scsi block requests
+ * @crypto_capabilities: Content of crypto capabilities register (0x100)
+ * @crypto_cap_array: Array of crypto capabilities
+ * @crypto_cfg_register: Start of the crypto cfg array
+ * @ksm: the keyslot manager tied to this hba
*/
struct ufs_hba {
void __iomem *mmio_base;
@@ -742,6 +747,13 @@ struct ufs_hba {
bool wb_buf_flush_enabled;
bool wb_enabled;
struct delayed_work rpm_dev_flush_recheck_work;
+
+#ifdef CONFIG_SCSI_UFS_CRYPTO
+ union ufs_crypto_capabilities crypto_capabilities;
+ union ufs_crypto_cap_entry *crypto_cap_array;
+ u32 crypto_cfg_register;
+ struct blk_keyslot_manager ksm;
+#endif
};
/* Returns true if clocks can be gated. Otherwise false */