Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

phy: tegra: xusb: Decouple CYA_TRK_CODE_UPDATE_ON_IDLE from trk_hw_mode

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")
Cc: stable@vger.kernel.org
Signed-off-by: Wayne Chang <waynec@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://lore.kernel.org/r/20250519090929.3132456-2-waynec@nvidia.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Wayne Chang and committed by
Vinod Koul
24c63c59 19272b37

+9 -6
+8 -6
drivers/phy/tegra/xusb-tegra186.c
··· 648 648 udelay(100); 649 649 } 650 650 651 - if (padctl->soc->trk_hw_mode) { 652 - value = padctl_readl(padctl, XUSB_PADCTL_USB2_BIAS_PAD_CTL2); 653 - value |= USB2_TRK_HW_MODE; 651 + value = padctl_readl(padctl, XUSB_PADCTL_USB2_BIAS_PAD_CTL2); 652 + if (padctl->soc->trk_update_on_idle) 654 653 value &= ~CYA_TRK_CODE_UPDATE_ON_IDLE; 655 - padctl_writel(padctl, value, XUSB_PADCTL_USB2_BIAS_PAD_CTL2); 656 - } else { 654 + if (padctl->soc->trk_hw_mode) 655 + value |= USB2_TRK_HW_MODE; 656 + padctl_writel(padctl, value, XUSB_PADCTL_USB2_BIAS_PAD_CTL2); 657 + 658 + if (!padctl->soc->trk_hw_mode) 657 659 clk_disable_unprepare(priv->usb2_trk_clk); 658 - } 659 660 } 660 661 661 662 static void tegra186_utmi_bias_pad_power_off(struct tegra_xusb_padctl *padctl) ··· 1712 1711 .supports_gen2 = true, 1713 1712 .poll_trk_completed = true, 1714 1713 .trk_hw_mode = true, 1714 + .trk_update_on_idle = true, 1715 1715 .supports_lp_cfg_en = true, 1716 1716 }; 1717 1717 EXPORT_SYMBOL_GPL(tegra234_xusb_padctl_soc);
+1
drivers/phy/tegra/xusb.h
··· 434 434 bool need_fake_usb3_port; 435 435 bool poll_trk_completed; 436 436 bool trk_hw_mode; 437 + bool trk_update_on_idle; 437 438 bool supports_lp_cfg_en; 438 439 }; 439 440