diff options
| author | sakimisu <[email protected]> | 2023-02-02 23:23:55 +0800 |
|---|---|---|
| committer | sakimisu <[email protected]> | 2023-02-02 23:23:55 +0800 |
| commit | 84dfcef639afea9f15de4ba1d408a240d26fa4b6 (patch) | |
| tree | 071c5b6cd022f9f3cc5bc9fa397386742b7f1c9e | |
| parent | 201b3ebb2c2e61c59fe940ce114884e5dc42bfa9 (diff) | |
check if dwc2 supports dma, if not, stop working
| -rw-r--r-- | port/dwc2/usb_hc_dwc2.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/port/dwc2/usb_hc_dwc2.c b/port/dwc2/usb_hc_dwc2.c index e1591ae6..0ad34c51 100644 --- a/port/dwc2/usb_hc_dwc2.c +++ b/port/dwc2/usb_hc_dwc2.c @@ -464,6 +464,12 @@ int usb_hc_init(void) usb_hc_low_level_init(); + if ((USB_OTG_GLB->CID & (0x1U << 8)) == 0U) { + USB_LOG_ERR("This dwc2 version does not support dma, so stop working\r\n"); + while (1) { + } + } + USB_OTG_GLB->GAHBCFG &= ~USB_OTG_GAHBCFG_GINT; ret = dwc2_core_init(); |
