Skip to content

Commit 24c63c5

Browse files
Wayne Changvinodkoul
authored andcommitted
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: d8163a3 ("phy: tegra: xusb: Add Tegra234 support") Cc: [email protected] Signed-off-by: Wayne Chang <[email protected]> Reviewed-by: Jon Hunter <[email protected]> Tested-by: Jon Hunter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 19272b3 commit 24c63c5

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

drivers/phy/tegra/xusb-tegra186.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -648,14 +648,15 @@ static void tegra186_utmi_bias_pad_power_on(struct tegra_xusb_padctl *padctl)
648648
udelay(100);
649649
}
650650

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)
654653
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)
657659
clk_disable_unprepare(priv->usb2_trk_clk);
658-
}
659660
}
660661

661662
static void tegra186_utmi_bias_pad_power_off(struct tegra_xusb_padctl *padctl)
@@ -1711,6 +1712,7 @@ const struct tegra_xusb_padctl_soc tegra234_xusb_padctl_soc = {
17111712
.supports_gen2 = true,
17121713
.poll_trk_completed = true,
17131714
.trk_hw_mode = true,
1715+
.trk_update_on_idle = true,
17141716
.supports_lp_cfg_en = true,
17151717
};
17161718
EXPORT_SYMBOL_GPL(tegra234_xusb_padctl_soc);

drivers/phy/tegra/xusb.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,7 @@ struct tegra_xusb_padctl_soc {
434434
bool need_fake_usb3_port;
435435
bool poll_trk_completed;
436436
bool trk_hw_mode;
437+
bool trk_update_on_idle;
437438
bool supports_lp_cfg_en;
438439
};
439440

0 commit comments

Comments
 (0)