regs.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. #ifndef __LINUX_ULPI_REGS_H
  2. #define __LINUX_ULPI_REGS_H
  3. /*
  4. * Macros for Set and Clear
  5. * See ULPI 1.1 specification to find the registers with Set and Clear offsets
  6. */
  7. #define ULPI_SET(a) (a + 1)
  8. #define ULPI_CLR(a) (a + 2)
  9. /*
  10. * Register Map
  11. */
  12. #define ULPI_VENDOR_ID_LOW 0x00
  13. #define ULPI_VENDOR_ID_HIGH 0x01
  14. #define ULPI_PRODUCT_ID_LOW 0x02
  15. #define ULPI_PRODUCT_ID_HIGH 0x03
  16. #define ULPI_FUNC_CTRL 0x04
  17. #define ULPI_IFC_CTRL 0x07
  18. #define ULPI_OTG_CTRL 0x0a
  19. #define ULPI_USB_INT_EN_RISE 0x0d
  20. #define ULPI_USB_INT_EN_FALL 0x10
  21. #define ULPI_USB_INT_STS 0x13
  22. #define ULPI_USB_INT_LATCH 0x14
  23. #define ULPI_DEBUG 0x15
  24. #define ULPI_SCRATCH 0x16
  25. /* Optional Carkit Registers */
  26. #define ULPI_CARKIT_CTRL 0x19
  27. #define ULPI_CARKIT_INT_DELAY 0x1c
  28. #define ULPI_CARKIT_INT_EN 0x1d
  29. #define ULPI_CARKIT_INT_STS 0x20
  30. #define ULPI_CARKIT_INT_LATCH 0x21
  31. #define ULPI_CARKIT_PLS_CTRL 0x22
  32. /* Other Optional Registers */
  33. #define ULPI_TX_POS_WIDTH 0x25
  34. #define ULPI_TX_NEG_WIDTH 0x26
  35. #define ULPI_POLARITY_RECOVERY 0x27
  36. /* Access Extended Register Set */
  37. #define ULPI_ACCESS_EXTENDED 0x2f
  38. /* Vendor Specific */
  39. #define ULPI_VENDOR_SPECIFIC 0x30
  40. /* Extended Registers */
  41. #define ULPI_EXT_VENDOR_SPECIFIC 0x80
  42. /*
  43. * Register Bits
  44. */
  45. /* Function Control */
  46. #define ULPI_FUNC_CTRL_XCVRSEL BIT(0)
  47. #define ULPI_FUNC_CTRL_XCVRSEL_MASK 0x3
  48. #define ULPI_FUNC_CTRL_HIGH_SPEED 0x0
  49. #define ULPI_FUNC_CTRL_FULL_SPEED 0x1
  50. #define ULPI_FUNC_CTRL_LOW_SPEED 0x2
  51. #define ULPI_FUNC_CTRL_FS4LS 0x3
  52. #define ULPI_FUNC_CTRL_TERMSELECT BIT(2)
  53. #define ULPI_FUNC_CTRL_OPMODE BIT(3)
  54. #define ULPI_FUNC_CTRL_OPMODE_MASK (0x3 << 3)
  55. #define ULPI_FUNC_CTRL_OPMODE_NORMAL (0x0 << 3)
  56. #define ULPI_FUNC_CTRL_OPMODE_NONDRIVING (0x1 << 3)
  57. #define ULPI_FUNC_CTRL_OPMODE_DISABLE_NRZI (0x2 << 3)
  58. #define ULPI_FUNC_CTRL_OPMODE_NOSYNC_NOEOP (0x3 << 3)
  59. #define ULPI_FUNC_CTRL_RESET BIT(5)
  60. #define ULPI_FUNC_CTRL_SUSPENDM BIT(6)
  61. /* Interface Control */
  62. #define ULPI_IFC_CTRL_6_PIN_SERIAL_MODE BIT(0)
  63. #define ULPI_IFC_CTRL_3_PIN_SERIAL_MODE BIT(1)
  64. #define ULPI_IFC_CTRL_CARKITMODE BIT(2)
  65. #define ULPI_IFC_CTRL_CLOCKSUSPENDM BIT(3)
  66. #define ULPI_IFC_CTRL_AUTORESUME BIT(4)
  67. #define ULPI_IFC_CTRL_EXTERNAL_VBUS BIT(5)
  68. #define ULPI_IFC_CTRL_PASSTHRU BIT(6)
  69. #define ULPI_IFC_CTRL_PROTECT_IFC_DISABLE BIT(7)
  70. /* OTG Control */
  71. #define ULPI_OTG_CTRL_ID_PULLUP BIT(0)
  72. #define ULPI_OTG_CTRL_DP_PULLDOWN BIT(1)
  73. #define ULPI_OTG_CTRL_DM_PULLDOWN BIT(2)
  74. #define ULPI_OTG_CTRL_DISCHRGVBUS BIT(3)
  75. #define ULPI_OTG_CTRL_CHRGVBUS BIT(4)
  76. #define ULPI_OTG_CTRL_DRVVBUS BIT(5)
  77. #define ULPI_OTG_CTRL_DRVVBUS_EXT BIT(6)
  78. #define ULPI_OTG_CTRL_EXTVBUSIND BIT(7)
  79. /* USB Interrupt Enable Rising,
  80. * USB Interrupt Enable Falling,
  81. * USB Interrupt Status and
  82. * USB Interrupt Latch
  83. */
  84. #define ULPI_INT_HOST_DISCONNECT BIT(0)
  85. #define ULPI_INT_VBUS_VALID BIT(1)
  86. #define ULPI_INT_SESS_VALID BIT(2)
  87. #define ULPI_INT_SESS_END BIT(3)
  88. #define ULPI_INT_IDGRD BIT(4)
  89. /* Debug */
  90. #define ULPI_DEBUG_LINESTATE0 BIT(0)
  91. #define ULPI_DEBUG_LINESTATE1 BIT(1)
  92. /* Carkit Control */
  93. #define ULPI_CARKIT_CTRL_CARKITPWR BIT(0)
  94. #define ULPI_CARKIT_CTRL_IDGNDDRV BIT(1)
  95. #define ULPI_CARKIT_CTRL_TXDEN BIT(2)
  96. #define ULPI_CARKIT_CTRL_RXDEN BIT(3)
  97. #define ULPI_CARKIT_CTRL_SPKLEFTEN BIT(4)
  98. #define ULPI_CARKIT_CTRL_SPKRIGHTEN BIT(5)
  99. #define ULPI_CARKIT_CTRL_MICEN BIT(6)
  100. /* Carkit Interrupt Enable */
  101. #define ULPI_CARKIT_INT_EN_IDFLOAT_RISE BIT(0)
  102. #define ULPI_CARKIT_INT_EN_IDFLOAT_FALL BIT(1)
  103. #define ULPI_CARKIT_INT_EN_CARINTDET BIT(2)
  104. #define ULPI_CARKIT_INT_EN_DP_RISE BIT(3)
  105. #define ULPI_CARKIT_INT_EN_DP_FALL BIT(4)
  106. /* Carkit Interrupt Status and
  107. * Carkit Interrupt Latch
  108. */
  109. #define ULPI_CARKIT_INT_IDFLOAT BIT(0)
  110. #define ULPI_CARKIT_INT_CARINTDET BIT(1)
  111. #define ULPI_CARKIT_INT_DP BIT(2)
  112. /* Carkit Pulse Control*/
  113. #define ULPI_CARKIT_PLS_CTRL_TXPLSEN BIT(0)
  114. #define ULPI_CARKIT_PLS_CTRL_RXPLSEN BIT(1)
  115. #define ULPI_CARKIT_PLS_CTRL_SPKRLEFT_BIASEN BIT(2)
  116. #define ULPI_CARKIT_PLS_CTRL_SPKRRIGHT_BIASEN BIT(3)
  117. #endif /* __LINUX_ULPI_REGS_H */