diff --git a/board/qca/arm/ipq5018/ipq5018.c b/board/qca/arm/ipq5018/ipq5018.c index e08a3950b0..4d661d19da 100644 --- a/board/qca/arm/ipq5018/ipq5018.c +++ b/board/qca/arm/ipq5018/ipq5018.c @@ -1409,8 +1409,20 @@ static void usb_clock_init(int id, int ssphy) writel(CLK_ENABLE, GCC_USB0_LFPS_CBCR); } -static void usb_init_hsphy(void __iomem *phybase) +static void usb_init_hsphy(void __iomem *phybase, int ssphy) { + if (!ssphy) { + /*Enable utmi instead of pipe*/ + writel((readl(USB30_GENERAL_CFG) | PIPE_UTMI_CLK_DIS), USB30_GENERAL_CFG); + + udelay(100); + + writel((readl(USB30_GENERAL_CFG) | PIPE_UTMI_CLK_SEL | PIPE3_PHYSTATUS_SW), USB30_GENERAL_CFG); + + udelay(100); + + writel((readl(USB30_GENERAL_CFG) & ~PIPE_UTMI_CLK_DIS), USB30_GENERAL_CFG); + } /* Disable USB PHY Power down */ setbits_le32(phybase + 0xA4, 0x1); /* Enable override ctrl */ @@ -1480,7 +1492,7 @@ static void usb_init_phy(int index, int ssphy) if (ssphy) usb_init_ssphy((u32 *)USB3PHY_APB_BASE); - usb_init_hsphy((u32 *)QUSB2PHY_BASE); + usb_init_hsphy((u32 *)QUSB2PHY_BASE, ssphy); } int ipq_board_usb_init(void) diff --git a/board/qca/arm/ipq5018/ipq5018.h b/board/qca/arm/ipq5018/ipq5018.h index 1a73ceca83..5f7ba7227f 100644 --- a/board/qca/arm/ipq5018/ipq5018.h +++ b/board/qca/arm/ipq5018/ipq5018.h @@ -234,6 +234,10 @@ #define GUCTL 0x700C12C #define FLADJ 0x700C630 +#define PIPE_UTMI_CLK_SEL 0x1 +#define PIPE3_PHYSTATUS_SW (0x1 << 3) +#define PIPE_UTMI_CLK_DIS (0x1 << 8) + #define QUSB2PHY_BASE 0x5b000 #define GCC_USB0_LFPS_CFG_SRC_SEL (0x1 << 8)