Skip to content

Commit 05b56ef

Browse files
Xu Yangvinodkoul
authored andcommitted
phy: fsl-imx8mq-usb: enable RX Termination override
This is to resolve the problem of wakeup system by USB3 device insertion if HSIOMIX on, in that case, the USB3 device detects RX term on so the USB3 device doesn't downgrade to high-speed, we can't expect CONN wakeup (for USB3) happen because the 24MHz OSC is required ON to trigger it. Because the device works at Super-speed so DP/DM wakeup can't happen either. Then the entire systen can't be waken up by such device attach event. With this override bit we can force the RX term off when enters system suspend, and disable the override after system resume. Therefore, the USB3 device will always downgrade to High-speed, then DP/DM wakeup can always happen. It will correctly switch to Super-speed later when the host reset it after the system resume back. Signed-off-by: Li Jun <jun.li@nxp.com> Signed-off-by: Xu Yang <xu.yang_2@nxp.com> Link: https://patch.msgid.link/20260116101835.1810675-1-xu.yang_2@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent debf832 commit 05b56ef

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

drivers/phy/freescale/phy-fsl-imx8mq-usb.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
#define PHY_CTRL5_PCS_TX_SWING_FULL_MASK GENMASK(6, 0)
5252

5353
#define PHY_CTRL6 0x18
54+
#define PHY_CTRL6_RXTERM_OVERRIDE_SEL BIT(29)
5455
#define PHY_CTRL6_ALT_CLK_EN BIT(1)
5556
#define PHY_CTRL6_ALT_CLK_SEL BIT(0)
5657

@@ -630,6 +631,7 @@ static int imx8mp_usb_phy_init(struct phy *phy)
630631
static int imx8mq_phy_power_on(struct phy *phy)
631632
{
632633
struct imx8mq_usb_phy *imx_phy = phy_get_drvdata(phy);
634+
u32 value;
633635
int ret;
634636

635637
ret = regulator_enable(imx_phy->vbus);
@@ -646,12 +648,23 @@ static int imx8mq_phy_power_on(struct phy *phy)
646648
return ret;
647649
}
648650

649-
return ret;
651+
/* Disable rx term override */
652+
value = readl(imx_phy->base + PHY_CTRL6);
653+
value &= ~PHY_CTRL6_RXTERM_OVERRIDE_SEL;
654+
writel(value, imx_phy->base + PHY_CTRL6);
655+
656+
return 0;
650657
}
651658

652659
static int imx8mq_phy_power_off(struct phy *phy)
653660
{
654661
struct imx8mq_usb_phy *imx_phy = phy_get_drvdata(phy);
662+
u32 value;
663+
664+
/* Override rx term to be 0 */
665+
value = readl(imx_phy->base + PHY_CTRL6);
666+
value |= PHY_CTRL6_RXTERM_OVERRIDE_SEL;
667+
writel(value, imx_phy->base + PHY_CTRL6);
655668

656669
clk_disable_unprepare(imx_phy->alt_clk);
657670
clk_disable_unprepare(imx_phy->clk);

0 commit comments

Comments
 (0)