From: Peter Griffin <peter.griffin@linaro.org>
To: alim.akhtar@samsung.com, James.Bottomley@HansenPartnership.com,
martin.petersen@oracle.com, avri.altman@wdc.com,
bvanassche@acm.org, krzk@kernel.org
Cc: tudor.ambarus@linaro.org, ebiggers@kernel.org,
andre.draszik@linaro.org, kernel-team@android.com,
willmcvicker@google.com, linux-scsi@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org,
Peter Griffin <peter.griffin@linaro.org>
Subject: [PATCH v3 03/14] scsi: ufs: exynos: Allow UFS Gear 4
Date: Thu, 31 Oct 2024 15:00:22 +0000 [thread overview]
Message-ID: <20241031150033.3440894-4-peter.griffin@linaro.org> (raw)
In-Reply-To: <20241031150033.3440894-1-peter.griffin@linaro.org>
UFS Gear 4 offers faster speeds, and better power usage so lets
enable it.
Currently ufshcd_init_host_params() sets UFS_HS_G3 as a default,
so even if the device supports G4 we end up negotiating down to
G3.
For SoCs like gs101 which have a UFS major controller version
of 3 or above advertise Gear 4. This then allows a Gear 4 link
on Pixel 6.
For earlier controller versions keep the current default behaviour
of reporting G3.
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
v3: Added blank line and split hs_tx_gear/hs_rx_gear into separate lines (Tudor)
---
drivers/ufs/host/ufs-exynos.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c
index 7e381ab1011d..33de7ff747a2 100644
--- a/drivers/ufs/host/ufs-exynos.c
+++ b/drivers/ufs/host/ufs-exynos.c
@@ -766,6 +766,21 @@ static void exynos_ufs_config_sync_pattern_mask(struct exynos_ufs *ufs,
exynos_ufs_disable_ov_tm(hba);
}
+#define UFS_HW_VER_MAJOR_MASK GENMASK(15, 8)
+
+static u32 exynos_ufs_get_hs_gear(struct ufs_hba *hba)
+{
+ u8 major;
+
+ major = FIELD_GET(UFS_HW_VER_MAJOR_MASK, hba->ufs_version);
+
+ if (major >= 3)
+ return UFS_HS_G4;
+
+ /* Default is HS-G3 */
+ return UFS_HS_G3;
+}
+
static int exynos_ufs_pre_pwr_mode(struct ufs_hba *hba,
struct ufs_pa_layer_attr *dev_max_params,
struct ufs_pa_layer_attr *dev_req_params)
@@ -783,6 +798,10 @@ static int exynos_ufs_pre_pwr_mode(struct ufs_hba *hba,
ufshcd_init_host_params(&host_params);
+ /* This driver only support symmetric gear setting e.g. hs_tx_gear == hs_rx_gear */
+ host_params.hs_tx_gear = exynos_ufs_get_hs_gear(hba);
+ host_params.hs_rx_gear = exynos_ufs_get_hs_gear(hba);
+
ret = ufshcd_negotiate_pwr_params(&host_params, dev_max_params, dev_req_params);
if (ret) {
pr_err("%s: failed to determine capabilities\n", __func__);
--
2.47.0.163.g1226f6d8fa-goog
next prev parent reply other threads:[~2024-10-31 15:00 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-31 15:00 [PATCH v3 00/14] UFS cleanups and enhancements to ufs-exynos for gs101 Peter Griffin
2024-10-31 15:00 ` [PATCH v3 01/14] scsi: ufs: exynos: remove empty drv_init method Peter Griffin
2024-10-31 15:00 ` [PATCH v3 02/14] scsi: ufs: exynos: remove superfluous function parameter Peter Griffin
2024-10-31 15:00 ` Peter Griffin [this message]
2024-10-31 15:00 ` [PATCH v3 04/14] scsi: ufs: exynos: add check inside exynos_ufs_config_smu() Peter Griffin
2024-10-31 15:00 ` [PATCH v3 05/14] scsi: ufs: exynos: gs101: remove EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL Peter Griffin
2024-10-31 15:00 ` [PATCH v3 06/14] scsi: ufs: exynos: Add EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR check Peter Griffin
2024-10-31 15:31 ` Tudor Ambarus
2024-10-31 15:00 ` [PATCH v3 07/14] scsi: ufs: exynos: gs101: remove unused phy attribute fields Peter Griffin
2024-10-31 15:00 ` [PATCH v3 08/14] scsi: ufs: exynos: remove tx_dif_p_nsec from exynosauto_ufs_drv_init() Peter Griffin
2024-10-31 15:00 ` [PATCH v3 09/14] scsi: ufs: exynos: add gs101_ufs_drv_init() hook and enable WriteBooster Peter Griffin
2024-10-31 15:00 ` [PATCH v3 10/14] scsi: ufs: exynos: enable write line unique transactions on gs101 Peter Griffin
2024-10-31 15:00 ` [PATCH v3 11/14] scsi: ufs: exynos: set ACG to be controlled by UFS_ACG_DISABLE Peter Griffin
2024-10-31 15:00 ` [PATCH v3 12/14] scsi: ufs: exynos: fix hibern8 notify callbacks Peter Griffin
2024-10-31 15:00 ` [PATCH v3 13/14] scsi: ufs: exynos: gs101: enable clock gating with hibern8 Peter Griffin
2024-10-31 15:00 ` [PATCH v3 14/14] MAINTAINERS: Update UFS Exynos entry Peter Griffin
2024-11-04 11:29 ` Alim Akhtar
2024-11-03 1:35 ` [PATCH v3 00/14] UFS cleanups and enhancements to ufs-exynos for gs101 Martin K. Petersen
2024-11-03 6:57 ` Peter Griffin
2024-11-14 2:50 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241031150033.3440894-4-peter.griffin@linaro.org \
--to=peter.griffin@linaro.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=alim.akhtar@samsung.com \
--cc=andre.draszik@linaro.org \
--cc=avri.altman@wdc.com \
--cc=bvanassche@acm.org \
--cc=ebiggers@kernel.org \
--cc=kernel-team@android.com \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=tudor.ambarus@linaro.org \
--cc=willmcvicker@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®