ti113x.h 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. /*
  2. * ti113x.h 1.31 2002/05/12 18:19:47
  3. *
  4. * The contents of this file are subject to the Mozilla Public License
  5. * Version 1.1 (the "License"); you may not use this file except in
  6. * compliance with the License. You may obtain a copy of the License
  7. * at http://www.mozilla.org/MPL/
  8. *
  9. * Software distributed under the License is distributed on an "AS IS"
  10. * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
  11. * the License for the specific language governing rights and
  12. * limitations under the License.
  13. *
  14. * The initial developer of the original code is David A. Hinds
  15. * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
  16. * are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
  17. *
  18. * Alternatively, the contents of this file may be used under the
  19. * terms of the GNU General Public License version 2 (the "GPL"), in
  20. * which case the provisions of the GPL are applicable instead of the
  21. * above. If you wish to allow the use of your version of this file
  22. * only under the terms of the GPL and not to allow others to use
  23. * your version of this file under the MPL, indicate your decision by
  24. * deleting the provisions above and replace them with the notice and
  25. * other provisions required by the GPL. If you do not delete the
  26. * provisions above, a recipient may use your version of this file
  27. * under either the MPL or the GPL.
  28. */
  29. #ifndef _LINUX_TI113X_H
  30. #define _LINUX_TI113X_H
  31. #ifndef PCI_VENDOR_ID_TI
  32. #define PCI_VENDOR_ID_TI 0x104c
  33. #endif
  34. #ifndef PCI_DEVICE_ID_TI_1130
  35. #define PCI_DEVICE_ID_TI_1130 0xac12
  36. #endif
  37. #ifndef PCI_DEVICE_ID_TI_1031
  38. #define PCI_DEVICE_ID_TI_1031 0xac13
  39. #endif
  40. #ifndef PCI_DEVICE_ID_TI_1131
  41. #define PCI_DEVICE_ID_TI_1131 0xac15
  42. #endif
  43. #ifndef PCI_DEVICE_ID_TI_1210
  44. #define PCI_DEVICE_ID_TI_1210 0xac1a
  45. #endif
  46. #ifndef PCI_DEVICE_ID_TI_1211
  47. #define PCI_DEVICE_ID_TI_1211 0xac1e
  48. #endif
  49. #ifndef PCI_DEVICE_ID_TI_1220
  50. #define PCI_DEVICE_ID_TI_1220 0xac17
  51. #endif
  52. #ifndef PCI_DEVICE_ID_TI_1221
  53. #define PCI_DEVICE_ID_TI_1221 0xac19
  54. #endif
  55. #ifndef PCI_DEVICE_ID_TI_1250A
  56. #define PCI_DEVICE_ID_TI_1250A 0xac16
  57. #endif
  58. #ifndef PCI_DEVICE_ID_TI_1225
  59. #define PCI_DEVICE_ID_TI_1225 0xac1c
  60. #endif
  61. #ifndef PCI_DEVICE_ID_TI_1251A
  62. #define PCI_DEVICE_ID_TI_1251A 0xac1d
  63. #endif
  64. #ifndef PCI_DEVICE_ID_TI_1251B
  65. #define PCI_DEVICE_ID_TI_1251B 0xac1f
  66. #endif
  67. #ifndef PCI_DEVICE_ID_TI_1410
  68. #define PCI_DEVICE_ID_TI_1410 0xac50
  69. #endif
  70. #ifndef PCI_DEVICE_ID_TI_1420
  71. #define PCI_DEVICE_ID_TI_1420 0xac51
  72. #endif
  73. #ifndef PCI_DEVICE_ID_TI_1450
  74. #define PCI_DEVICE_ID_TI_1450 0xac1b
  75. #endif
  76. #ifndef PCI_DEVICE_ID_TI_1451
  77. #define PCI_DEVICE_ID_TI_1451 0xac52
  78. #endif
  79. #ifndef PCI_DEVICE_ID_TI_1510
  80. #define PCI_DEVICE_ID_TI_1510 0xac56
  81. #endif
  82. #ifndef PCI_DEVICE_ID_TI_4410
  83. #define PCI_DEVICE_ID_TI_4410 0xac41
  84. #endif
  85. #ifndef PCI_DEVICE_ID_TI_4450
  86. #define PCI_DEVICE_ID_TI_4450 0xac40
  87. #endif
  88. #ifndef PCI_DEVICE_ID_TI_4451
  89. #define PCI_DEVICE_ID_TI_4451 0xac42
  90. #endif
  91. /* Register definitions for TI 113X PCI-to-CardBus bridges */
  92. /* System Control Register */
  93. #define TI113X_SYSTEM_CONTROL 0x80 /* 32 bit */
  94. #define TI113X_SCR_SMIROUTE 0x04000000
  95. #define TI113X_SCR_SMISTATUS 0x02000000
  96. #define TI113X_SCR_SMIENB 0x01000000
  97. #define TI113X_SCR_VCCPROT 0x00200000
  98. #define TI113X_SCR_REDUCEZV 0x00100000
  99. #define TI113X_SCR_CDREQEN 0x00080000
  100. #define TI113X_SCR_CDMACHAN 0x00070000
  101. #define TI113X_SCR_SOCACTIVE 0x00002000
  102. #define TI113X_SCR_PWRSTREAM 0x00000800
  103. #define TI113X_SCR_DELAYUP 0x00000400
  104. #define TI113X_SCR_DELAYDOWN 0x00000200
  105. #define TI113X_SCR_INTERROGATE 0x00000100
  106. #define TI113X_SCR_CLKRUN_SEL 0x00000080
  107. #define TI113X_SCR_PWRSAVINGS 0x00000040
  108. #define TI113X_SCR_SUBSYSRW 0x00000020
  109. #define TI113X_SCR_CB_DPAR 0x00000010
  110. #define TI113X_SCR_CDMA_EN 0x00000008
  111. #define TI113X_SCR_ASYNC_IRQ 0x00000004
  112. #define TI113X_SCR_KEEPCLK 0x00000002
  113. #define TI113X_SCR_CLKRUN_ENA 0x00000001
  114. #define TI122X_SCR_SER_STEP 0xc0000000
  115. #define TI122X_SCR_INTRTIE 0x20000000
  116. #define TI122X_SCR_P2CCLK 0x08000000
  117. #define TI122X_SCR_CBRSVD 0x00400000
  118. #define TI122X_SCR_MRBURSTDN 0x00008000
  119. #define TI122X_SCR_MRBURSTUP 0x00004000
  120. #define TI122X_SCR_RIMUX 0x00000001
  121. /* Multimedia Control Register */
  122. #define TI1250_MULTIMEDIA_CTL 0x84 /* 8 bit */
  123. #define TI1250_MMC_ZVOUTEN 0x80
  124. #define TI1250_MMC_PORTSEL 0x40
  125. #define TI1250_MMC_ZVEN1 0x02
  126. #define TI1250_MMC_ZVEN0 0x01
  127. #define TI1250_GENERAL_STATUS 0x85 /* 8 bit */
  128. #define TI1250_GPIO0_CONTROL 0x88 /* 8 bit */
  129. #define TI1250_GPIO1_CONTROL 0x89 /* 8 bit */
  130. #define TI1250_GPIO2_CONTROL 0x8a /* 8 bit */
  131. #define TI1250_GPIO3_CONTROL 0x8b /* 8 bit */
  132. #define TI12XX_IRQMUX 0x8c /* 32 bit */
  133. /* Retry Status Register */
  134. #define TI113X_RETRY_STATUS 0x90 /* 8 bit */
  135. #define TI113X_RSR_PCIRETRY 0x80
  136. #define TI113X_RSR_CBRETRY 0x40
  137. #define TI113X_RSR_TEXP_CBB 0x20
  138. #define TI113X_RSR_MEXP_CBB 0x10
  139. #define TI113X_RSR_TEXP_CBA 0x08
  140. #define TI113X_RSR_MEXP_CBA 0x04
  141. #define TI113X_RSR_TEXP_PCI 0x02
  142. #define TI113X_RSR_MEXP_PCI 0x01
  143. /* Card Control Register */
  144. #define TI113X_CARD_CONTROL 0x91 /* 8 bit */
  145. #define TI113X_CCR_RIENB 0x80
  146. #define TI113X_CCR_ZVENABLE 0x40
  147. #define TI113X_CCR_PCI_IRQ_ENA 0x20
  148. #define TI113X_CCR_PCI_IREQ 0x10
  149. #define TI113X_CCR_PCI_CSC 0x08
  150. #define TI113X_CCR_SPKROUTEN 0x02
  151. #define TI113X_CCR_IFG 0x01
  152. #define TI1220_CCR_PORT_SEL 0x20
  153. #define TI122X_CCR_AUD2MUX 0x04
  154. /* Device Control Register */
  155. #define TI113X_DEVICE_CONTROL 0x92 /* 8 bit */
  156. #define TI113X_DCR_5V_FORCE 0x40
  157. #define TI113X_DCR_3V_FORCE 0x20
  158. #define TI113X_DCR_IMODE_MASK 0x06
  159. #define TI113X_DCR_IMODE_ISA 0x02
  160. #define TI113X_DCR_IMODE_SERIAL 0x04
  161. #define TI12XX_DCR_IMODE_PCI_ONLY 0x00
  162. #define TI12XX_DCR_IMODE_ALL_SERIAL 0x06
  163. /* Buffer Control Register */
  164. #define TI113X_BUFFER_CONTROL 0x93 /* 8 bit */
  165. #define TI113X_BCR_CB_READ_DEPTH 0x08
  166. #define TI113X_BCR_CB_WRITE_DEPTH 0x04
  167. #define TI113X_BCR_PCI_READ_DEPTH 0x02
  168. #define TI113X_BCR_PCI_WRITE_DEPTH 0x01
  169. /* Diagnostic Register */
  170. #define TI1250_DIAGNOSTIC 0x93 /* 8 bit */
  171. #define TI1250_DIAG_TRUE_VALUE 0x80
  172. #define TI1250_DIAG_PCI_IREQ 0x40
  173. #define TI1250_DIAG_PCI_CSC 0x20
  174. #define TI1250_DIAG_ASYNC_CSC 0x01
  175. /* DMA Registers */
  176. #define TI113X_DMA_0 0x94 /* 32 bit */
  177. #define TI113X_DMA_1 0x98 /* 32 bit */
  178. /* ExCA IO offset registers */
  179. #define TI113X_IO_OFFSET(map) (0x36+((map)<<1))
  180. /* Data structure for tracking vendor-specific state */
  181. typedef struct ti113x_state_t {
  182. u32 sysctl; /* TI113X_SYSTEM_CONTROL */
  183. u8 cardctl; /* TI113X_CARD_CONTROL */
  184. u8 devctl; /* TI113X_DEVICE_CONTROL */
  185. u8 diag; /* TI1250_DIAGNOSTIC */
  186. u32 irqmux; /* TI12XX_IRQMUX */
  187. } ti113x_state_t;
  188. #define TI_PCIC_ID \
  189. IS_TI1130, IS_TI1131, IS_TI1031, IS_TI1210, IS_TI1211, \
  190. IS_TI1220, IS_TI1221, IS_TI1225, IS_TI1250A, IS_TI1251A, \
  191. IS_TI1251B, IS_TI1410, IS_TI1420, IS_TI1450, IS_TI1451, \
  192. IS_TI1510, IS_TI4410, IS_TI4450, IS_TI4451
  193. #define TI_PCIC_INFO \
  194. { "TI 1130", IS_TI|IS_CARDBUS, ID(TI, 1130) }, \
  195. { "TI 1131", IS_TI|IS_CARDBUS, ID(TI, 1131) }, \
  196. { "TI 1031", IS_TI|IS_CARDBUS, ID(TI, 1031) }, \
  197. { "TI 1210", IS_TI|IS_CARDBUS, ID(TI, 1210) }, \
  198. { "TI 1211", IS_TI|IS_CARDBUS, ID(TI, 1211) }, \
  199. { "TI 1220", IS_TI|IS_CARDBUS, ID(TI, 1220) }, \
  200. { "TI 1221", IS_TI|IS_CARDBUS, ID(TI, 1221) }, \
  201. { "TI 1225", IS_TI|IS_CARDBUS, ID(TI, 1225) }, \
  202. { "TI 1250A", IS_TI|IS_CARDBUS, ID(TI, 1250A) }, \
  203. { "TI 1251A", IS_TI|IS_CARDBUS, ID(TI, 1251A) }, \
  204. { "TI 1251B", IS_TI|IS_CARDBUS, ID(TI, 1251B) }, \
  205. { "TI 1410", IS_TI|IS_CARDBUS, ID(TI, 1410) }, \
  206. { "TI 1420", IS_TI|IS_CARDBUS, ID(TI, 1420) }, \
  207. { "TI 1450", IS_TI|IS_CARDBUS, ID(TI, 1450) }, \
  208. { "TI 1451", IS_TI|IS_CARDBUS, ID(TI, 1451) }, \
  209. { "TI 1510", IS_TI|IS_CARDBUS, ID(TI, 1510) }, \
  210. { "TI 4410", IS_TI|IS_CARDBUS, ID(TI, 4410) }, \
  211. { "TI 4450", IS_TI|IS_CARDBUS, ID(TI, 4450) }, \
  212. { "TI 4451", IS_TI|IS_CARDBUS, ID(TI, 4451) }
  213. #endif /* _LINUX_TI113X_H */