Skip to content

Commit 88f4d3a

Browse files
Ram Kumar Dwivedimartinkpetersen
authored andcommitted
scsi: ufs: ufs-qcom: Add support for limiting HS gear and rate
Add support to limit Tx/Rx gear and rate during UFS initialization based on DT property. Also update the phy_gear to ensure PHY calibrations align with the required gear and rate. Signed-off-by: Ram Kumar Dwivedi <[email protected]> Reviewed-by: Alim Akhtar <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 1cc577e commit 88f4d3a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

drivers/ufs/host/ufs-qcom.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,6 +1092,18 @@ static void ufs_qcom_set_phy_gear(struct ufs_qcom_host *host)
10921092
}
10931093
}
10941094

1095+
static void ufs_qcom_parse_gear_limits(struct ufs_hba *hba)
1096+
{
1097+
struct ufs_qcom_host *host = ufshcd_get_variant(hba);
1098+
struct ufs_host_params *host_params = &host->host_params;
1099+
u32 hs_gear_old = host_params->hs_tx_gear;
1100+
1101+
ufshcd_parse_gear_limits(hba, host_params);
1102+
if (host_params->hs_tx_gear != hs_gear_old) {
1103+
host->phy_gear = host_params->hs_tx_gear;
1104+
}
1105+
}
1106+
10951107
static void ufs_qcom_set_host_params(struct ufs_hba *hba)
10961108
{
10971109
struct ufs_qcom_host *host = ufshcd_get_variant(hba);
@@ -1333,6 +1345,7 @@ static int ufs_qcom_init(struct ufs_hba *hba)
13331345
ufs_qcom_advertise_quirks(hba);
13341346
ufs_qcom_set_host_params(hba);
13351347
ufs_qcom_set_phy_gear(host);
1348+
ufs_qcom_parse_gear_limits(hba);
13361349

13371350
err = ufs_qcom_ice_init(host);
13381351
if (err)

0 commit comments

Comments
 (0)