tioca.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  1. #ifndef _ASM_IA64_SN_TIO_TIOCA_H
  2. #define _ASM_IA64_SN_TIO_TIOCA_H
  3. /*
  4. * This file is subject to the terms and conditions of the GNU General Public
  5. * License. See the file "COPYING" in the main directory of this archive
  6. * for more details.
  7. *
  8. * Copyright (c) 2003-2005 Silicon Graphics, Inc. All rights reserved.
  9. */
  10. #define TIOCA_PART_NUM 0xE020
  11. #define TIOCA_MFGR_NUM 0x24
  12. #define TIOCA_REV_A 0x1
  13. /*
  14. * Register layout for TIO:CA. See below for bitmasks for each register.
  15. */
  16. struct tioca {
  17. u64 ca_id; /* 0x000000 */
  18. u64 ca_control1; /* 0x000008 */
  19. u64 ca_control2; /* 0x000010 */
  20. u64 ca_status1; /* 0x000018 */
  21. u64 ca_status2; /* 0x000020 */
  22. u64 ca_gart_aperature; /* 0x000028 */
  23. u64 ca_gfx_detach; /* 0x000030 */
  24. u64 ca_inta_dest_addr; /* 0x000038 */
  25. u64 ca_intb_dest_addr; /* 0x000040 */
  26. u64 ca_err_int_dest_addr; /* 0x000048 */
  27. u64 ca_int_status; /* 0x000050 */
  28. u64 ca_int_status_alias; /* 0x000058 */
  29. u64 ca_mult_error; /* 0x000060 */
  30. u64 ca_mult_error_alias; /* 0x000068 */
  31. u64 ca_first_error; /* 0x000070 */
  32. u64 ca_int_mask; /* 0x000078 */
  33. u64 ca_crm_pkterr_type; /* 0x000080 */
  34. u64 ca_crm_pkterr_type_alias; /* 0x000088 */
  35. u64 ca_crm_ct_error_detail_1; /* 0x000090 */
  36. u64 ca_crm_ct_error_detail_2; /* 0x000098 */
  37. u64 ca_crm_tnumto; /* 0x0000A0 */
  38. u64 ca_gart_err; /* 0x0000A8 */
  39. u64 ca_pcierr_type; /* 0x0000B0 */
  40. u64 ca_pcierr_addr; /* 0x0000B8 */
  41. u64 ca_pad_0000C0[3]; /* 0x0000{C0..D0} */
  42. u64 ca_pci_rd_buf_flush; /* 0x0000D8 */
  43. u64 ca_pci_dma_addr_extn; /* 0x0000E0 */
  44. u64 ca_agp_dma_addr_extn; /* 0x0000E8 */
  45. u64 ca_force_inta; /* 0x0000F0 */
  46. u64 ca_force_intb; /* 0x0000F8 */
  47. u64 ca_debug_vector_sel; /* 0x000100 */
  48. u64 ca_debug_mux_core_sel; /* 0x000108 */
  49. u64 ca_debug_mux_pci_sel; /* 0x000110 */
  50. u64 ca_debug_domain_sel; /* 0x000118 */
  51. u64 ca_pad_000120[28]; /* 0x0001{20..F8} */
  52. u64 ca_gart_ptr_table; /* 0x200 */
  53. u64 ca_gart_tlb_addr[8]; /* 0x2{08..40} */
  54. };
  55. /*
  56. * Mask/shift definitions for TIO:CA registers. The convention here is
  57. * to mainly use the names as they appear in the "TIO AEGIS Programmers'
  58. * Reference" with a CA_ prefix added. Some exceptions were made to fix
  59. * duplicate field names or to generalize fields that are common to
  60. * different registers (ca_debug_mux_core_sel and ca_debug_mux_pci_sel for
  61. * example).
  62. *
  63. * Fields consisting of a single bit have a single #define have a single
  64. * macro declaration to mask the bit. Fields consisting of multiple bits
  65. * have two declarations: one to mask the proper bits in a register, and
  66. * a second with the suffix "_SHFT" to identify how far the mask needs to
  67. * be shifted right to get its base value.
  68. */
  69. /* ==== ca_control1 */
  70. #define CA_SYS_BIG_END (1ull << 0)
  71. #define CA_DMA_AGP_SWAP (1ull << 1)
  72. #define CA_DMA_PCI_SWAP (1ull << 2)
  73. #define CA_PIO_IO_SWAP (1ull << 3)
  74. #define CA_PIO_MEM_SWAP (1ull << 4)
  75. #define CA_GFX_WR_SWAP (1ull << 5)
  76. #define CA_AGP_FW_ENABLE (1ull << 6)
  77. #define CA_AGP_CAL_CYCLE (0x7ull << 7)
  78. #define CA_AGP_CAL_CYCLE_SHFT 7
  79. #define CA_AGP_CAL_PRSCL_BYP (1ull << 10)
  80. #define CA_AGP_INIT_CAL_ENB (1ull << 11)
  81. #define CA_INJ_ADDR_PERR (1ull << 12)
  82. #define CA_INJ_DATA_PERR (1ull << 13)
  83. /* bits 15:14 unused */
  84. #define CA_PCIM_IO_NBE_AD (0x7ull << 16)
  85. #define CA_PCIM_IO_NBE_AD_SHFT 16
  86. #define CA_PCIM_FAST_BTB_ENB (1ull << 19)
  87. /* bits 23:20 unused */
  88. #define CA_PIO_ADDR_OFFSET (0xffull << 24)
  89. #define CA_PIO_ADDR_OFFSET_SHFT 24
  90. /* bits 35:32 unused */
  91. #define CA_AGPDMA_OP_COMBDELAY (0x1full << 36)
  92. #define CA_AGPDMA_OP_COMBDELAY_SHFT 36
  93. /* bit 41 unused */
  94. #define CA_AGPDMA_OP_ENB_COMBDELAY (1ull << 42)
  95. #define CA_PCI_INT_LPCNT (0xffull << 44)
  96. #define CA_PCI_INT_LPCNT_SHFT 44
  97. /* bits 63:52 unused */
  98. /* ==== ca_control2 */
  99. #define CA_AGP_LATENCY_TO (0xffull << 0)
  100. #define CA_AGP_LATENCY_TO_SHFT 0
  101. #define CA_PCI_LATENCY_TO (0xffull << 8)
  102. #define CA_PCI_LATENCY_TO_SHFT 8
  103. #define CA_PCI_MAX_RETRY (0x3ffull << 16)
  104. #define CA_PCI_MAX_RETRY_SHFT 16
  105. /* bits 27:26 unused */
  106. #define CA_RT_INT_EN (0x3ull << 28)
  107. #define CA_RT_INT_EN_SHFT 28
  108. #define CA_MSI_INT_ENB (1ull << 30)
  109. #define CA_PCI_ARB_ERR_ENB (1ull << 31)
  110. #define CA_GART_MEM_PARAM (0x3ull << 32)
  111. #define CA_GART_MEM_PARAM_SHFT 32
  112. #define CA_GART_RD_PREFETCH_ENB (1ull << 34)
  113. #define CA_GART_WR_PREFETCH_ENB (1ull << 35)
  114. #define CA_GART_FLUSH_TLB (1ull << 36)
  115. /* bits 39:37 unused */
  116. #define CA_CRM_TNUMTO_PERIOD (0x1fffull << 40)
  117. #define CA_CRM_TNUMTO_PERIOD_SHFT 40
  118. /* bits 55:53 unused */
  119. #define CA_CRM_TNUMTO_ENB (1ull << 56)
  120. #define CA_CRM_PRESCALER_BYP (1ull << 57)
  121. /* bits 59:58 unused */
  122. #define CA_CRM_MAX_CREDIT (0x7ull << 60)
  123. #define CA_CRM_MAX_CREDIT_SHFT 60
  124. /* bit 63 unused */
  125. /* ==== ca_status1 */
  126. #define CA_CORELET_ID (0x3ull << 0)
  127. #define CA_CORELET_ID_SHFT 0
  128. #define CA_INTA_N (1ull << 2)
  129. #define CA_INTB_N (1ull << 3)
  130. #define CA_CRM_CREDIT_AVAIL (0x7ull << 4)
  131. #define CA_CRM_CREDIT_AVAIL_SHFT 4
  132. /* bit 7 unused */
  133. #define CA_CRM_SPACE_AVAIL (0x7full << 8)
  134. #define CA_CRM_SPACE_AVAIL_SHFT 8
  135. /* bit 15 unused */
  136. #define CA_GART_TLB_VAL (0xffull << 16)
  137. #define CA_GART_TLB_VAL_SHFT 16
  138. /* bits 63:24 unused */
  139. /* ==== ca_status2 */
  140. #define CA_GFX_CREDIT_AVAIL (0xffull << 0)
  141. #define CA_GFX_CREDIT_AVAIL_SHFT 0
  142. #define CA_GFX_OPQ_AVAIL (0xffull << 8)
  143. #define CA_GFX_OPQ_AVAIL_SHFT 8
  144. #define CA_GFX_WRBUFF_AVAIL (0xffull << 16)
  145. #define CA_GFX_WRBUFF_AVAIL_SHFT 16
  146. #define CA_ADMA_OPQ_AVAIL (0xffull << 24)
  147. #define CA_ADMA_OPQ_AVAIL_SHFT 24
  148. #define CA_ADMA_WRBUFF_AVAIL (0xffull << 32)
  149. #define CA_ADMA_WRBUFF_AVAIL_SHFT 32
  150. #define CA_ADMA_RDBUFF_AVAIL (0x7full << 40)
  151. #define CA_ADMA_RDBUFF_AVAIL_SHFT 40
  152. #define CA_PCI_PIO_OP_STAT (1ull << 47)
  153. #define CA_PDMA_OPQ_AVAIL (0xfull << 48)
  154. #define CA_PDMA_OPQ_AVAIL_SHFT 48
  155. #define CA_PDMA_WRBUFF_AVAIL (0xfull << 52)
  156. #define CA_PDMA_WRBUFF_AVAIL_SHFT 52
  157. #define CA_PDMA_RDBUFF_AVAIL (0x3ull << 56)
  158. #define CA_PDMA_RDBUFF_AVAIL_SHFT 56
  159. /* bits 63:58 unused */
  160. /* ==== ca_gart_aperature */
  161. #define CA_GART_AP_ENB_AGP (1ull << 0)
  162. #define CA_GART_PAGE_SIZE (1ull << 1)
  163. #define CA_GART_AP_ENB_PCI (1ull << 2)
  164. /* bits 11:3 unused */
  165. #define CA_GART_AP_SIZE (0x3ffull << 12)
  166. #define CA_GART_AP_SIZE_SHFT 12
  167. #define CA_GART_AP_BASE (0x3ffffffffffull << 22)
  168. #define CA_GART_AP_BASE_SHFT 22
  169. /* ==== ca_inta_dest_addr
  170. ==== ca_intb_dest_addr
  171. ==== ca_err_int_dest_addr */
  172. /* bits 2:0 unused */
  173. #define CA_INT_DEST_ADDR (0x7ffffffffffffull << 3)
  174. #define CA_INT_DEST_ADDR_SHFT 3
  175. /* bits 55:54 unused */
  176. #define CA_INT_DEST_VECT (0xffull << 56)
  177. #define CA_INT_DEST_VECT_SHFT 56
  178. /* ==== ca_int_status */
  179. /* ==== ca_int_status_alias */
  180. /* ==== ca_mult_error */
  181. /* ==== ca_mult_error_alias */
  182. /* ==== ca_first_error */
  183. /* ==== ca_int_mask */
  184. #define CA_PCI_ERR (1ull << 0)
  185. /* bits 3:1 unused */
  186. #define CA_GART_FETCH_ERR (1ull << 4)
  187. #define CA_GFX_WR_OVFLW (1ull << 5)
  188. #define CA_PIO_REQ_OVFLW (1ull << 6)
  189. #define CA_CRM_PKTERR (1ull << 7)
  190. #define CA_CRM_DVERR (1ull << 8)
  191. #define CA_TNUMTO (1ull << 9)
  192. #define CA_CXM_RSP_CRED_OVFLW (1ull << 10)
  193. #define CA_CXM_REQ_CRED_OVFLW (1ull << 11)
  194. #define CA_PIO_INVALID_ADDR (1ull << 12)
  195. #define CA_PCI_ARB_TO (1ull << 13)
  196. #define CA_AGP_REQ_OFLOW (1ull << 14)
  197. #define CA_SBA_TYPE1_ERR (1ull << 15)
  198. /* bit 16 unused */
  199. #define CA_INTA (1ull << 17)
  200. #define CA_INTB (1ull << 18)
  201. #define CA_MULT_INTA (1ull << 19)
  202. #define CA_MULT_INTB (1ull << 20)
  203. #define CA_GFX_CREDIT_OVFLW (1ull << 21)
  204. /* bits 63:22 unused */
  205. /* ==== ca_crm_pkterr_type */
  206. /* ==== ca_crm_pkterr_type_alias */
  207. #define CA_CRM_PKTERR_SBERR_HDR (1ull << 0)
  208. #define CA_CRM_PKTERR_DIDN (1ull << 1)
  209. #define CA_CRM_PKTERR_PACTYPE (1ull << 2)
  210. #define CA_CRM_PKTERR_INV_TNUM (1ull << 3)
  211. #define CA_CRM_PKTERR_ADDR_RNG (1ull << 4)
  212. #define CA_CRM_PKTERR_ADDR_ALGN (1ull << 5)
  213. #define CA_CRM_PKTERR_HDR_PARAM (1ull << 6)
  214. #define CA_CRM_PKTERR_CW_ERR (1ull << 7)
  215. #define CA_CRM_PKTERR_SBERR_NH (1ull << 8)
  216. #define CA_CRM_PKTERR_EARLY_TERM (1ull << 9)
  217. #define CA_CRM_PKTERR_EARLY_TAIL (1ull << 10)
  218. #define CA_CRM_PKTERR_MSSNG_TAIL (1ull << 11)
  219. #define CA_CRM_PKTERR_MSSNG_HDR (1ull << 12)
  220. /* bits 15:13 unused */
  221. #define CA_FIRST_CRM_PKTERR_SBERR_HDR (1ull << 16)
  222. #define CA_FIRST_CRM_PKTERR_DIDN (1ull << 17)
  223. #define CA_FIRST_CRM_PKTERR_PACTYPE (1ull << 18)
  224. #define CA_FIRST_CRM_PKTERR_INV_TNUM (1ull << 19)
  225. #define CA_FIRST_CRM_PKTERR_ADDR_RNG (1ull << 20)
  226. #define CA_FIRST_CRM_PKTERR_ADDR_ALGN (1ull << 21)
  227. #define CA_FIRST_CRM_PKTERR_HDR_PARAM (1ull << 22)
  228. #define CA_FIRST_CRM_PKTERR_CW_ERR (1ull << 23)
  229. #define CA_FIRST_CRM_PKTERR_SBERR_NH (1ull << 24)
  230. #define CA_FIRST_CRM_PKTERR_EARLY_TERM (1ull << 25)
  231. #define CA_FIRST_CRM_PKTERR_EARLY_TAIL (1ull << 26)
  232. #define CA_FIRST_CRM_PKTERR_MSSNG_TAIL (1ull << 27)
  233. #define CA_FIRST_CRM_PKTERR_MSSNG_HDR (1ull << 28)
  234. /* bits 63:29 unused */
  235. /* ==== ca_crm_ct_error_detail_1 */
  236. #define CA_PKT_TYPE (0xfull << 0)
  237. #define CA_PKT_TYPE_SHFT 0
  238. #define CA_SRC_ID (0x3ull << 4)
  239. #define CA_SRC_ID_SHFT 4
  240. #define CA_DATA_SZ (0x3ull << 6)
  241. #define CA_DATA_SZ_SHFT 6
  242. #define CA_TNUM (0xffull << 8)
  243. #define CA_TNUM_SHFT 8
  244. #define CA_DW_DATA_EN (0xffull << 16)
  245. #define CA_DW_DATA_EN_SHFT 16
  246. #define CA_GFX_CRED (0xffull << 24)
  247. #define CA_GFX_CRED_SHFT 24
  248. #define CA_MEM_RD_PARAM (0x3ull << 32)
  249. #define CA_MEM_RD_PARAM_SHFT 32
  250. #define CA_PIO_OP (1ull << 34)
  251. #define CA_CW_ERR (1ull << 35)
  252. /* bits 62:36 unused */
  253. #define CA_VALID (1ull << 63)
  254. /* ==== ca_crm_ct_error_detail_2 */
  255. /* bits 2:0 unused */
  256. #define CA_PKT_ADDR (0x1fffffffffffffull << 3)
  257. #define CA_PKT_ADDR_SHFT 3
  258. /* bits 63:56 unused */
  259. /* ==== ca_crm_tnumto */
  260. #define CA_CRM_TNUMTO_VAL (0xffull << 0)
  261. #define CA_CRM_TNUMTO_VAL_SHFT 0
  262. #define CA_CRM_TNUMTO_WR (1ull << 8)
  263. /* bits 63:9 unused */
  264. /* ==== ca_gart_err */
  265. #define CA_GART_ERR_SOURCE (0x3ull << 0)
  266. #define CA_GART_ERR_SOURCE_SHFT 0
  267. /* bits 3:2 unused */
  268. #define CA_GART_ERR_ADDR (0xfffffffffull << 4)
  269. #define CA_GART_ERR_ADDR_SHFT 4
  270. /* bits 63:40 unused */
  271. /* ==== ca_pcierr_type */
  272. #define CA_PCIERR_DATA (0xffffffffull << 0)
  273. #define CA_PCIERR_DATA_SHFT 0
  274. #define CA_PCIERR_ENB (0xfull << 32)
  275. #define CA_PCIERR_ENB_SHFT 32
  276. #define CA_PCIERR_CMD (0xfull << 36)
  277. #define CA_PCIERR_CMD_SHFT 36
  278. #define CA_PCIERR_A64 (1ull << 40)
  279. #define CA_PCIERR_SLV_SERR (1ull << 41)
  280. #define CA_PCIERR_SLV_WR_PERR (1ull << 42)
  281. #define CA_PCIERR_SLV_RD_PERR (1ull << 43)
  282. #define CA_PCIERR_MST_SERR (1ull << 44)
  283. #define CA_PCIERR_MST_WR_PERR (1ull << 45)
  284. #define CA_PCIERR_MST_RD_PERR (1ull << 46)
  285. #define CA_PCIERR_MST_MABT (1ull << 47)
  286. #define CA_PCIERR_MST_TABT (1ull << 48)
  287. #define CA_PCIERR_MST_RETRY_TOUT (1ull << 49)
  288. #define CA_PCIERR_TYPES \
  289. (CA_PCIERR_A64|CA_PCIERR_SLV_SERR| \
  290. CA_PCIERR_SLV_WR_PERR|CA_PCIERR_SLV_RD_PERR| \
  291. CA_PCIERR_MST_SERR|CA_PCIERR_MST_WR_PERR|CA_PCIERR_MST_RD_PERR| \
  292. CA_PCIERR_MST_MABT|CA_PCIERR_MST_TABT|CA_PCIERR_MST_RETRY_TOUT)
  293. /* bits 63:50 unused */
  294. /* ==== ca_pci_dma_addr_extn */
  295. #define CA_UPPER_NODE_OFFSET (0x3full << 0)
  296. #define CA_UPPER_NODE_OFFSET_SHFT 0
  297. /* bits 7:6 unused */
  298. #define CA_CHIPLET_ID (0x3ull << 8)
  299. #define CA_CHIPLET_ID_SHFT 8
  300. /* bits 11:10 unused */
  301. #define CA_PCI_DMA_NODE_ID (0xffffull << 12)
  302. #define CA_PCI_DMA_NODE_ID_SHFT 12
  303. /* bits 27:26 unused */
  304. #define CA_PCI_DMA_PIO_MEM_TYPE (1ull << 28)
  305. /* bits 63:29 unused */
  306. /* ==== ca_agp_dma_addr_extn */
  307. /* bits 19:0 unused */
  308. #define CA_AGP_DMA_NODE_ID (0xffffull << 20)
  309. #define CA_AGP_DMA_NODE_ID_SHFT 20
  310. /* bits 27:26 unused */
  311. #define CA_AGP_DMA_PIO_MEM_TYPE (1ull << 28)
  312. /* bits 63:29 unused */
  313. /* ==== ca_debug_vector_sel */
  314. #define CA_DEBUG_MN_VSEL (0xfull << 0)
  315. #define CA_DEBUG_MN_VSEL_SHFT 0
  316. #define CA_DEBUG_PP_VSEL (0xfull << 4)
  317. #define CA_DEBUG_PP_VSEL_SHFT 4
  318. #define CA_DEBUG_GW_VSEL (0xfull << 8)
  319. #define CA_DEBUG_GW_VSEL_SHFT 8
  320. #define CA_DEBUG_GT_VSEL (0xfull << 12)
  321. #define CA_DEBUG_GT_VSEL_SHFT 12
  322. #define CA_DEBUG_PD_VSEL (0xfull << 16)
  323. #define CA_DEBUG_PD_VSEL_SHFT 16
  324. #define CA_DEBUG_AD_VSEL (0xfull << 20)
  325. #define CA_DEBUG_AD_VSEL_SHFT 20
  326. #define CA_DEBUG_CX_VSEL (0xfull << 24)
  327. #define CA_DEBUG_CX_VSEL_SHFT 24
  328. #define CA_DEBUG_CR_VSEL (0xfull << 28)
  329. #define CA_DEBUG_CR_VSEL_SHFT 28
  330. #define CA_DEBUG_BA_VSEL (0xfull << 32)
  331. #define CA_DEBUG_BA_VSEL_SHFT 32
  332. #define CA_DEBUG_PE_VSEL (0xfull << 36)
  333. #define CA_DEBUG_PE_VSEL_SHFT 36
  334. #define CA_DEBUG_BO_VSEL (0xfull << 40)
  335. #define CA_DEBUG_BO_VSEL_SHFT 40
  336. #define CA_DEBUG_BI_VSEL (0xfull << 44)
  337. #define CA_DEBUG_BI_VSEL_SHFT 44
  338. #define CA_DEBUG_AS_VSEL (0xfull << 48)
  339. #define CA_DEBUG_AS_VSEL_SHFT 48
  340. #define CA_DEBUG_PS_VSEL (0xfull << 52)
  341. #define CA_DEBUG_PS_VSEL_SHFT 52
  342. #define CA_DEBUG_PM_VSEL (0xfull << 56)
  343. #define CA_DEBUG_PM_VSEL_SHFT 56
  344. /* bits 63:60 unused */
  345. /* ==== ca_debug_mux_core_sel */
  346. /* ==== ca_debug_mux_pci_sel */
  347. #define CA_DEBUG_MSEL0 (0x7ull << 0)
  348. #define CA_DEBUG_MSEL0_SHFT 0
  349. /* bit 3 unused */
  350. #define CA_DEBUG_NSEL0 (0x7ull << 4)
  351. #define CA_DEBUG_NSEL0_SHFT 4
  352. /* bit 7 unused */
  353. #define CA_DEBUG_MSEL1 (0x7ull << 8)
  354. #define CA_DEBUG_MSEL1_SHFT 8
  355. /* bit 11 unused */
  356. #define CA_DEBUG_NSEL1 (0x7ull << 12)
  357. #define CA_DEBUG_NSEL1_SHFT 12
  358. /* bit 15 unused */
  359. #define CA_DEBUG_MSEL2 (0x7ull << 16)
  360. #define CA_DEBUG_MSEL2_SHFT 16
  361. /* bit 19 unused */
  362. #define CA_DEBUG_NSEL2 (0x7ull << 20)
  363. #define CA_DEBUG_NSEL2_SHFT 20
  364. /* bit 23 unused */
  365. #define CA_DEBUG_MSEL3 (0x7ull << 24)
  366. #define CA_DEBUG_MSEL3_SHFT 24
  367. /* bit 27 unused */
  368. #define CA_DEBUG_NSEL3 (0x7ull << 28)
  369. #define CA_DEBUG_NSEL3_SHFT 28
  370. /* bit 31 unused */
  371. #define CA_DEBUG_MSEL4 (0x7ull << 32)
  372. #define CA_DEBUG_MSEL4_SHFT 32
  373. /* bit 35 unused */
  374. #define CA_DEBUG_NSEL4 (0x7ull << 36)
  375. #define CA_DEBUG_NSEL4_SHFT 36
  376. /* bit 39 unused */
  377. #define CA_DEBUG_MSEL5 (0x7ull << 40)
  378. #define CA_DEBUG_MSEL5_SHFT 40
  379. /* bit 43 unused */
  380. #define CA_DEBUG_NSEL5 (0x7ull << 44)
  381. #define CA_DEBUG_NSEL5_SHFT 44
  382. /* bit 47 unused */
  383. #define CA_DEBUG_MSEL6 (0x7ull << 48)
  384. #define CA_DEBUG_MSEL6_SHFT 48
  385. /* bit 51 unused */
  386. #define CA_DEBUG_NSEL6 (0x7ull << 52)
  387. #define CA_DEBUG_NSEL6_SHFT 52
  388. /* bit 55 unused */
  389. #define CA_DEBUG_MSEL7 (0x7ull << 56)
  390. #define CA_DEBUG_MSEL7_SHFT 56
  391. /* bit 59 unused */
  392. #define CA_DEBUG_NSEL7 (0x7ull << 60)
  393. #define CA_DEBUG_NSEL7_SHFT 60
  394. /* bit 63 unused */
  395. /* ==== ca_debug_domain_sel */
  396. #define CA_DEBUG_DOMAIN_L (1ull << 0)
  397. #define CA_DEBUG_DOMAIN_H (1ull << 1)
  398. /* bits 63:2 unused */
  399. /* ==== ca_gart_ptr_table */
  400. #define CA_GART_PTR_VAL (1ull << 0)
  401. /* bits 11:1 unused */
  402. #define CA_GART_PTR_ADDR (0xfffffffffffull << 12)
  403. #define CA_GART_PTR_ADDR_SHFT 12
  404. /* bits 63:56 unused */
  405. /* ==== ca_gart_tlb_addr[0-7] */
  406. #define CA_GART_TLB_ADDR (0xffffffffffffffull << 0)
  407. #define CA_GART_TLB_ADDR_SHFT 0
  408. /* bits 62:56 unused */
  409. #define CA_GART_TLB_ENTRY_VAL (1ull << 63)
  410. /*
  411. * PIO address space ranges for TIO:CA
  412. */
  413. /* CA internal registers */
  414. #define CA_PIO_ADMIN 0x00000000
  415. #define CA_PIO_ADMIN_LEN 0x00010000
  416. /* GFX Write Buffer - Diagnostics */
  417. #define CA_PIO_GFX 0x00010000
  418. #define CA_PIO_GFX_LEN 0x00010000
  419. /* AGP DMA Write Buffer - Diagnostics */
  420. #define CA_PIO_AGP_DMAWRITE 0x00020000
  421. #define CA_PIO_AGP_DMAWRITE_LEN 0x00010000
  422. /* AGP DMA READ Buffer - Diagnostics */
  423. #define CA_PIO_AGP_DMAREAD 0x00030000
  424. #define CA_PIO_AGP_DMAREAD_LEN 0x00010000
  425. /* PCI Config Type 0 */
  426. #define CA_PIO_PCI_TYPE0_CONFIG 0x01000000
  427. #define CA_PIO_PCI_TYPE0_CONFIG_LEN 0x01000000
  428. /* PCI Config Type 1 */
  429. #define CA_PIO_PCI_TYPE1_CONFIG 0x02000000
  430. #define CA_PIO_PCI_TYPE1_CONFIG_LEN 0x01000000
  431. /* PCI I/O Cycles - mapped to PCI Address 0x00000000-0x04ffffff */
  432. #define CA_PIO_PCI_IO 0x03000000
  433. #define CA_PIO_PCI_IO_LEN 0x05000000
  434. /* PCI MEM Cycles - mapped to PCI with CA_PIO_ADDR_OFFSET of ca_control1 */
  435. /* use Fast Write if enabled and coretalk packet type is a GFX request */
  436. #define CA_PIO_PCI_MEM_OFFSET 0x08000000
  437. #define CA_PIO_PCI_MEM_OFFSET_LEN 0x08000000
  438. /* PCI MEM Cycles - mapped to PCI Address 0x00000000-0xbfffffff */
  439. /* use Fast Write if enabled and coretalk packet type is a GFX request */
  440. #define CA_PIO_PCI_MEM 0x40000000
  441. #define CA_PIO_PCI_MEM_LEN 0xc0000000
  442. /*
  443. * DMA space
  444. *
  445. * The CA aperature (ie. bus address range) mapped by the GART is segmented into
  446. * two parts. The lower portion of the aperature is used for mapping 32 bit
  447. * PCI addresses which are managed by the dma interfaces in this file. The
  448. * upper poprtion of the aperature is used for mapping 48 bit AGP addresses.
  449. * The AGP portion of the aperature is managed by the agpgart_be.c driver
  450. * in drivers/linux/agp. There are ca-specific hooks in that driver to
  451. * manipulate the gart, but management of the AGP portion of the aperature
  452. * is the responsibility of that driver.
  453. *
  454. * CA allows three main types of DMA mapping:
  455. *
  456. * PCI 64-bit Managed by this driver
  457. * PCI 32-bit Managed by this driver
  458. * AGP 48-bit Managed by hooks in the /dev/agpgart driver
  459. *
  460. * All of the above can optionally be remapped through the GART. The following
  461. * table lists the combinations of addressing types and GART remapping that
  462. * is currently supported by the driver (h/w supports all, s/w limits this):
  463. *
  464. * PCI64 PCI32 AGP48
  465. * GART no yes yes
  466. * Direct yes yes no
  467. *
  468. * GART remapping of PCI64 is not done because there is no need to. The
  469. * 64 bit PCI address holds all of the information necessary to target any
  470. * memory in the system.
  471. *
  472. * AGP48 is always mapped through the GART. Management of the AGP48 portion
  473. * of the aperature is the responsibility of code in the agpgart_be driver.
  474. *
  475. * The non-64 bit bus address space will currently be partitioned like this:
  476. *
  477. * 0xffff_ffff_ffff +--------
  478. * | AGP48 direct
  479. * | Space managed by this driver
  480. * CA_AGP_DIRECT_BASE +--------
  481. * | AGP GART mapped (gfx aperature)
  482. * | Space managed by /dev/agpgart driver
  483. * | This range is exposed to the agpgart
  484. * | driver as the "graphics aperature"
  485. * CA_AGP_MAPPED_BASE +-----
  486. * | PCI GART mapped
  487. * | Space managed by this driver
  488. * CA_PCI32_MAPPED_BASE +----
  489. * | PCI32 direct
  490. * | Space managed by this driver
  491. * 0xC000_0000 +--------
  492. * (CA_PCI32_DIRECT_BASE)
  493. *
  494. * The bus address range CA_PCI32_MAPPED_BASE through CA_AGP_DIRECT_BASE
  495. * is what we call the CA aperature. Addresses falling in this range will
  496. * be remapped using the GART.
  497. *
  498. * The bus address range CA_AGP_MAPPED_BASE through CA_AGP_DIRECT_BASE
  499. * is what we call the graphics aperature. This is a subset of the CA
  500. * aperature and is under the control of the agpgart_be driver.
  501. *
  502. * CA_PCI32_MAPPED_BASE, CA_AGP_MAPPED_BASE, and CA_AGP_DIRECT_BASE are
  503. * somewhat arbitrary values. The known constraints on choosing these is:
  504. *
  505. * 1) CA_AGP_DIRECT_BASE-CA_PCI32_MAPPED_BASE+1 (the CA aperature size)
  506. * must be one of the values supported by the ca_gart_aperature register.
  507. * Currently valid values are: 4MB through 4096MB in powers of 2 increments
  508. *
  509. * 2) CA_AGP_DIRECT_BASE-CA_AGP_MAPPED_BASE+1 (the gfx aperature size)
  510. * must be in MB units since that's what the agpgart driver assumes.
  511. */
  512. /*
  513. * Define Bus DMA ranges. These are configurable (see constraints above)
  514. * and will probably need tuning based on experience.
  515. */
  516. /*
  517. * 11/24/03
  518. * CA has an addressing glitch w.r.t. PCI direct 32 bit DMA that makes it
  519. * generally unusable. The problem is that for PCI direct 32
  520. * DMA's, all 32 bits of the bus address are used to form the lower 32 bits
  521. * of the coretalk address, and coretalk bits 38:32 come from a register.
  522. * Since only PCI bus addresses 0xC0000000-0xFFFFFFFF (1GB) are available
  523. * for DMA (the rest is allocated to PIO), host node addresses need to be
  524. * such that their lower 32 bits fall in the 0xC0000000-0xffffffff range
  525. * as well. So there can be no PCI32 direct DMA below 3GB!! For this
  526. * reason we set the CA_PCI32_DIRECT_SIZE to 0 which essentially makes
  527. * tioca_dma_direct32() a noop but preserves the code flow should this issue
  528. * be fixed in a respin.
  529. *
  530. * For now, all PCI32 DMA's must be mapped through the GART.
  531. */
  532. #define CA_PCI32_DIRECT_BASE 0xC0000000UL /* BASE not configurable */
  533. #define CA_PCI32_DIRECT_SIZE 0x00000000UL /* 0 MB */
  534. #define CA_PCI32_MAPPED_BASE 0xC0000000UL
  535. #define CA_PCI32_MAPPED_SIZE 0x40000000UL /* 2GB */
  536. #define CA_AGP_MAPPED_BASE 0x80000000UL
  537. #define CA_AGP_MAPPED_SIZE 0x40000000UL /* 2GB */
  538. #define CA_AGP_DIRECT_BASE 0x40000000UL /* 2GB */
  539. #define CA_AGP_DIRECT_SIZE 0x40000000UL
  540. #define CA_APERATURE_BASE (CA_AGP_MAPPED_BASE)
  541. #define CA_APERATURE_SIZE (CA_AGP_MAPPED_SIZE+CA_PCI32_MAPPED_SIZE)
  542. #endif /* _ASM_IA64_SN_TIO_TIOCA_H */