davinci.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (C) 2005-2006 by Texas Instruments
  4. */
  5. #ifndef __MUSB_HDRDF_H__
  6. #define __MUSB_HDRDF_H__
  7. /*
  8. * DaVinci-specific definitions
  9. */
  10. /* Integrated highspeed/otg PHY */
  11. #define USBPHY_CTL_PADDR 0x01c40034
  12. #define USBPHY_DATAPOL BIT(11) /* (dm355) switch D+/D- */
  13. #define USBPHY_PHYCLKGD BIT(8)
  14. #define USBPHY_SESNDEN BIT(7) /* v(sess_end) comparator */
  15. #define USBPHY_VBDTCTEN BIT(6) /* v(bus) comparator */
  16. #define USBPHY_VBUSSENS BIT(5) /* (dm355,ro) is vbus > 0.5V */
  17. #define USBPHY_PHYPLLON BIT(4) /* override pll suspend */
  18. #define USBPHY_CLKO1SEL BIT(3)
  19. #define USBPHY_OSCPDWN BIT(2)
  20. #define USBPHY_OTGPDWN BIT(1)
  21. #define USBPHY_PHYPDWN BIT(0)
  22. #define DM355_DEEPSLEEP_PADDR 0x01c40048
  23. #define DRVVBUS_FORCE BIT(2)
  24. #define DRVVBUS_OVERRIDE BIT(1)
  25. /* For now include usb OTG module registers here */
  26. #define DAVINCI_USB_VERSION_REG 0x00
  27. #define DAVINCI_USB_CTRL_REG 0x04
  28. #define DAVINCI_USB_STAT_REG 0x08
  29. #define DAVINCI_RNDIS_REG 0x10
  30. #define DAVINCI_AUTOREQ_REG 0x14
  31. #define DAVINCI_USB_INT_SOURCE_REG 0x20
  32. #define DAVINCI_USB_INT_SET_REG 0x24
  33. #define DAVINCI_USB_INT_SRC_CLR_REG 0x28
  34. #define DAVINCI_USB_INT_MASK_REG 0x2c
  35. #define DAVINCI_USB_INT_MASK_SET_REG 0x30
  36. #define DAVINCI_USB_INT_MASK_CLR_REG 0x34
  37. #define DAVINCI_USB_INT_SRC_MASKED_REG 0x38
  38. #define DAVINCI_USB_EOI_REG 0x3c
  39. #define DAVINCI_USB_EOI_INTVEC 0x40
  40. /* BEGIN CPPI-generic (?) */
  41. /* CPPI related registers */
  42. #define DAVINCI_TXCPPI_CTRL_REG 0x80
  43. #define DAVINCI_TXCPPI_TEAR_REG 0x84
  44. #define DAVINCI_CPPI_EOI_REG 0x88
  45. #define DAVINCI_CPPI_INTVEC_REG 0x8c
  46. #define DAVINCI_TXCPPI_MASKED_REG 0x90
  47. #define DAVINCI_TXCPPI_RAW_REG 0x94
  48. #define DAVINCI_TXCPPI_INTENAB_REG 0x98
  49. #define DAVINCI_TXCPPI_INTCLR_REG 0x9c
  50. #define DAVINCI_RXCPPI_CTRL_REG 0xC0
  51. #define DAVINCI_RXCPPI_MASKED_REG 0xD0
  52. #define DAVINCI_RXCPPI_RAW_REG 0xD4
  53. #define DAVINCI_RXCPPI_INTENAB_REG 0xD8
  54. #define DAVINCI_RXCPPI_INTCLR_REG 0xDC
  55. #define DAVINCI_RXCPPI_BUFCNT0_REG 0xE0
  56. #define DAVINCI_RXCPPI_BUFCNT1_REG 0xE4
  57. #define DAVINCI_RXCPPI_BUFCNT2_REG 0xE8
  58. #define DAVINCI_RXCPPI_BUFCNT3_REG 0xEC
  59. /* CPPI state RAM entries */
  60. #define DAVINCI_CPPI_STATERAM_BASE_OFFSET 0x100
  61. #define DAVINCI_TXCPPI_STATERAM_OFFSET(chnum) \
  62. (DAVINCI_CPPI_STATERAM_BASE_OFFSET + ((chnum) * 0x40))
  63. #define DAVINCI_RXCPPI_STATERAM_OFFSET(chnum) \
  64. (DAVINCI_CPPI_STATERAM_BASE_OFFSET + 0x20 + ((chnum) * 0x40))
  65. /* CPPI masks */
  66. #define DAVINCI_DMA_CTRL_ENABLE 1
  67. #define DAVINCI_DMA_CTRL_DISABLE 0
  68. #define DAVINCI_DMA_ALL_CHANNELS_ENABLE 0xF
  69. #define DAVINCI_DMA_ALL_CHANNELS_DISABLE 0xF
  70. /* END CPPI-generic (?) */
  71. #define DAVINCI_USB_TX_ENDPTS_MASK 0x1f /* ep0 + 4 tx */
  72. #define DAVINCI_USB_RX_ENDPTS_MASK 0x1e /* 4 rx */
  73. #define DAVINCI_USB_USBINT_SHIFT 16
  74. #define DAVINCI_USB_TXINT_SHIFT 0
  75. #define DAVINCI_USB_RXINT_SHIFT 8
  76. #define DAVINCI_INTR_DRVVBUS 0x0100
  77. #define DAVINCI_USB_USBINT_MASK 0x01ff0000 /* 8 Mentor, DRVVBUS */
  78. #define DAVINCI_USB_TXINT_MASK \
  79. (DAVINCI_USB_TX_ENDPTS_MASK << DAVINCI_USB_TXINT_SHIFT)
  80. #define DAVINCI_USB_RXINT_MASK \
  81. (DAVINCI_USB_RX_ENDPTS_MASK << DAVINCI_USB_RXINT_SHIFT)
  82. #define DAVINCI_BASE_OFFSET 0x400
  83. #endif /* __MUSB_HDRDF_H__ */