summaryrefslogtreecommitdiff
path: root/src/portable
diff options
context:
space:
mode:
authorMaxime Vincent <[email protected]>2025-04-11 12:15:56 +0200
committerMaxime Vincent <[email protected]>2025-04-11 12:20:24 +0200
commit72357cdb20ee7dca5a19d02ce9b7f14d237fb29e (patch)
treebb55ae93c4e9efd2623b770b0db977353f32924c /src/portable
parent865e3488f99209c57b73953428dccf2bc666f0be (diff)
dwc2/host: HFIR: Fix timing off-by-one
Diffstat (limited to 'src/portable')
-rw-r--r--src/portable/synopsys/dwc2/hcd_dwc2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/portable/synopsys/dwc2/hcd_dwc2.c b/src/portable/synopsys/dwc2/hcd_dwc2.c
index 7cbef05b7..6f7551ed7 100644
--- a/src/portable/synopsys/dwc2/hcd_dwc2.c
+++ b/src/portable/synopsys/dwc2/hcd_dwc2.c
@@ -1242,9 +1242,9 @@ static void port0_enable(dwc2_regs_t* dwc2, tusb_speed_t speed) {
uint32_t hfir = dwc2->hfir & ~HFIR_FRIVL_Msk;
if (speed == TUSB_SPEED_HIGH) {
- hfir |= 125*phy_clock;
+ hfir |= 125*phy_clock - 1; // The "- 1" is the correct value. The Synopsys databook was corrected in 3.30a
} else {
- hfir |= 1000*phy_clock;
+ hfir |= 1000*phy_clock - 1;
}
dwc2->hfir = hfir;