usb_host_config.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. /*
  2. * Copyright (c) 2015 - 2016, Freescale Semiconductor, Inc.
  3. * Copyright 2016 - 2019 NXP
  4. * All rights reserved.
  5. *
  6. * SPDX-License-Identifier: BSD-3-Clause
  7. */
  8. #ifndef _USB_HOST_CONFIG_H_
  9. #define _USB_HOST_CONFIG_H_
  10. /* Host Controller Enable */
  11. /*!
  12. * @brief host khci instance count, meantime it indicates khci enable or disable.
  13. * - if 0, host khci driver is disable.
  14. * - if greater than 0, host khci driver is enable.
  15. */
  16. #define USB_HOST_CONFIG_KHCI (0U)
  17. /*!
  18. * @brief host ehci instance count, meantime it indicates ehci enable or disable.
  19. * - if 0, host ehci driver is disable.
  20. * - if greater than 0, host ehci driver is enable.
  21. */
  22. #define USB_HOST_CONFIG_EHCI (2U)
  23. /*!
  24. * @brief host ohci instance count, meantime it indicates ohci enable or disable.
  25. * - if 0, host ohci driver is disable.
  26. * - if greater than 0, host ohci driver is enable.
  27. */
  28. #define USB_HOST_CONFIG_OHCI (0U)
  29. /*!
  30. * @brief host ip3516hs instance count, meantime it indicates ohci enable or disable.
  31. * - if 0, host ip3516hs driver is disable.
  32. * - if greater than 0, host ip3516hs driver is enable.
  33. */
  34. #define USB_HOST_CONFIG_IP3516HS (0U)
  35. /* Common configuration macros for all controllers */
  36. /*!
  37. * @brief host driver instance max count.
  38. * for example: 2 - one for khci, one for ehci.
  39. */
  40. #define USB_HOST_CONFIG_MAX_HOST \
  41. (USB_HOST_CONFIG_KHCI + USB_HOST_CONFIG_EHCI + USB_HOST_CONFIG_OHCI + USB_HOST_CONFIG_IP3516HS)
  42. /*!
  43. * @brief host pipe max count.
  44. * pipe is the host driver resource for device endpoint, one endpoint need one pipe.
  45. */
  46. #define USB_HOST_CONFIG_MAX_PIPES (16U)
  47. /*!
  48. * @brief host transfer max count.
  49. * transfer is the host driver resource for data transmission mission, one transmission mission need one transfer.
  50. */
  51. #define USB_HOST_CONFIG_MAX_TRANSFERS (16U)
  52. /*!
  53. * @brief the max endpoint for one interface.
  54. * the max endpoint descriptor number that one interface descriptor contain.
  55. */
  56. #define USB_HOST_CONFIG_INTERFACE_MAX_EP (4U)
  57. /*!
  58. * @brief the max interface for one configuration.
  59. * the max interface descriptor number that one configuration descriptor can contain.
  60. */
  61. #define USB_HOST_CONFIG_CONFIGURATION_MAX_INTERFACE (5U)
  62. /*!
  63. * @brief the max power for one device.
  64. * the max power the host can provide for one device.
  65. */
  66. #define USB_HOST_CONFIG_MAX_POWER (250U)
  67. /*!
  68. * @brief the max retries for enumeration.
  69. * retry time when enumeration fail.
  70. */
  71. #define USB_HOST_CONFIG_ENUMERATION_MAX_RETRIES (3U)
  72. /*!
  73. * @brief the max retries for enumeration setup stall.
  74. * the max times for one transfer can stall.
  75. */
  76. #define USB_HOST_CONFIG_ENUMERATION_MAX_STALL_RETRIES (1U)
  77. /*!
  78. * @brief the max NAK count for one transaction.
  79. * when nak count reach to the value, the transaction fail.
  80. */
  81. #define USB_HOST_CONFIG_MAX_NAK (3000U)
  82. /*! @brief Whether the transfer buffer is cache-enabled or not. */
  83. #ifndef USB_HOST_CONFIG_BUFFER_PROPERTY_CACHEABLE
  84. #define USB_HOST_CONFIG_BUFFER_PROPERTY_CACHEABLE (0U)
  85. #endif
  86. /*! @brief if 1, enable usb compliance test codes; if 0, disable usb compliance test codes. */
  87. #define USB_HOST_CONFIG_COMPLIANCE_TEST (0U)
  88. /*! @brief if 1, class driver clear stall automatically; if 0, class driver don't clear stall. */
  89. #define USB_HOST_CONFIG_CLASS_AUTO_CLEAR_STALL (0U)
  90. /* KHCI configuration */
  91. #if ((defined USB_HOST_CONFIG_KHCI) && (USB_HOST_CONFIG_KHCI))
  92. /*!
  93. * @brief khci dma align fix buffer size.
  94. */
  95. #define USB_HOST_CONFIG_KHCI_DMA_ALIGN_BUFFER (64U)
  96. #endif
  97. /* EHCI configuration */
  98. #if ((defined USB_HOST_CONFIG_EHCI) && (USB_HOST_CONFIG_EHCI))
  99. /*!
  100. * @brief ehci periodic frame list size.
  101. * the value can be 1024, 512, 256, 128, 64, 32, 16 or 8.
  102. */
  103. #define USB_HOST_CONFIG_EHCI_FRAME_LIST_SIZE (1024U)
  104. /*!
  105. * @brief ehci QH max count.
  106. */
  107. #define USB_HOST_CONFIG_EHCI_MAX_QH (8U)
  108. /*!
  109. * @brief ehci QTD max count.
  110. */
  111. #define USB_HOST_CONFIG_EHCI_MAX_QTD (8U)
  112. /*!
  113. * @brief ehci ITD max count.
  114. */
  115. #define USB_HOST_CONFIG_EHCI_MAX_ITD (0U)
  116. /*!
  117. * @brief ehci SITD max count.
  118. */
  119. #define USB_HOST_CONFIG_EHCI_MAX_SITD (0U)
  120. #endif
  121. /* OHCI configuration */
  122. #if ((defined USB_HOST_CONFIG_OHCI) && (USB_HOST_CONFIG_OHCI))
  123. /*!
  124. * @brief ohci ED max count.
  125. */
  126. #define USB_HOST_CONFIG_OHCI_MAX_ED (8U)
  127. /*!
  128. * @brief ohci GTD max count.
  129. */
  130. #define USB_HOST_CONFIG_OHCI_MAX_GTD (8U)
  131. /*!
  132. * @brief ohci ITD max count.
  133. */
  134. #define USB_HOST_CONFIG_OHCI_MAX_ITD (8U)
  135. #endif
  136. /* OHCI configuration */
  137. #if ((defined USB_HOST_CONFIG_IP3516HS) && (USB_HOST_CONFIG_IP3516HS))
  138. #define USB_HOST_CONFIG_IP3516HS_MAX_PIPE (32U)
  139. /*!
  140. * @brief ohci ED max count.
  141. */
  142. #define USB_HOST_CONFIG_IP3516HS_MAX_ATL (32U)
  143. /*!
  144. * @brief ohci GTD max count.
  145. */
  146. #define USB_HOST_CONFIG_IP3516HS_MAX_INT (32U)
  147. /*!
  148. * @brief ohci ITD max count.
  149. */
  150. #define USB_HOST_CONFIG_IP3516HS_MAX_ISO (0U)
  151. #endif
  152. /*!
  153. * @brief host HUB class instance count, meantime it indicates HUB class enable or disable.
  154. * - if 0, host HUB class driver is disable.
  155. * - if greater than 0, host HUB class driver is enable.
  156. */
  157. #define USB_HOST_CONFIG_HUB (0U)
  158. /*!
  159. * @brief host HID class instance count, meantime it indicates HID class enable or disable.
  160. * - if 0, host HID class driver is disable.
  161. * - if greater than 0, host HID class driver is enable.
  162. */
  163. #define USB_HOST_CONFIG_HID (0U)
  164. /*!
  165. * @brief host MSD class instance count, meantime it indicates MSD class enable or disable.
  166. * - if 0, host MSD class driver is disable.
  167. * - if greater than 0, host MSD class driver is enable.
  168. */
  169. #define USB_HOST_CONFIG_MSD (0U)
  170. /*!
  171. * @brief host CDC class instance count, meantime it indicates CDC class enable or disable.
  172. * - if 0, host CDC class driver is disable.
  173. * - if greater than 0, host CDC class driver is enable.
  174. */
  175. #define USB_HOST_CONFIG_CDC (0U)
  176. /*!
  177. * @brief host AUDIO class instance count, meantime it indicates AUDIO class enable or disable.
  178. * - if 0, host AUDIO class driver is disable.
  179. * - if greater than 0, host AUDIO class driver is enable.
  180. */
  181. #define USB_HOST_CONFIG_AUDIO (0U)
  182. /*!
  183. * @brief host PHDC class instance count, meantime it indicates PHDC class enable or disable.
  184. * - if 0, host PHDC class driver is disable.
  185. * - if greater than 0, host PHDC class driver is enable.
  186. */
  187. #define USB_HOST_CONFIG_PHDC (0U)
  188. /*!
  189. * @brief host printer class instance count, meantime it indicates printer class enable or disable.
  190. * - if 0, host printer class driver is disable.
  191. * - if greater than 0, host printer class driver is enable.
  192. */
  193. #define USB_HOST_CONFIG_PRINTER (0U)
  194. /*!
  195. * @brief host charger detect enable or disable. It is only supported on RT600 currently.
  196. * - if 0, host charger detect is disable.
  197. * - if greater than 0, host charger detect is enable.
  198. */
  199. #define USB_HOST_CONFIG_BATTERY_CHARGER (0U)
  200. #endif /* _USB_HOST_CONFIG_H_ */