This commit is contained in:
hathach 2021-11-17 09:48:08 +07:00
parent 12e96ce571
commit 301d6b4133
No known key found for this signature in database
GPG Key ID: 2FA891220FBFD581
1 changed files with 6 additions and 2 deletions

View File

@ -443,11 +443,15 @@ static void phy_hs_init(dwc2_regs_t * dwc2)
dwc2_phy_update(dwc2, dwc2->ghwcfg2_bm.hs_phy_type);
// Set max speed
dwc2->dcfg = (dwc2->dcfg & ~DCFG_DSPD_Msk) | (DCFG_DSPD_HS << DCFG_DSPD_Pos);
uint32_t dcfg = dwc2->dcfg;
dcfg &= ~DCFG_DSPD_Msk;
dcfg |= DCFG_DSPD_HS << DCFG_DSPD_Pos;
// XCVRDLY: transceiver delay between xcvr_sel and txvalid during device chirp is required
// when using with some PHYs such as USB334x (USB3341, USB3343, USB3346, USB3347)
if (dwc2->ghwcfg2_bm.hs_phy_type == HS_PHY_TYPE_ULPI) dwc2->dcfg |= DCFG_XCVRDLY;
if (dwc2->ghwcfg2_bm.hs_phy_type == HS_PHY_TYPE_ULPI) dcfg |= DCFG_XCVRDLY;
dwc2->dcfg = dcfg;
}
static bool check_dwc2(dwc2_regs_t * dwc2)