Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0bde03e7 authored by Gaurav Kashyap's avatar Gaurav Kashyap
Browse files

scsi: ufs: Make crypto updates on QTI ufs



Make v6 updates on ufshcd-qti.c to match the updates
in ufshcd.c. Also compile UFS crypto when using
ufshcd-qti.

Change-Id: I1799b9b7f0aeee2cb76599403ae8461457a3fcd2
Signed-off-by: default avatarGaurav Kashyap <gaurkash@codeaurora.org>
parent addcafbc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -171,7 +171,7 @@ config SCSI_UFS_BSG

config SCSI_UFS_CRYPTO
	bool "UFS Crypto Engine Support"
	depends on SCSI_UFSHCD && BLK_INLINE_ENCRYPTION
	depends on (SCSI_UFSHCD || SCSI_UFSHCD_QTI) && BLK_INLINE_ENCRYPTION
	help
	  Enable Crypto Engine Support in UFS.
	  Enabling this makes it possible for the kernel to use the crypto
+1 −0
Original line number Diff line number Diff line
@@ -15,3 +15,4 @@ obj-$(CONFIG_SCSI_UFSHCD_QTI) += ufshcd-qti-core.o
ufshcd-qti-core-y		+= ufshcd-qti.o ufs-sysfs.o
ufshcd-qti-core-$(CONFIG_SCSI_UFS_BSG)	+= ufs_bsg.o
ufshcd-core-$(CONFIG_SCSI_UFS_CRYPTO) += ufshcd-crypto.o
ufshcd-qti-core-$(CONFIG_SCSI_UFS_CRYPTO) += ufshcd-crypto.o
+6 −2
Original line number Diff line number Diff line
@@ -2890,12 +2890,14 @@ static int ufshcd_prepare_req_desc_hdr(struct ufshcd_lrb *lrbp,

	/* Transfer request descriptor header fields */
	if (lrbp->crypto_enable) {
#if IS_ENABLED(CONFIG_SCSI_UFS_CRYPTO)
		dword_0 |= UTP_REQ_DESC_CRYPTO_ENABLE_CMD;
		dword_0 |= lrbp->crypto_key_slot;
		req_desc->header.dword_1 =
			cpu_to_le32((u32)lrbp->data_unit_num);
			cpu_to_le32(lower_32_bits(lrbp->data_unit_num));
		req_desc->header.dword_3 =
			cpu_to_le32((u32)(lrbp->data_unit_num >> 32));
			cpu_to_le32(upper_32_bits(lrbp->data_unit_num));
#endif /* CONFIG_SCSI_UFS_CRYPTO */
	} else {
		/* dword_1 and dword_3 are reserved, hence they are set to 0 */
		req_desc->header.dword_1 = 0;
@@ -3309,7 +3311,9 @@ static int ufshcd_compose_dev_cmd(struct ufs_hba *hba,
	lrbp->task_tag = tag;
	lrbp->lun = 0; /* device management cmd is not specific to any LUN */
	lrbp->intr_cmd = true; /* No interrupt aggregation */
#if IS_ENABLED(CONFIG_SCSI_UFS_CRYPTO)
	lrbp->crypto_enable = false; /* No crypto operations */
#endif
	hba->dev_cmd.type = cmd_type;

	return ufshcd_comp_devman_upiu(hba, lrbp);