usb_table.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. /*
  2. * Copyright (c) 2013 Qualcomm Atheros, Inc.
  3. * All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted (subject to the limitations in the
  7. * disclaimer below) provided that the following conditions are met:
  8. *
  9. * * Redistributions of source code must retain the above copyright
  10. * notice, this list of conditions and the following disclaimer.
  11. *
  12. * * Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the
  15. * distribution.
  16. *
  17. * * Neither the name of Qualcomm Atheros nor the names of its
  18. * contributors may be used to endorse or promote products derived
  19. * from this software without specific prior written permission.
  20. *
  21. * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
  22. * GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
  23. * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
  24. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  25. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  26. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  27. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  28. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  29. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  30. * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  31. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
  32. * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
  33. * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  34. */
  35. #ifndef _USB_TABLE_H_
  36. #define _USB_TABLE_H_
  37. // UsbDeviceDescriptor
  38. #define USB_DEVICE_DESC_TYPE 0x01
  39. #define USB_DEVICE_DESC_LEN 0x12
  40. #define USB_SPEC_VERSION 0x0200
  41. #define USB_DEVICE_CLASS 0xFF
  42. #define USB_DEVICE_SUB_CLASS 0xFF
  43. #define USB_DEVICE_PROTOCOL 0xFF
  44. #define USB_MAX_PKT_SIZE 0x40
  45. #define USB_VENDOR_ID 0x0CF3
  46. #define USB_PRODUCT_ID 0x7010
  47. #define USB_DEVICE_BCD BOOTROM_VER
  48. #define USB_MANUFACTURER_INDEX 0x10
  49. #define USB_PRODUCT_INDEX 0x20
  50. #define USB_SERIAL_INDEX 0x30
  51. #define USB_CONFIGURATION_NUM 0x01
  52. // end UsbDeviceDescriptor
  53. #define USB_CONFIG_DESC_TYPE 0x02
  54. #define USB_CONFIG_DESC_LEN 0x09
  55. //#define USB_TOTAL_DESC_LEN 0x002E // 4 ep
  56. //#define USB_TOTAL_DESC_LEN 0x0035 // 5 ep
  57. #define USB_TOTAL_DESC_LEN 0x003C // 6 ep
  58. #define USB_INTERFACE_NUM 0x01
  59. #define USB_CONFIG_NUM 0x01
  60. #define USB_STRING_INDEX 0x00
  61. #define USB_ATTRIBUTE 0x80
  62. #define USB_MAX_POWER 0xFA
  63. #define USB_INTERFACE_DESC_TYPE 0x04
  64. #define USB_INTERFACE_DESC_LEN 0x09
  65. #define USB_INTERFACE_INDEX_NUM 0x00
  66. #define USB_INTERFACE_ALT_SETTING 0x00
  67. //#define USB_INTERFACE_EP_NUM 0x04
  68. //#define USB_INTERFACE_EP_NUM 0x05
  69. #define USB_INTERFACE_EP_NUM 0x06
  70. #define USB_INTERFACE_CLASS 0xFF
  71. #define USB_INTERFACE_SUB_CLASS 0x00
  72. #define USB_INTERFACE_PROTOCOL 0x00
  73. #define USB_INTERFACE_STRING_INDEX 0x00
  74. #define USB_EP_DESC_TYPE 0x05
  75. #define USB_EP_DESC_LEN 0x07
  76. /* USB Endpoint attribute */
  77. #define bUSB_EP1_NUM 0x01
  78. #define bUSB_EP2_NUM 0x02
  79. #define bUSB_EP3_NUM 0x03
  80. #define bUSB_EP4_NUM 0x04
  81. #define bUSB_EP5_NUM 0x05
  82. #define bUSB_EP6_NUM 0x06
  83. #define bUSB_EP_DIRECTION_IN 0x80
  84. #define bUSB_EP_DIRECTION_OUT 0x00
  85. #define bUSB_EP_TYPE_CONTROL 0x00
  86. #define bUSB_EP_TYPE_ISOCHRONOUS 0x01
  87. #define bUSB_EP_TYPE_BULK 0x02
  88. #define bUSB_EP_TYPE_INTERRUPT 0x03
  89. #define bUSB_EP_MAX_PKT_SIZE_64 0x0040
  90. #define bUSB_EP_MAX_PKT_SIZE_512 0x0200
  91. /* High Speed Endpoint */
  92. #define USB_HS_EP1_ADDRESS (bUSB_EP_DIRECTION_OUT | bUSB_EP1_NUM)
  93. #define USB_HS_EP1_ATTRIBUTE bUSB_EP_TYPE_BULK
  94. #define USB_HS_EP1_MAX_PACKET_SIZE bUSB_EP_MAX_PKT_SIZE_512
  95. #define USB_HS_EP1_INTERVAL 0x00
  96. #define USB_HS_EP2_ADDRESS (bUSB_EP_DIRECTION_IN | bUSB_EP2_NUM)
  97. #define USB_HS_EP2_ATTRIBUTE bUSB_EP_TYPE_BULK
  98. #define USB_HS_EP2_MAX_PACKET_SIZE bUSB_EP_MAX_PKT_SIZE_512
  99. #define USB_HS_EP2_INTERVAL 0x00
  100. #define USB_HS_EP3_ADDRESS (bUSB_EP_DIRECTION_IN | bUSB_EP3_NUM)
  101. #define USB_HS_EP3_ATTRIBUTE bUSB_EP_TYPE_INTERRUPT
  102. #define USB_HS_EP3_MAX_PACKET_SIZE bUSB_EP_MAX_PKT_SIZE_64
  103. #define USB_HS_EP3_INTERVAL 0x01
  104. #define USB_HS_EP4_ADDRESS (bUSB_EP_DIRECTION_OUT | bUSB_EP4_NUM)
  105. #define USB_HS_EP4_ATTRIBUTE bUSB_EP_TYPE_INTERRUPT //bUSB_EP_TYPE_BULK
  106. #define USB_HS_EP4_MAX_PACKET_SIZE bUSB_EP_MAX_PKT_SIZE_64
  107. #define USB_HS_EP4_INTERVAL 0x01 //0x00
  108. #define USB_HS_EP5_ADDRESS (bUSB_EP_DIRECTION_OUT | bUSB_EP5_NUM)
  109. #define USB_HS_EP5_ATTRIBUTE bUSB_EP_TYPE_BULK
  110. #define USB_HS_EP5_MAX_PACKET_SIZE bUSB_EP_MAX_PKT_SIZE_512
  111. #define USB_HS_EP5_INTERVAL 0x00
  112. #define USB_HS_EP6_ADDRESS (bUSB_EP_DIRECTION_OUT | bUSB_EP6_NUM)
  113. #define USB_HS_EP6_ATTRIBUTE bUSB_EP_TYPE_BULK
  114. #define USB_HS_EP6_MAX_PACKET_SIZE bUSB_EP_MAX_PKT_SIZE_512
  115. #define USB_HS_EP6_INTERVAL 0x00
  116. /* Full Speed Endpoint */
  117. #define USB_FS_EP1_ADDRESS (bUSB_EP_DIRECTION_OUT | bUSB_EP1_NUM)
  118. #define USB_FS_EP1_ATTRIBUTE bUSB_EP_TYPE_BULK
  119. #define USB_FS_EP1_MAX_PACKET_SIZE bUSB_EP_MAX_PKT_SIZE_64
  120. #define USB_FS_EP1_INTERVAL 0x00
  121. #define USB_FS_EP2_ADDRESS (bUSB_EP_DIRECTION_IN | bUSB_EP2_NUM)
  122. #define USB_FS_EP2_ATTRIBUTE bUSB_EP_TYPE_BULK
  123. #define USB_FS_EP2_MAX_PACKET_SIZE bUSB_EP_MAX_PKT_SIZE_64
  124. #define USB_FS_EP2_INTERVAL 0x00
  125. #define USB_FS_EP3_ADDRESS (bUSB_EP_DIRECTION_IN | bUSB_EP3_NUM)
  126. #define USB_FS_EP3_ATTRIBUTE bUSB_EP_TYPE_INTERRUPT
  127. #define USB_FS_EP3_MAX_PACKET_SIZE bUSB_EP_MAX_PKT_SIZE_64
  128. #define USB_FS_EP3_INTERVAL 0x01
  129. #define USB_FS_EP4_ADDRESS (bUSB_EP_DIRECTION_OUT | bUSB_EP4_NUM)
  130. #define USB_FS_EP4_ATTRIBUTE bUSB_EP_TYPE_BULK
  131. #define USB_FS_EP4_MAX_PACKET_SIZE bUSB_EP_MAX_PKT_SIZE_64
  132. #define USB_FS_EP4_INTERVAL 0x00
  133. #define USB_FS_EP5_ADDRESS (bUSB_EP_DIRECTION_OUT | bUSB_EP5_NUM)
  134. #define USB_FS_EP5_ATTRIBUTE bUSB_EP_TYPE_BULK
  135. #define USB_FS_EP5_MAX_PACKET_SIZE bUSB_EP_MAX_PKT_SIZE_64
  136. #define USB_FS_EP5_INTERVAL 0x00
  137. #define USB_FS_EP6_ADDRESS (bUSB_EP_DIRECTION_OUT | bUSB_EP6_NUM)
  138. #define USB_FS_EP6_ATTRIBUTE bUSB_EP_TYPE_BULK
  139. #define USB_FS_EP6_MAX_PACKET_SIZE bUSB_EP_MAX_PKT_SIZE_64
  140. #define USB_FS_EP6_INTERVAL 0x00
  141. //#define USB_QUALIFIER_DESC_ADDR 0x8cff00
  142. //#define USB_OTHER_SPEED_DESC_ADDR 0x8cffA
  143. #endif // end of _USB_TABLE_H_