msm_hsusb_hw.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /*
  2. * Copyright (C) 2007 Google, Inc.
  3. * Author: Brian Swetland <swetland@google.com>
  4. *
  5. * This software is licensed under the terms of the GNU General Public
  6. * License version 2, as published by the Free Software Foundation, and
  7. * may be copied, distributed, and modified under those terms.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. */
  15. #ifndef __LINUX_USB_GADGET_MSM72K_UDC_H__
  16. #define __LINUX_USB_GADGET_MSM72K_UDC_H__
  17. #define USB_AHBBURST (MSM_USB_BASE + 0x0090)
  18. #define USB_AHBMODE (MSM_USB_BASE + 0x0098)
  19. #define USB_GENCONFIG (MSM_USB_BASE + 0x009C)
  20. #define USB_GENCONFIG2 (MSM_USB_BASE + 0x00A0)
  21. #define USB_CAPLENGTH (MSM_USB_BASE + 0x0100) /* 8 bit */
  22. #define USB_HS_GPTIMER_BASE (MSM_USB_BASE + 0x80)
  23. #define GENCFG2_SESS_VLD_CTRL_EN BIT(7)
  24. #define GENCFG2_LINESTATE_DIFF_WAKEUP_EN BIT(12)
  25. #define USB_USBCMD (MSM_USB_BASE + 0x0140)
  26. #define USB_USBSTS (MSM_USB_BASE + 0x0144)
  27. #define USB_PORTSC (MSM_USB_BASE + 0x0184)
  28. #define USB_OTGSC (MSM_USB_BASE + 0x01A4)
  29. #define USB_USBMODE (MSM_USB_BASE + 0x01A8)
  30. #define USB_PHY_CTRL (MSM_USB_BASE + 0x0240)
  31. #define USB_PHY_CTRL2 (MSM_USB_BASE + 0x0278)
  32. #define USBCMD_RESET 2
  33. #define USBCMD_SESS_VLD_CTRL BIT(25)
  34. #define USB_USBINTR (MSM_USB_BASE + 0x0148)
  35. #define USB_FRINDEX (MSM_USB_BASE + 0x014C)
  36. #define USB_L1_EP_CTRL (MSM_USB_BASE + 0x0250)
  37. #define USB_L1_CONFIG (MSM_USB_BASE + 0x0254)
  38. #define L1_CONFIG_LPM_EN BIT(4)
  39. #define L1_CONFIG_REMOTE_WAKEUP BIT(5)
  40. #define L1_CONFIG_GATE_SYS_CLK BIT(7)
  41. #define L1_CONFIG_PHY_LPM BIT(10)
  42. #define L1_CONFIG_PLL BIT(11)
  43. #define AHB2AHB_BYPASS BIT(31)
  44. #define AHB2AHB_BYPASS_BIT_MASK BIT(31)
  45. #define AHB2AHB_BYPASS_CLEAR (0 << 31)
  46. #define PORTSC_PHCD (1 << 23) /* phy suspend mode */
  47. #define PORTSC_PTS_MASK (3 << 30)
  48. #define PORTSC_PTS_ULPI (3 << 30)
  49. #define PORTSC_LS (3 << 10)
  50. #define PORTSC_LS_DM (1 << 10)
  51. #define PORTSC_CSC (1 << 1)
  52. #define PORTSC_CCS (1 << 0)
  53. #define USB_ULPI_VIEWPORT (MSM_USB_BASE + 0x0170)
  54. #define ULPI_RUN (1 << 30)
  55. #define ULPI_WRITE (1 << 29)
  56. #define ULPI_READ (0 << 29)
  57. #define ULPI_SYNC_STATE (1 << 27)
  58. #define ULPI_ADDR(n) (((n) & 255) << 16)
  59. #define ULPI_DATA(n) ((n) & 255)
  60. #define ULPI_DATA_READ(n) (((n) >> 8) & 255)
  61. #define GENCONFIG_BAM_DISABLE (1 << 13)
  62. /* synopsys 28nm phy registers */
  63. #define ULPI_PWR_CLK_MNG_REG 0x88
  64. #define OTG_COMP_DISABLE BIT(0)
  65. /* ulpi manual dp registers */
  66. #define ULPI_MISC_A 0x96
  67. #define ULPI_MISC_A_VBUSVLDEXT BIT(0)
  68. #define ULPI_MISC_A_VBUSVLDEXTSEL BIT(1)
  69. #define PHY_ALT_INT (1 << 28) /* PHY alternate interrupt */
  70. #define ASYNC_INTR_CTRL (1 << 29) /* Enable async interrupt */
  71. #define ULPI_STP_CTRL (1 << 30) /* Block communication with PHY */
  72. #define PHY_RETEN (1 << 1) /* PHY retention enable/disable */
  73. #define PHY_IDHV_INTEN (1 << 8) /* PHY ID HV interrupt */
  74. #define PHY_OTGSESSVLDHV_INTEN (1 << 9) /* PHY Session Valid HV int. */
  75. #define PHY_DPSE_INTEN (1 << 14) /* PHY DPSE HV interrupt*/
  76. #define PHY_DMSE_INTEN (1 << 20) /* PHY DMSE HV interrupt*/
  77. #define PHY_CLAMP_DPDMSE_EN (1 << 21) /* PHY mpm DP DM clamp enable */
  78. #define PHY_POR_BIT_MASK BIT(0)
  79. #define PHY_POR_ASSERT (1 << 0) /* USB2 28nm PHY POR ASSERT */
  80. #define PHY_POR_DEASSERT (0 << 0) /* USB2 28nm PHY POR DEASSERT */
  81. #define STS_PCI (1 << 2) /* R/WC - Port Change Detect */
  82. #define STS_URI (1 << 6) /* R/WC - RESET recv'd */
  83. #define STS_SLI (1 << 8) /* R/WC - suspend state entered */
  84. /* OTG definitions */
  85. #define OTGSC_INTSTS_MASK (0x7f << 16)
  86. #define OTGSC_IDPU (1 << 5)
  87. #define OTGSC_INTR_MASK (0x7f << 24)
  88. #define OTGSC_HADP (1 << 6)
  89. #define OTGSC_ID (1 << 8)
  90. #define OTGSC_BSV (1 << 11)
  91. #define OTGSC_IDIS (1 << 16)
  92. #define OTGSC_BSVIS (1 << 19)
  93. #define OTGSC_IDIE (1 << 24)
  94. #define OTGSC_BSVIE (1 << 27)
  95. #define OTGSC_DPIE (1 << 30)
  96. #define OTGSC_DPIS (1 << 22)
  97. /* OTG interrupt status mask */
  98. #define OTG_USBSTS_MASK (STS_PCI | STS_URI | STS_SLI | PHY_ALT_INT)
  99. #define OTG_OTGSTS_MASK (OTGSC_IDIS | OTGSC_BSVIS | OTGSC_DPIS)
  100. #endif /* __LINUX_USB_GADGET_MSM72K_UDC_H__ */