msm_hsusb_hw.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. /* USB phy selector - in TCSR address range */
  18. #define USB2_PHY_SEL 0xfd4ab000
  19. #define USB_AHBBURST (MSM_USB_BASE + 0x0090)
  20. #define USB_AHBMODE (MSM_USB_BASE + 0x0098)
  21. #define USB_GENCONFIG_2 (MSM_USB_BASE + 0x00a0)
  22. #define USB_CAPLENGTH (MSM_USB_BASE + 0x0100) /* 8 bit */
  23. #define USB_USBCMD (MSM_USB_BASE + 0x0140)
  24. #define USB_PORTSC (MSM_USB_BASE + 0x0184)
  25. #define USB_OTGSC (MSM_USB_BASE + 0x01A4)
  26. #define USB_USBMODE (MSM_USB_BASE + 0x01A8)
  27. #define USB_PHY_CTRL (MSM_USB_BASE + 0x0240)
  28. #define USB_PHY_CTRL2 (MSM_USB_BASE + 0x0278)
  29. #define GENCONFIG_2_SESS_VLD_CTRL_EN BIT(7)
  30. #define USBCMD_SESS_VLD_CTRL BIT(25)
  31. #define USBCMD_RESET 2
  32. #define USB_USBINTR (MSM_USB_BASE + 0x0148)
  33. #define PORTSC_PHCD (1 << 23) /* phy suspend mode */
  34. #define PORTSC_PTS_MASK (3 << 30)
  35. #define PORTSC_PTS_ULPI (2 << 30)
  36. #define PORTSC_PTS_SERIAL (3 << 30)
  37. #define USB_ULPI_VIEWPORT (MSM_USB_BASE + 0x0170)
  38. #define ULPI_RUN (1 << 30)
  39. #define ULPI_WRITE (1 << 29)
  40. #define ULPI_READ (0 << 29)
  41. #define ULPI_ADDR(n) (((n) & 255) << 16)
  42. #define ULPI_DATA(n) ((n) & 255)
  43. #define ULPI_DATA_READ(n) (((n) >> 8) & 255)
  44. /* synopsys 28nm phy registers */
  45. #define ULPI_PWR_CLK_MNG_REG 0x88
  46. #define OTG_COMP_DISABLE BIT(0)
  47. #define ULPI_MISC_A 0x96
  48. #define ULPI_MISC_A_VBUSVLDEXTSEL BIT(1)
  49. #define ULPI_MISC_A_VBUSVLDEXT BIT(0)
  50. #define ASYNC_INTR_CTRL (1 << 29) /* Enable async interrupt */
  51. #define ULPI_STP_CTRL (1 << 30) /* Block communication with PHY */
  52. #define PHY_RETEN (1 << 1) /* PHY retention enable/disable */
  53. #define PHY_POR_ASSERT (1 << 0) /* USB2 28nm PHY POR ASSERT */
  54. /* OTG definitions */
  55. #define OTGSC_INTSTS_MASK (0x7f << 16)
  56. #define OTGSC_ID (1 << 8)
  57. #define OTGSC_BSV (1 << 11)
  58. #define OTGSC_IDIS (1 << 16)
  59. #define OTGSC_BSVIS (1 << 19)
  60. #define OTGSC_IDIE (1 << 24)
  61. #define OTGSC_BSVIE (1 << 27)
  62. #endif /* __LINUX_USB_GADGET_MSM72K_UDC_H__ */