diff options
author | Marek Vasut <marek.vasut+renesas@mailbox.org> | 2023-08-16 17:05:51 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-08-24 13:47:43 -0400 |
commit | f430151e105b055abd687a456c3980b3674eeb42 (patch) | |
tree | bbd29b730a71d16dac1edbee83354061cb997c8b /drivers | |
parent | 91913a1aa2ffeb7278d7d4e4bc51565bb38cebeb (diff) | |
download | u-boot-f430151e105b055abd687a456c3980b3674eeb42.tar.gz u-boot-f430151e105b055abd687a456c3980b3674eeb42.tar.bz2 u-boot-f430151e105b055abd687a456c3980b3674eeb42.zip |
ufs: Add UFSHCD_QUIRK_HIBERN_FASTAUTO
Add UFSHCD_QUIRK_HIBERN_FASTAUTO quirk for host controllers which supports
auto-hibernate the capability but only FASTAUTO mode.
Ported from Linux kernel commit
2f11bbc2c7f3 ("scsi: ufs: core: Add UFSHCD_QUIRK_HIBERN_FASTAUTO")
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Tested-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ufs/ufs.c | 9 | ||||
-rw-r--r-- | drivers/ufs/ufs.h | 6 |
2 files changed, 13 insertions, 2 deletions
diff --git a/drivers/ufs/ufs.c b/drivers/ufs/ufs.c index da0550d98c..261ae2843c 100644 --- a/drivers/ufs/ufs.c +++ b/drivers/ufs/ufs.c @@ -1631,8 +1631,13 @@ static int ufshcd_get_max_pwr_mode(struct ufs_hba *hba) if (hba->max_pwr_info.is_valid) return 0; - pwr_info->pwr_tx = FAST_MODE; - pwr_info->pwr_rx = FAST_MODE; + if (hba->quirks & UFSHCD_QUIRK_HIBERN_FASTAUTO) { + pwr_info->pwr_tx = FASTAUTO_MODE; + pwr_info->pwr_rx = FASTAUTO_MODE; + } else { + pwr_info->pwr_tx = FAST_MODE; + pwr_info->pwr_rx = FAST_MODE; + } pwr_info->hs_rate = PA_HS_MODE_B; /* Get the connected lane count */ diff --git a/drivers/ufs/ufs.h b/drivers/ufs/ufs.h index e5ddb6f64a..638c10b550 100644 --- a/drivers/ufs/ufs.h +++ b/drivers/ufs/ufs.h @@ -725,6 +725,12 @@ struct ufs_hba { */ #define UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS BIT(1) +/* + * This quirk needs to be enabled if the host controller has + * auto-hibernate capability but it's FASTAUTO only. + */ +#define UFSHCD_QUIRK_HIBERN_FASTAUTO BIT(2) + /* Virtual memory reference */ struct utp_transfer_cmd_desc *ucdl; struct utp_transfer_req_desc *utrdl; |