Skip to contentSkip to conversation

Disable periodic tracking on Tegra234

PATCH Superseded Wayne Chang 2 participants 4 messages May 7, 2025

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#1 lore raw

PATCH 1/2 phy: tegra: xusb: Decouple CYA_TRK_CODE_UPDATE_ON_IDLE from trk_hw_mode

In reply to Wayne Chang

The logic that drives the pad calibration values resides in the controller reset domain and so the calibration values are only being captured when the controller is out of reset. However, by clearing the CYA_TRK_CODE_UPDATE_ON_IDLE bit, the calibration values can be set while the controller is in reset.

The CYA_TRK_CODE_UPDATE_ON_IDLE bit was previously cleared based on the trk_hw_mode flag, but this dependency is not necessary. Instead, introduce a new flag, trk_update_on_idle, to independently control this bit.

Fixes d8163a32ca95 ("phy: tegra: xusb: Add Tegra234 support")
---
 drivers/phy/tegra/xusb-tegra186.c | 14 ++++++++------
 drivers/phy/tegra/xusb.h          |  1 +
 2 files changed, 9 insertions(+), 6 deletions(-)
drivers/phy/tegra/xusb-tegra186.c +8 -6
index fae6242aa730..dd0aaf305e90 100644
@@ -650,14 +650,15 @@ static void tegra186_utmi_bias_pad_power_on(struct tegra_xusb_padctl *padctl)
 		udelay(100);
 	}
 
-	if (padctl->soc->trk_hw_mode) {
-		value = padctl_readl(padctl, XUSB_PADCTL_USB2_BIAS_PAD_CTL2);
-		value |= USB2_TRK_HW_MODE;
+	value = padctl_readl(padctl, XUSB_PADCTL_USB2_BIAS_PAD_CTL2);
+	if (padctl->soc->trk_update_on_idle)
 		value &= ~CYA_TRK_CODE_UPDATE_ON_IDLE;
-		padctl_writel(padctl, value, XUSB_PADCTL_USB2_BIAS_PAD_CTL2);
-	} else {
+	if (padctl->soc->trk_hw_mode)
+		value |= USB2_TRK_HW_MODE;
+	padctl_writel(padctl, value, XUSB_PADCTL_USB2_BIAS_PAD_CTL2);
+
+	if (!padctl->soc->trk_hw_mode)
 		clk_disable_unprepare(priv->usb2_trk_clk);
-	}
 
 	mutex_unlock(&padctl->lock);
 }
@@ -1703,6 +1704,7 @@ const struct tegra_xusb_padctl_soc tegra234_xusb_padctl_soc = {
 	.supports_gen2 = true,
 	.poll_trk_completed = true,
 	.trk_hw_mode = true,
+	.trk_update_on_idle = true,
 	.supports_lp_cfg_en = true,
 };
 EXPORT_SYMBOL_GPL(tegra234_xusb_padctl_soc);
drivers/phy/tegra/xusb.h +1 -0
index 6e45d194c689..d2b5f9565132 100644
@@ -434,6 +434,7 @@ struct tegra_xusb_padctl_soc {
 	bool need_fake_usb3_port;
 	bool poll_trk_completed;
 	bool trk_hw_mode;
+	bool trk_update_on_idle;
 	bool supports_lp_cfg_en;
 };
 
Signature · 1 line
2.25.1
#0 lore raw

cover Disable periodic tracking on Tegra234

Decouple CYA_TRK_CODE_UPDATE_ON_IDLE from trk_hw_mode and disable periodic tracking on Tegra234

Haotien Hsu (1):
phy: tegra: xusb: Disable periodic tracking on Tegra234

Wayne Chang (1):
phy: tegra: xusb: Decouple CYA_TRK_CODE_UPDATE_ON_IDLE from
trk_hw_mode

 drivers/phy/tegra/xusb-tegra186.c | 16 +++++++++-------
 drivers/phy/tegra/xusb.h          |  1 +
 2 files changed, 10 insertions(+), 7 deletions(-)

base-commit: 92a09c47464d040866cf2b4cd052bc60555185fb

Signature · 1 line
2.25.1
#3 lore raw

PATCH 2/2 phy: tegra: xusb: Disable periodic tracking on Tegra234

From: Haotien Hsu <[email protected]>

Periodic calibration updates (~10µs) may overlap with transfers when PCIe NVMe SSD, LPDDR, and USB2 devices operate simultaneously, causing crosstalk on Tegra234 devices. Hence disable periodic calibration updates and make this a one-time calibration.

Fixes d8163a32ca95 ("phy: tegra: xusb: Add Tegra234 support")
---
 drivers/phy/tegra/xusb-tegra186.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/tegra/xusb-tegra186.c +1 -1
index dd0aaf305e90..414f4eabfe9d 100644
@@ -1703,7 +1703,7 @@ const struct tegra_xusb_padctl_soc tegra234_xusb_padctl_soc = {
 	.num_supplies = ARRAY_SIZE(tegra194_xusb_padctl_supply_names),
 	.supports_gen2 = true,
 	.poll_trk_completed = true,
-	.trk_hw_mode = true,
+	.trk_hw_mode = false,
 	.trk_update_on_idle = true,
 	.supports_lp_cfg_en = true,
 };
Signature · 1 line
2.25.1
maintainer
#2 lore raw

Re: [PATCH 1/2] phy: tegra: xusb: Decouple CYA_TRK_CODE_UPDATE_ON_IDLE from trk_hw_mode

In reply to Wayne Chang

Hi Wayne,

Quoted 34 lines · Wayne Chang

The logic that drives the pad calibration values resides in the controller reset domain and so the calibration values are only being captured when the controller is out of reset. However, by clearing the CYA_TRK_CODE_UPDATE_ON_IDLE bit, the calibration values can be set while the controller is in reset.

The CYA_TRK_CODE_UPDATE_ON_IDLE bit was previously cleared based on the trk_hw_mode flag, but this dependency is not necessary. Instead, introduce a new flag, trk_update_on_idle, to independently control this bit.

Fixes d8163a32ca95 ("phy: tegra: xusb: Add Tegra234 support")
---
  drivers/phy/tegra/xusb-tegra186.c | 14 ++++++++------
  drivers/phy/tegra/xusb.h          |  1 +
  2 files changed, 9 insertions(+), 6 deletions(-)
drivers/phy/tegra/xusb-tegra186.c +2 -4
index fae6242aa730..dd0aaf305e90 100644
@@ -650,14 +650,15 @@ static void tegra186_utmi_bias_pad_power_on(struct tegra_xusb_padctl *padctl)
  		udelay(100);
  	}
 
-	if (padctl->soc->trk_hw_mode) {
-		value = padctl_readl(padctl, XUSB_PADCTL_USB2_BIAS_PAD_CTL2);
-		value |= USB2_TRK_HW_MODE;
+	value = padctl_readl(padctl, XUSB_PADCTL_USB2_BIAS_PAD_CTL2);
+	if (padctl->soc->trk_update_on_idle)
  		value &= ~CYA_TRK_CODE_UPDATE_ON_IDLE;
-		padctl_writel(padctl, value, XUSB_PADCTL_USB2_BIAS_PAD_CTL2);

drivers/phy/tegra/xusb-tegra186.c static void tegra186_utmi_bias_pad_power_on(struct tegra_xusb_padctl *padctl) · line 663

Quoted 10 lines
drivers/phy/tegra/xusb-tegra186.c +5 -2
-	} else {
+	if (padctl->soc->trk_hw_mode)
+		value |= USB2_TRK_HW_MODE;
+	padctl_writel(padctl, value, XUSB_PADCTL_USB2_BIAS_PAD_CTL2);
+
+	if (!padctl->soc->trk_hw_mode)
  		clk_disable_unprepare(priv->usb2_trk_clk);
-	}
 
  	mutex_unlock(&padctl->lock);

Can we rebase this on top of the fix 'phy: tegra: xusb: remove a stray unlock'? This does not apply on top of that patch.

Thanks
Jon

Signature · 1 line
nvpublic