summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsakumisu <[email protected]>2024-05-15 23:07:46 +0800
committersakumisu <[email protected]>2024-05-15 23:07:46 +0800
commit8b805ee6d7915cda848a2df442ded2900de10eec (patch)
tree04c83b79e524faf15b908798ddc2d3b6480e1b61
parent5e6bd78f802d524480c31ffd8f8807ec1a765693 (diff)
fix(dwc2): check those chips with 1.25KB fifo
-rw-r--r--port/dwc2/usb_dc_dwc2.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/port/dwc2/usb_dc_dwc2.c b/port/dwc2/usb_dc_dwc2.c
index 4bdc5712..0a1f0d68 100644
--- a/port/dwc2/usb_dc_dwc2.c
+++ b/port/dwc2/usb_dc_dwc2.c
@@ -631,6 +631,13 @@ int usb_dc_init(uint8_t busid)
}
}
+ /* xxx32 chips do not follow (USB_OTG_GLB->GHWCFG3 >> 16) if hsphy_type is zero, they use 1.25KB(320 DWORD) */
+ if ((hsphy_type == 0) && (fifo_num > 320)) {
+ USB_LOG_ERR("Your fifo config is larger than 320 , please check\r\n");
+ while (1) {
+ }
+ }
+
ret = dwc2_flush_txfifo(0x10U);
ret = dwc2_flush_rxfifo();