pic.h 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
  7. */
  8. #ifndef _ASM_IA64_SN_PCI_PIC_H
  9. #define _ASM_IA64_SN_PCI_PIC_H
  10. /*
  11. * PIC AS DEVICE ZERO
  12. * ------------------
  13. *
  14. * PIC handles PCI/X busses. PCI/X requires that the 'bridge' (i.e. PIC)
  15. * be designated as 'device 0'. That is a departure from earlier SGI
  16. * PCI bridges. Because of that we use config space 1 to access the
  17. * config space of the first actual PCI device on the bus.
  18. * Here's what the PIC manual says:
  19. *
  20. * The current PCI-X bus specification now defines that the parent
  21. * hosts bus bridge (PIC for example) must be device 0 on bus 0. PIC
  22. * reduced the total number of devices from 8 to 4 and removed the
  23. * device registers and windows, now only supporting devices 0,1,2, and
  24. * 3. PIC did leave all 8 configuration space windows. The reason was
  25. * there was nothing to gain by removing them. Here in lies the problem.
  26. * The device numbering we do using 0 through 3 is unrelated to the device
  27. * numbering which PCI-X requires in configuration space. In the past we
  28. * correlated Configs pace and our device space 0 <-> 0, 1 <-> 1, etc.
  29. * PCI-X requires we start a 1, not 0 and currently the PX brick
  30. * does associate our:
  31. *
  32. * device 0 with configuration space window 1,
  33. * device 1 with configuration space window 2,
  34. * device 2 with configuration space window 3,
  35. * device 3 with configuration space window 4.
  36. *
  37. * The net effect is that all config space access are off-by-one with
  38. * relation to other per-slot accesses on the PIC.
  39. * Here is a table that shows some of that:
  40. *
  41. * Internal Slot#
  42. * |
  43. * | 0 1 2 3
  44. * ----------|---------------------------------------
  45. * config | 0x21000 0x22000 0x23000 0x24000
  46. * |
  47. * even rrb | 0[0] n/a 1[0] n/a [] == implied even/odd
  48. * |
  49. * odd rrb | n/a 0[1] n/a 1[1]
  50. * |
  51. * int dev | 00 01 10 11
  52. * |
  53. * ext slot# | 1 2 3 4
  54. * ----------|---------------------------------------
  55. */
  56. #define PIC_ATE_TARGETID_SHFT 8
  57. #define PIC_HOST_INTR_ADDR 0x0000FFFFFFFFFFFFUL
  58. #define PIC_PCI64_ATTR_TARG_SHFT 60
  59. /*****************************************************************************
  60. *********************** PIC MMR structure mapping ***************************
  61. *****************************************************************************/
  62. /* NOTE: PIC WAR. PV#854697. PIC does not allow writes just to [31:0]
  63. * of a 64-bit register. When writing PIC registers, always write the
  64. * entire 64 bits.
  65. */
  66. struct pic {
  67. /* 0x000000-0x00FFFF -- Local Registers */
  68. /* 0x000000-0x000057 -- Standard Widget Configuration */
  69. u64 p_wid_id; /* 0x000000 */
  70. u64 p_wid_stat; /* 0x000008 */
  71. u64 p_wid_err_upper; /* 0x000010 */
  72. u64 p_wid_err_lower; /* 0x000018 */
  73. #define p_wid_err p_wid_err_lower
  74. u64 p_wid_control; /* 0x000020 */
  75. u64 p_wid_req_timeout; /* 0x000028 */
  76. u64 p_wid_int_upper; /* 0x000030 */
  77. u64 p_wid_int_lower; /* 0x000038 */
  78. #define p_wid_int p_wid_int_lower
  79. u64 p_wid_err_cmdword; /* 0x000040 */
  80. u64 p_wid_llp; /* 0x000048 */
  81. u64 p_wid_tflush; /* 0x000050 */
  82. /* 0x000058-0x00007F -- Bridge-specific Widget Configuration */
  83. u64 p_wid_aux_err; /* 0x000058 */
  84. u64 p_wid_resp_upper; /* 0x000060 */
  85. u64 p_wid_resp_lower; /* 0x000068 */
  86. #define p_wid_resp p_wid_resp_lower
  87. u64 p_wid_tst_pin_ctrl; /* 0x000070 */
  88. u64 p_wid_addr_lkerr; /* 0x000078 */
  89. /* 0x000080-0x00008F -- PMU & MAP */
  90. u64 p_dir_map; /* 0x000080 */
  91. u64 _pad_000088; /* 0x000088 */
  92. /* 0x000090-0x00009F -- SSRAM */
  93. u64 p_map_fault; /* 0x000090 */
  94. u64 _pad_000098; /* 0x000098 */
  95. /* 0x0000A0-0x0000AF -- Arbitration */
  96. u64 p_arb; /* 0x0000A0 */
  97. u64 _pad_0000A8; /* 0x0000A8 */
  98. /* 0x0000B0-0x0000BF -- Number In A Can or ATE Parity Error */
  99. u64 p_ate_parity_err; /* 0x0000B0 */
  100. u64 _pad_0000B8; /* 0x0000B8 */
  101. /* 0x0000C0-0x0000FF -- PCI/GIO */
  102. u64 p_bus_timeout; /* 0x0000C0 */
  103. u64 p_pci_cfg; /* 0x0000C8 */
  104. u64 p_pci_err_upper; /* 0x0000D0 */
  105. u64 p_pci_err_lower; /* 0x0000D8 */
  106. #define p_pci_err p_pci_err_lower
  107. u64 _pad_0000E0[4]; /* 0x0000{E0..F8} */
  108. /* 0x000100-0x0001FF -- Interrupt */
  109. u64 p_int_status; /* 0x000100 */
  110. u64 p_int_enable; /* 0x000108 */
  111. u64 p_int_rst_stat; /* 0x000110 */
  112. u64 p_int_mode; /* 0x000118 */
  113. u64 p_int_device; /* 0x000120 */
  114. u64 p_int_host_err; /* 0x000128 */
  115. u64 p_int_addr[8]; /* 0x0001{30,,,68} */
  116. u64 p_err_int_view; /* 0x000170 */
  117. u64 p_mult_int; /* 0x000178 */
  118. u64 p_force_always[8]; /* 0x0001{80,,,B8} */
  119. u64 p_force_pin[8]; /* 0x0001{C0,,,F8} */
  120. /* 0x000200-0x000298 -- Device */
  121. u64 p_device[4]; /* 0x0002{00,,,18} */
  122. u64 _pad_000220[4]; /* 0x0002{20,,,38} */
  123. u64 p_wr_req_buf[4]; /* 0x0002{40,,,58} */
  124. u64 _pad_000260[4]; /* 0x0002{60,,,78} */
  125. u64 p_rrb_map[2]; /* 0x0002{80,,,88} */
  126. #define p_even_resp p_rrb_map[0] /* 0x000280 */
  127. #define p_odd_resp p_rrb_map[1] /* 0x000288 */
  128. u64 p_resp_status; /* 0x000290 */
  129. u64 p_resp_clear; /* 0x000298 */
  130. u64 _pad_0002A0[12]; /* 0x0002{A0..F8} */
  131. /* 0x000300-0x0003F8 -- Buffer Address Match Registers */
  132. struct {
  133. u64 upper; /* 0x0003{00,,,F0} */
  134. u64 lower; /* 0x0003{08,,,F8} */
  135. } p_buf_addr_match[16];
  136. /* 0x000400-0x0005FF -- Performance Monitor Registers (even only) */
  137. struct {
  138. u64 flush_w_touch; /* 0x000{400,,,5C0} */
  139. u64 flush_wo_touch; /* 0x000{408,,,5C8} */
  140. u64 inflight; /* 0x000{410,,,5D0} */
  141. u64 prefetch; /* 0x000{418,,,5D8} */
  142. u64 total_pci_retry; /* 0x000{420,,,5E0} */
  143. u64 max_pci_retry; /* 0x000{428,,,5E8} */
  144. u64 max_latency; /* 0x000{430,,,5F0} */
  145. u64 clear_all; /* 0x000{438,,,5F8} */
  146. } p_buf_count[8];
  147. /* 0x000600-0x0009FF -- PCI/X registers */
  148. u64 p_pcix_bus_err_addr; /* 0x000600 */
  149. u64 p_pcix_bus_err_attr; /* 0x000608 */
  150. u64 p_pcix_bus_err_data; /* 0x000610 */
  151. u64 p_pcix_pio_split_addr; /* 0x000618 */
  152. u64 p_pcix_pio_split_attr; /* 0x000620 */
  153. u64 p_pcix_dma_req_err_attr; /* 0x000628 */
  154. u64 p_pcix_dma_req_err_addr; /* 0x000630 */
  155. u64 p_pcix_timeout; /* 0x000638 */
  156. u64 _pad_000640[120]; /* 0x000{640,,,9F8} */
  157. /* 0x000A00-0x000BFF -- PCI/X Read&Write Buffer */
  158. struct {
  159. u64 p_buf_addr; /* 0x000{A00,,,AF0} */
  160. u64 p_buf_attr; /* 0X000{A08,,,AF8} */
  161. } p_pcix_read_buf_64[16];
  162. struct {
  163. u64 p_buf_addr; /* 0x000{B00,,,BE0} */
  164. u64 p_buf_attr; /* 0x000{B08,,,BE8} */
  165. u64 p_buf_valid; /* 0x000{B10,,,BF0} */
  166. u64 __pad1; /* 0x000{B18,,,BF8} */
  167. } p_pcix_write_buf_64[8];
  168. /* End of Local Registers -- Start of Address Map space */
  169. char _pad_000c00[0x010000 - 0x000c00];
  170. /* 0x010000-0x011fff -- Internal ATE RAM (Auto Parity Generation) */
  171. u64 p_int_ate_ram[1024]; /* 0x010000-0x011fff */
  172. /* 0x012000-0x013fff -- Internal ATE RAM (Manual Parity Generation) */
  173. u64 p_int_ate_ram_mp[1024]; /* 0x012000-0x013fff */
  174. char _pad_014000[0x18000 - 0x014000];
  175. /* 0x18000-0x197F8 -- PIC Write Request Ram */
  176. u64 p_wr_req_lower[256]; /* 0x18000 - 0x187F8 */
  177. u64 p_wr_req_upper[256]; /* 0x18800 - 0x18FF8 */
  178. u64 p_wr_req_parity[256]; /* 0x19000 - 0x197F8 */
  179. char _pad_019800[0x20000 - 0x019800];
  180. /* 0x020000-0x027FFF -- PCI Device Configuration Spaces */
  181. union {
  182. u8 c[0x1000 / 1]; /* 0x02{0000,,,7FFF} */
  183. u16 s[0x1000 / 2]; /* 0x02{0000,,,7FFF} */
  184. u32 l[0x1000 / 4]; /* 0x02{0000,,,7FFF} */
  185. u64 d[0x1000 / 8]; /* 0x02{0000,,,7FFF} */
  186. union {
  187. u8 c[0x100 / 1];
  188. u16 s[0x100 / 2];
  189. u32 l[0x100 / 4];
  190. u64 d[0x100 / 8];
  191. } f[8];
  192. } p_type0_cfg_dev[8]; /* 0x02{0000,,,7FFF} */
  193. /* 0x028000-0x028FFF -- PCI Type 1 Configuration Space */
  194. union {
  195. u8 c[0x1000 / 1]; /* 0x028000-0x029000 */
  196. u16 s[0x1000 / 2]; /* 0x028000-0x029000 */
  197. u32 l[0x1000 / 4]; /* 0x028000-0x029000 */
  198. u64 d[0x1000 / 8]; /* 0x028000-0x029000 */
  199. union {
  200. u8 c[0x100 / 1];
  201. u16 s[0x100 / 2];
  202. u32 l[0x100 / 4];
  203. u64 d[0x100 / 8];
  204. } f[8];
  205. } p_type1_cfg; /* 0x028000-0x029000 */
  206. char _pad_029000[0x030000-0x029000];
  207. /* 0x030000-0x030007 -- PCI Interrupt Acknowledge Cycle */
  208. union {
  209. u8 c[8 / 1];
  210. u16 s[8 / 2];
  211. u32 l[8 / 4];
  212. u64 d[8 / 8];
  213. } p_pci_iack; /* 0x030000-0x030007 */
  214. char _pad_030007[0x040000-0x030008];
  215. /* 0x040000-0x030007 -- PCIX Special Cycle */
  216. union {
  217. u8 c[8 / 1];
  218. u16 s[8 / 2];
  219. u32 l[8 / 4];
  220. u64 d[8 / 8];
  221. } p_pcix_cycle; /* 0x040000-0x040007 */
  222. };
  223. #endif /* _ASM_IA64_SN_PCI_PIC_H */