ehci-fsl.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /*
  2. * Copyright (c) 2005, 2009 Freescale Semiconductor, Inc
  3. * Copyright (c) 2005 MontaVista Software
  4. * Copyright (c) 2008 Excito Elektronik i Sk=E5ne AB
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation; either version 2 of
  9. * the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  19. * MA 02111-1307 USA
  20. */
  21. #ifndef _EHCI_FSL_H
  22. #define _EHCI_FSL_H
  23. #include <asm/processor.h>
  24. /* Global offsets */
  25. #define FSL_SKIP_PCI 0x100
  26. /* offsets for the non-ehci registers in the FSL SOC USB controller */
  27. #define FSL_SOC_USB_ULPIVP 0x170
  28. #define FSL_SOC_USB_PORTSC1 0x184
  29. #define PORT_PTS_MSK (3 << 30)
  30. #define PORT_PTS_UTMI (0 << 30)
  31. #define PORT_PTS_ULPI (2 << 30)
  32. #define PORT_PTS_SERIAL (3 << 30)
  33. #define PORT_PTS_PTW (1 << 28)
  34. /* USBMODE Register bits */
  35. #define CM_IDLE (0 << 0)
  36. #define CM_RESERVED (1 << 0)
  37. #define CM_DEVICE (2 << 0)
  38. #define CM_HOST (3 << 0)
  39. #define USBMODE_RESERVED_2 (0 << 2)
  40. #define SLOM (1 << 3)
  41. #define SDIS (1 << 4)
  42. /* CONTROL Register bits */
  43. #define ULPI_INT_EN (1 << 0)
  44. #define WU_INT_EN (1 << 1)
  45. #define USB_EN (1 << 2)
  46. #define LSF_EN (1 << 3)
  47. #define KEEP_OTG_ON (1 << 4)
  48. #define OTG_PORT (1 << 5)
  49. #define REFSEL_12MHZ (0 << 6)
  50. #define REFSEL_16MHZ (1 << 6)
  51. #define REFSEL_48MHZ (2 << 6)
  52. #define PLL_RESET (1 << 8)
  53. #define UTMI_PHY_EN (1 << 9)
  54. #define PHY_CLK_SEL_UTMI (0 << 10)
  55. #define PHY_CLK_SEL_ULPI (1 << 10)
  56. #define CLKIN_SEL_USB_CLK (0 << 11)
  57. #define CLKIN_SEL_USB_CLK2 (1 << 11)
  58. #define CLKIN_SEL_SYS_CLK (2 << 11)
  59. #define CLKIN_SEL_SYS_CLK2 (3 << 11)
  60. #define RESERVED_18 (0 << 13)
  61. #define RESERVED_17 (0 << 14)
  62. #define RESERVED_16 (0 << 15)
  63. #define WU_INT (1 << 16)
  64. #define PHY_CLK_VALID (1 << 17)
  65. #define FSL_SOC_USB_PORTSC2 0x188
  66. #define FSL_SOC_USB_USBMODE 0x1a8
  67. #define FSL_SOC_USB_SNOOP1 0x400 /* NOTE: big-endian */
  68. #define FSL_SOC_USB_SNOOP2 0x404 /* NOTE: big-endian */
  69. #define FSL_SOC_USB_AGECNTTHRSH 0x408 /* NOTE: big-endian */
  70. #define FSL_SOC_USB_PRICTRL 0x40c /* NOTE: big-endian */
  71. #define FSL_SOC_USB_SICTRL 0x410 /* NOTE: big-endian */
  72. #define FSL_SOC_USB_CTRL 0x500 /* NOTE: big-endian */
  73. #define SNOOP_SIZE_2GB 0x1e
  74. /* System Clock Control Register */
  75. #define MPC83XX_SCCR_USB_MASK 0x00f00000
  76. #define MPC83XX_SCCR_USB_DRCM_11 0x00300000
  77. #define MPC83XX_SCCR_USB_DRCM_01 0x00100000
  78. #define MPC83XX_SCCR_USB_DRCM_10 0x00200000
  79. #if defined(CONFIG_MPC83xx)
  80. #define CONFIG_SYS_MPC8xxx_USB_ADDR CONFIG_SYS_MPC83xx_USB_ADDR
  81. #elif defined(CONFIG_MPC85xx)
  82. #define CONFIG_SYS_MPC8xxx_USB_ADDR CONFIG_SYS_MPC85xx_USB_ADDR
  83. #endif
  84. /*
  85. * USB Registers
  86. */
  87. struct usb_ehci {
  88. u8 res1[0x100];
  89. u16 caplength; /* 0x100 - Capability Register Length */
  90. u16 hciversion; /* 0x102 - Host Interface Version */
  91. u32 hcsparams; /* 0x104 - Host Structural Parameters */
  92. u32 hccparams; /* 0x108 - Host Capability Parameters */
  93. u8 res2[0x14];
  94. u32 dciversion; /* 0x120 - Device Interface Version */
  95. u32 dciparams; /* 0x124 - Device Controller Params */
  96. u8 res3[0x18];
  97. u32 usbcmd; /* 0x140 - USB Command */
  98. u32 usbsts; /* 0x144 - USB Status */
  99. u32 usbintr; /* 0x148 - USB Interrupt Enable */
  100. u32 frindex; /* 0x14C - USB Frame Index */
  101. u8 res4[0x4];
  102. u32 perlistbase; /* 0x154 - Periodic List Base
  103. - USB Device Address */
  104. u32 ep_list_addr; /* 0x158 - Next Asynchronous List
  105. - End Point Address */
  106. u8 res5[0x4];
  107. u32 burstsize; /* 0x160 - Programmable Burst Size */
  108. u32 txfilltuning; /* 0x164 - Host TT Transmit
  109. pre-buffer packet tuning */
  110. u8 res6[0x8];
  111. u32 ulpi_viewpoint; /* 0x170 - ULPI Reister Access */
  112. u8 res7[0xc];
  113. u32 config_flag; /* 0x180 - Configured Flag Register */
  114. u32 portsc; /* 0x184 - Port status/control */
  115. u8 res8[0x20];
  116. u32 usbmode; /* 0x1a8 - USB Device Mode */
  117. u32 epsetupstat; /* 0x1ac - End Point Setup Status */
  118. u32 epprime; /* 0x1b0 - End Point Init Status */
  119. u32 epflush; /* 0x1b4 - End Point De-initlialize */
  120. u32 epstatus; /* 0x1b8 - End Point Status */
  121. u32 epcomplete; /* 0x1bc - End Point Complete */
  122. u32 epctrl0; /* 0x1c0 - End Point Control 0 */
  123. u32 epctrl1; /* 0x1c4 - End Point Control 1 */
  124. u32 epctrl2; /* 0x1c8 - End Point Control 2 */
  125. u32 epctrl3; /* 0x1cc - End Point Control 3 */
  126. u32 epctrl4; /* 0x1d0 - End Point Control 4 */
  127. u32 epctrl5; /* 0x1d4 - End Point Control 5 */
  128. u8 res9[0x228];
  129. u32 snoop1; /* 0x400 - Snoop 1 */
  130. u32 snoop2; /* 0x404 - Snoop 2 */
  131. u32 age_cnt_limit; /* 0x408 - Age Count Threshold */
  132. u32 prictrl; /* 0x40c - Priority Control */
  133. u32 sictrl; /* 0x410 - System Interface Control */
  134. u8 res10[0xEC];
  135. u32 control; /* 0x500 - Control */
  136. u8 res11[0xafc];
  137. };
  138. #endif /* _EHCI_FSL_H */