History: usbh_drv_ehci

This page describes all changes made to the usbh_drv_ehci package, USB EHCI Host Controller, since its release.


3.21 (2021-07-10, 13:30):

  • Added configuration option EHCI_F210_CORE for Faraday F210 USB core (operational for CONTROL, BULK, and INT endpoints but not ISO).

3.20 (2020-05-18, 17:07):

  • INT endpoint poll rate rounded to power of 2 to be able to handle any poll rate. Previously the minimum poll rate was 4ms: removed this limitation.

3.19 (2019-12-03, 14:58):

  • Static analysis issues eliminated.

3.18 (2019-10-18, 15:28):

  • Static analysis issues eliminated.

3.17 (2019-09-13, 12:00):

  • C++ compiler errors eliminated.

3.16 (2018-08-27, 16:30):

  • Static analysis issues eliminated.

3.15 (2018-10-12, 16:51):

  • Can now handle unlimited device INTERRUPT endpoints  (that is, <= EHCI_MAX_EP) with either the same polling interval (if >=4ms) or a polling interval of <4ms. Preceding versions had a limitation determined by the endpoints' polling interval and EHCI_PERIODIC_LIST_SIZE.

3.14r2 (2018-08-29, 18:15):

  • Document HTML link added to the documentation folder.
  • History and document files renamed to the package name.

3.14 (2017-10-10, 15:46):

  • Compiler warnings removed.

3.13 (2017-09-25, 16:37):

  • Module interrupt is only enabled after initializing its service routine. This ensures correct operation in case interrupt is enabled in advance by another module (e.g. because EHCI interrupt is shared with OHCI interrupt).


  • Refactoring to comply with coding standard rules.


  • Static analyzer warning was eliminated (CodeSonar).


  • Compiler warnings were eliminated.


  • PSP membar moved to a separate package.


  • Some transfers could report incorrect transfer size on certain processors where the last transfer descriptor overlay area could not be DMA-d back to the transfer descriptor from the queue head.


  • psp_types.h used instead of stdint.h and stddef.h.


  • Support for test mode introduced.


  • timed out periodic transfers could stop the system if there was no active asynchronous transfer.


  • stop period/asynchronous list execution when a transfer is stopped, otherwise a transfer could sometimes remain active.


  • psp_membar() calls added to the required places.


  • mutex get/put error code check removed
  • mutex is locked in delete before the task is removed and unlocked before mutex is destroyed to eliminate possible problem with some OS-es where mutex needs to be unlocked before destroying.
  • mutex released from del_daddr() before transfer_end() is called to avoid possible deadlock.


  • ehci_del_daddr() can remove transfers on device 0/endpoint 0.


  • ehci_hw_connect() and ehci_hw_disconnect() functions introduced to be able to take Hardware-specific actions in case it is required.
  • ehci_hw.h header file moved to EHCI driver directory.


  • warnings removed.


  • If EHCI_MAX_SCHEDULE_IDLE_TIME was set then mutex was not locked and unlocked when the schedules had to be disabled from transfer task. As a consequence it could happen that the schedule was disabled immediately after it was enabled from a transfer start, causing the started transfer to never complete.


  • If a transfer required more than 1 transfer descriptor and at least 1 descriptor was available but the system ran out of descriptors the transfer was never finished (no interrupt was generated).


  • Transfer's completed size was incorrectly updated in case of error.
  • Remote wakeup handling added.


  • EHCI_MAX_SCHEDULE_IDLE_TIME introduced in config_usbh_ehci.h.


  • ASYNC and PERIODIC scheduling is stopped if there is nothing to do; this way DMA load can be significantly decreased in idle time.
  • ISO transfers could stop working in case the system couldn't schedule ehci_transfer_task quick enough.


  • Changed EHCI_RENDIAN to EHCI_REG_RENDIAN and EHCI_DATA_RENDIAN. Required because we found a platform where the registers needs to be reversed and data (QH, QTD, etc.) can stay in the processor's endianness (PPC5121).
  • Incorrect transfers could occur if with cache enabled hcc_mem module lock function returned smaller area than the endpoint packet size while the requested transfer size was greater or equal to the EP size.


  • Added uint32_t typecast to some expressions in ehci_reg.h to avoid warnings.


  • bugfix: reset sequence was executed for HS/FS/LS devices, if companion controller is present ownership for LS devices should immediately be changed (without reset).


  • >20KB transfers can be started for an endpoint.
  • Memory is not unlocked for address 0 anymore.


  • report USBH_SHORTPACKET on ISO IN channel if read less data than requested.
  • under certain circumstances if data cache was enabled the system could hang ( tried to unlock memory even if lock returned the same address).
  • Added the ability to set EHCI_MAX_ISO_EP and EHCI_MAS_SISO_LEVEL to 0.


  • usbh_ehci_hc() defined as extern void * const to be consistent with the definition.


  • Full/low speed devices were not supported on the root hub port 2+.


  • Check function prototypes by including its header file.


  • 10 ms delay added to ehci_hub_start() to have a delay before powering on the port (switched off from ehci_hub_init()).


  • bugfix: invalid transfer sizes were used when default size used on an endpoint with not power of 2 packet size.
  • bugfix: with HCC_MEM_ALLOW_DATA_CACHE bad transfer size was used if hcc_mem_lock() returned smaller size than the requested transfer size and not multiple of endpoint packet size. In this case erroneous transfers could occur.
  • bugfix: TRANSFER FULL was reported in a wrong way, if the transfer couldn't be started then it returned transfer error, causing transfers to report error instead of being processed by the common layer via pending transfers
  • bugfix: if data cache is allowed IN transfers unlocked the buffer twice causing incorrect operation in the memory manager when the load was big.
  • bugfix: lots of parallel transfers could hang the system because QTD was assigned even if the transfer couldn't be started due to lack of buffers when data cache is allowed.


  • OAL resource initialization changed. It will free resources from init in case of failure.


  • moved ehci_hub_start() after ehci_isr_enable(), to avoid missing interrupts on systems that can't handle an active interrupt when enabled. This could lead to unrecognized device attached at startup.


  • hcc_mem_unlock() will be always called if hcc_mem_lock() was executed. This way, if lock can flush the cache then the buffer will be invalidated as well when the transfer is finished.


  • in ehci_get_ep_inf dir is initialized with USBH_DIR_ANY to avoid uninitialized warning
  • host controller reset removed from ehci_start, for microcontrollers where EHCI and ARC device are mapped to the same registers (OTG) reset will put the module back to the default device state.
  • ep_hub_inf structure added before ehci_add_ep() in ehci_start() function to avoid passing NULL pointer to ehci_add_ep().


  • Added hcc_mem_phy_addr and hcc_mem_uncached to obtain the correct memory address for a transfer. This is required if virtual addresses are used in the system. For example if the same RAM region is mapped to a virtual uncached address then, before being able to DMA to/from that area, the address needs to be converted to a physical address.