summaryrefslogtreecommitdiffstats
path: root/drivers/ufs/host/ufs-qcom.h
diff options
context:
space:
mode:
authorNitin Rawat <quic_nitirawa@quicinc.com>2023-09-05 07:23:57 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2023-09-14 03:15:40 +0200
commitb4e13e1ae95e7d9ad3dd2e1ca98cd1328d913fb8 (patch)
tree4f6abb408dfe916a09fcc0732d3183c570d95d50 /drivers/ufs/host/ufs-qcom.h
parentscsi: ufs: qcom: Update MAX_CORE_CLK_1US_CYCLES for UFS V4 and above (diff)
downloadlinux-b4e13e1ae95e7d9ad3dd2e1ca98cd1328d913fb8.tar.xz
linux-b4e13e1ae95e7d9ad3dd2e1ca98cd1328d913fb8.zip
scsi: ufs: qcom: Add multiple frequency support for MAX_CORE_CLK_1US_CYCLES
Qualcomm UFS Controller V4 and above supports multiple unipro frequencies like 403MHz, 300MHz, 202MHz, 150 MHz, 75Mhz, 37.5 MHz. Current code supports only 150MHz and 75MHz which have performance impact due to low UFS controller frequencies. For targets which supports frequencies other than 150 MHz and 75 Mhz, needs an update of MAX_CORE_CLK_1US_CYCLES to match the configured frequency to avoid functionality issues. Add multiple frequency support for MAX_CORE_CLK_1US_CYCLES based on the frequency configured. Co-developed-by: Naveen Kumar Goud Arepalli <quic_narepall@quicinc.com> Signed-off-by: Naveen Kumar Goud Arepalli <quic_narepall@quicinc.com> Signed-off-by: Nitin Rawat <quic_nitirawa@quicinc.com> Link: https://lore.kernel.org/r/20230905052400.13935-3-quic_nitirawa@quicinc.com Reviewed-by: Can Guo <quic_cang@quicinc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/ufs/host/ufs-qcom.h')
-rw-r--r--drivers/ufs/host/ufs-qcom.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/ufs/host/ufs-qcom.h b/drivers/ufs/host/ufs-qcom.h
index 8a9d3dbec297..3c6ef1259af3 100644
--- a/drivers/ufs/host/ufs-qcom.h
+++ b/drivers/ufs/host/ufs-qcom.h
@@ -245,6 +245,7 @@ ufs_qcom_get_debug_reg_offset(struct ufs_qcom_host *host, u32 reg)
#define ufs_qcom_is_link_off(hba) ufshcd_is_link_off(hba)
#define ufs_qcom_is_link_active(hba) ufshcd_is_link_active(hba)
#define ufs_qcom_is_link_hibern8(hba) ufshcd_is_link_hibern8(hba)
+#define ceil(freq, div) ((freq) % (div) == 0 ? ((freq)/(div)) : ((freq)/(div) + 1))
int ufs_qcom_testbus_config(struct ufs_qcom_host *host);