Skip to content

Commit deac9ad

Browse files
petegriffinmartinkpetersen
authored andcommitted
scsi: ufs: exynos: Enable PRDT pre-fetching with UFSHCD_CAP_CRYPTO
PRDT_PREFETCH_ENABLE[31] bit should be set when desctype field of fmpsecurity0 register is type2 (double file encryption) or type3 (support for file and disk encryption). Setting this bit enables PRDT pre-fetching on both TXPRDT and RXPRDT. Signed-off-by: Peter Griffin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 7f05fd9 commit deac9ad

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/ufs/host/ufs-exynos.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* Exynos's Vendor specific registers for UFSHCI
3535
*/
3636
#define HCI_TXPRDT_ENTRY_SIZE 0x00
37-
#define PRDT_PREFECT_EN BIT(31)
37+
#define PRDT_PREFETCH_EN BIT(31)
3838
#define HCI_RXPRDT_ENTRY_SIZE 0x04
3939
#define HCI_1US_TO_CNT_VAL 0x0C
4040
#define CNT_VAL_1US_MASK 0x3FF
@@ -1098,12 +1098,17 @@ static int exynos_ufs_post_link(struct ufs_hba *hba)
10981098
struct exynos_ufs *ufs = ufshcd_get_variant(hba);
10991099
struct phy *generic_phy = ufs->phy;
11001100
struct exynos_ufs_uic_attr *attr = ufs->drv_data->uic_attr;
1101+
u32 val = ilog2(DATA_UNIT_SIZE);
11011102

11021103
exynos_ufs_establish_connt(ufs);
11031104
exynos_ufs_fit_aggr_timeout(ufs);
11041105

11051106
hci_writel(ufs, 0xa, HCI_DATA_REORDER);
1106-
hci_writel(ufs, ilog2(DATA_UNIT_SIZE), HCI_TXPRDT_ENTRY_SIZE);
1107+
1108+
if (hba->caps & UFSHCD_CAP_CRYPTO)
1109+
val |= PRDT_PREFETCH_EN;
1110+
hci_writel(ufs, val, HCI_TXPRDT_ENTRY_SIZE);
1111+
11071112
hci_writel(ufs, ilog2(DATA_UNIT_SIZE), HCI_RXPRDT_ENTRY_SIZE);
11081113
hci_writel(ufs, (1 << hba->nutrs) - 1, HCI_UTRL_NEXUS_TYPE);
11091114
hci_writel(ufs, (1 << hba->nutmrs) - 1, HCI_UTMRL_NEXUS_TYPE);

0 commit comments

Comments
 (0)