diff options
author | Stanley Chu <stanley.chu@mediatek.com> | 2020-09-14 08:00:51 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2020-09-23 03:37:02 +0300 |
commit | 590b0d2372fef09f9755f40e43358fabf5a7fd63 (patch) | |
tree | 53b68f2042db9fec7e97ab02c8a5b6ccdd8c613e /drivers/scsi/ufs/ufs-mediatek.h | |
parent | 3d1a99e2b5400fd32ec647b290340b5ed091d3ae (diff) | |
download | linux-590b0d2372fef09f9755f40e43358fabf5a7fd63.tar.xz |
scsi: ufs-mediatek: Support performance mode for inline encryption engine
Some MediaTek UFS platforms support high-performance mode that inline
encryption engine can be boosted while UFS is not clock-gated.
The high-performance mode will be enabled if all below conditions are
well-declaired in device tree,
- Proper platform-specific compatible string which enables the host
capability "UFS_MTK_CAP_BOOST_CRYPT_ENGINE".
- "dvfsrc-vcore" node is available in this platform.
- Required minimum vcore voltage for high-performance mode.
- Clock mux and clock parents of inline encryption engine for both
"low-power mode" and "high-performance mode".
Link: https://lore.kernel.org/r/20200914050052.3974-2-stanley.chu@mediatek.com
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/ufs/ufs-mediatek.h')
-rw-r--r-- | drivers/scsi/ufs/ufs-mediatek.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/scsi/ufs/ufs-mediatek.h b/drivers/scsi/ufs/ufs-mediatek.h index 5c32d5f52759..2b6a1312c9bc 100644 --- a/drivers/scsi/ufs/ufs-mediatek.h +++ b/drivers/scsi/ufs/ufs-mediatek.h @@ -89,9 +89,31 @@ enum { TX_CLK_GATE_EN = 3, }; +/* + * Host capability + */ +enum ufs_mtk_host_caps { + UFS_MTK_CAP_BOOST_CRYPT_ENGINE = 1 << 0, +}; + +struct ufs_mtk_crypt_cfg { + struct regulator *reg_vcore; + struct clk *clk_crypt_perf; + struct clk *clk_crypt_mux; + struct clk *clk_crypt_lp; + int vcore_volt; +}; + +struct ufs_mtk_host_cfg { + enum ufs_mtk_host_caps caps; +}; + struct ufs_mtk_host { struct ufs_hba *hba; struct phy *mphy; + struct ufs_mtk_host_cfg *cfg; + struct ufs_mtk_crypt_cfg *crypt; + enum ufs_mtk_host_caps caps; struct reset_control *hci_reset; struct reset_control *unipro_reset; struct reset_control *crypto_reset; |