Skip to content

Commit 5e4decb

Browse files
authored
Merge pull request #3074 from maximevince/dwc2-fix-hfir-off-by-one
dwc2/host: HFIR: Fix timing off-by-one
2 parents 865e348 + 72357cd commit 5e4decb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/portable/synopsys/dwc2/hcd_dwc2.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1242,9 +1242,9 @@ static void port0_enable(dwc2_regs_t* dwc2, tusb_speed_t speed) {
12421242

12431243
uint32_t hfir = dwc2->hfir & ~HFIR_FRIVL_Msk;
12441244
if (speed == TUSB_SPEED_HIGH) {
1245-
hfir |= 125*phy_clock;
1245+
hfir |= 125*phy_clock - 1; // The "- 1" is the correct value. The Synopsys databook was corrected in 3.30a
12461246
} else {
1247-
hfir |= 1000*phy_clock;
1247+
hfir |= 1000*phy_clock - 1;
12481248
}
12491249

12501250
dwc2->hfir = hfir;

0 commit comments

Comments
 (0)