Commit Graph

4 Commits

Author SHA1 Message Date
Darian Leung
60e42f30c4 usb_host: Restrict ESP32-S2 AHB errata workaround to only ECO0 chips 2023-08-22 15:43:39 +08:00
Darian Leung
974b955cff hal: Fix USB DWC HAL host channel halt race condition
This commit fixes a race condtion bug with usb_dwc_hal_chan_request_halt()
where a channel the channel is halted if it has just completed a transfer
(i.e., finished processing a QTD with the "HOC" flag set) but the channel is
still pending interrupt handling. In this case...

- usb_dwc_hal_chan_request_halt() would simply read the channel's underlying
register, determine it is not active, not set the "halt_requested" flag, and
simply return true.
- The caller assumes of usb_dwc_hal_chan_request_halt() will assume that the
channel has halted, and may proceed to reconfigure the pipe/port
- When usb_dwc_hal_chan_decode_intr() comes to process the pending interrupt
it will simply return USB_DWC_HAL_CHAN_EVENT_CPLT not knowing a halt has been
requested.

This commit updates the implementation of usb_dwc_hal_chan_request_halt() so
that a halt is properly requested even if the underlying channel has already
physically halted.
2022-12-13 22:27:54 +08:00
Darian Leung
7295933f5f usb_host: Rename struct/ll/hal symbols to use "usb_dwc" prefix
Following the file renaming to use the "usb_dwc" prefix, this commit
updates the symbol names of those files to use the "usb_dwc" as well.

Some LL functions were also renamed so that the register name is
mentioned.
2022-12-13 21:36:00 +08:00
Darian Leung
c06346da35 usb_host: Rename struct/ll/hal files to use "usb_dwc" prefix
This commit updates the DWC_OTG based struct/ll/hal file names to
use the prefix "usb_dwc". This naming scheme reduces ambiguity if
another USB controller implementation is added.

As a result, "hcd.c" has been renamed to "hcd_dwc.c"
2022-12-13 21:36:00 +08:00