tioce.h 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761
  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) 2003-2005 Silicon Graphics, Inc. All rights reserved.
  7. */
  8. #ifndef __ASM_IA64_SN_TIOCE_H__
  9. #define __ASM_IA64_SN_TIOCE_H__
  10. /* CE ASIC part & mfgr information */
  11. #define TIOCE_PART_NUM 0xCE00
  12. #define TIOCE_SRC_ID 0x01
  13. #define TIOCE_REV_A 0x1
  14. /* CE Virtual PPB Vendor/Device IDs */
  15. #define CE_VIRT_PPB_VENDOR_ID 0x10a9
  16. #define CE_VIRT_PPB_DEVICE_ID 0x4002
  17. /* CE Host Bridge Vendor/Device IDs */
  18. #define CE_HOST_BRIDGE_VENDOR_ID 0x10a9
  19. #define CE_HOST_BRIDGE_DEVICE_ID 0x4001
  20. #define TIOCE_NUM_M40_ATES 4096
  21. #define TIOCE_NUM_M3240_ATES 2048
  22. #define TIOCE_NUM_PORTS 2
  23. /*
  24. * Register layout for TIOCE. MMR offsets are shown at the far right of the
  25. * structure definition.
  26. */
  27. typedef volatile struct tioce {
  28. /*
  29. * ADMIN : Administration Registers
  30. */
  31. u64 ce_adm_id; /* 0x000000 */
  32. u64 ce_pad_000008; /* 0x000008 */
  33. u64 ce_adm_dyn_credit_status; /* 0x000010 */
  34. u64 ce_adm_last_credit_status; /* 0x000018 */
  35. u64 ce_adm_credit_limit; /* 0x000020 */
  36. u64 ce_adm_force_credit; /* 0x000028 */
  37. u64 ce_adm_control; /* 0x000030 */
  38. u64 ce_adm_mmr_chn_timeout; /* 0x000038 */
  39. u64 ce_adm_ssp_ure_timeout; /* 0x000040 */
  40. u64 ce_adm_ssp_dre_timeout; /* 0x000048 */
  41. u64 ce_adm_ssp_debug_sel; /* 0x000050 */
  42. u64 ce_adm_int_status; /* 0x000058 */
  43. u64 ce_adm_int_status_alias; /* 0x000060 */
  44. u64 ce_adm_int_mask; /* 0x000068 */
  45. u64 ce_adm_int_pending; /* 0x000070 */
  46. u64 ce_adm_force_int; /* 0x000078 */
  47. u64 ce_adm_ure_ups_buf_barrier_flush; /* 0x000080 */
  48. u64 ce_adm_int_dest[15]; /* 0x000088 -- 0x0000F8 */
  49. u64 ce_adm_error_summary; /* 0x000100 */
  50. u64 ce_adm_error_summary_alias; /* 0x000108 */
  51. u64 ce_adm_error_mask; /* 0x000110 */
  52. u64 ce_adm_first_error; /* 0x000118 */
  53. u64 ce_adm_error_overflow; /* 0x000120 */
  54. u64 ce_adm_error_overflow_alias; /* 0x000128 */
  55. u64 ce_pad_000130[2]; /* 0x000130 -- 0x000138 */
  56. u64 ce_adm_tnum_error; /* 0x000140 */
  57. u64 ce_adm_mmr_err_detail; /* 0x000148 */
  58. u64 ce_adm_msg_sram_perr_detail; /* 0x000150 */
  59. u64 ce_adm_bap_sram_perr_detail; /* 0x000158 */
  60. u64 ce_adm_ce_sram_perr_detail; /* 0x000160 */
  61. u64 ce_adm_ce_credit_oflow_detail; /* 0x000168 */
  62. u64 ce_adm_tx_link_idle_max_timer; /* 0x000170 */
  63. u64 ce_adm_pcie_debug_sel; /* 0x000178 */
  64. u64 ce_pad_000180[16]; /* 0x000180 -- 0x0001F8 */
  65. u64 ce_adm_pcie_debug_sel_top; /* 0x000200 */
  66. u64 ce_adm_pcie_debug_lat_sel_lo_top; /* 0x000208 */
  67. u64 ce_adm_pcie_debug_lat_sel_hi_top; /* 0x000210 */
  68. u64 ce_adm_pcie_debug_trig_sel_top; /* 0x000218 */
  69. u64 ce_adm_pcie_debug_trig_lat_sel_lo_top; /* 0x000220 */
  70. u64 ce_adm_pcie_debug_trig_lat_sel_hi_top; /* 0x000228 */
  71. u64 ce_adm_pcie_trig_compare_top; /* 0x000230 */
  72. u64 ce_adm_pcie_trig_compare_en_top; /* 0x000238 */
  73. u64 ce_adm_ssp_debug_sel_top; /* 0x000240 */
  74. u64 ce_adm_ssp_debug_lat_sel_lo_top; /* 0x000248 */
  75. u64 ce_adm_ssp_debug_lat_sel_hi_top; /* 0x000250 */
  76. u64 ce_adm_ssp_debug_trig_sel_top; /* 0x000258 */
  77. u64 ce_adm_ssp_debug_trig_lat_sel_lo_top; /* 0x000260 */
  78. u64 ce_adm_ssp_debug_trig_lat_sel_hi_top; /* 0x000268 */
  79. u64 ce_adm_ssp_trig_compare_top; /* 0x000270 */
  80. u64 ce_adm_ssp_trig_compare_en_top; /* 0x000278 */
  81. u64 ce_pad_000280[48]; /* 0x000280 -- 0x0003F8 */
  82. u64 ce_adm_bap_ctrl; /* 0x000400 */
  83. u64 ce_pad_000408[127]; /* 0x000408 -- 0x0007F8 */
  84. u64 ce_msg_buf_data63_0[35]; /* 0x000800 -- 0x000918 */
  85. u64 ce_pad_000920[29]; /* 0x000920 -- 0x0009F8 */
  86. u64 ce_msg_buf_data127_64[35]; /* 0x000A00 -- 0x000B18 */
  87. u64 ce_pad_000B20[29]; /* 0x000B20 -- 0x000BF8 */
  88. u64 ce_msg_buf_parity[35]; /* 0x000C00 -- 0x000D18 */
  89. u64 ce_pad_000D20[29]; /* 0x000D20 -- 0x000DF8 */
  90. u64 ce_pad_000E00[576]; /* 0x000E00 -- 0x001FF8 */
  91. /*
  92. * LSI : LSI's PCI Express Link Registers (Link#1 and Link#2)
  93. * Link#1 MMRs at start at 0x002000, Link#2 MMRs at 0x003000
  94. * NOTE: the comment offsets at far right: let 'z' = {2 or 3}
  95. */
  96. #define ce_lsi(link_num) ce_lsi[link_num-1]
  97. struct ce_lsi_reg {
  98. u64 ce_lsi_lpu_id; /* 0x00z000 */
  99. u64 ce_lsi_rst; /* 0x00z008 */
  100. u64 ce_lsi_dbg_stat; /* 0x00z010 */
  101. u64 ce_lsi_dbg_cfg; /* 0x00z018 */
  102. u64 ce_lsi_ltssm_ctrl; /* 0x00z020 */
  103. u64 ce_lsi_lk_stat; /* 0x00z028 */
  104. u64 ce_pad_00z030[2]; /* 0x00z030 -- 0x00z038 */
  105. u64 ce_lsi_int_and_stat; /* 0x00z040 */
  106. u64 ce_lsi_int_mask; /* 0x00z048 */
  107. u64 ce_pad_00z050[22]; /* 0x00z050 -- 0x00z0F8 */
  108. u64 ce_lsi_lk_perf_cnt_sel; /* 0x00z100 */
  109. u64 ce_pad_00z108; /* 0x00z108 */
  110. u64 ce_lsi_lk_perf_cnt_ctrl; /* 0x00z110 */
  111. u64 ce_pad_00z118; /* 0x00z118 */
  112. u64 ce_lsi_lk_perf_cnt1; /* 0x00z120 */
  113. u64 ce_lsi_lk_perf_cnt1_test; /* 0x00z128 */
  114. u64 ce_lsi_lk_perf_cnt2; /* 0x00z130 */
  115. u64 ce_lsi_lk_perf_cnt2_test; /* 0x00z138 */
  116. u64 ce_pad_00z140[24]; /* 0x00z140 -- 0x00z1F8 */
  117. u64 ce_lsi_lk_lyr_cfg; /* 0x00z200 */
  118. u64 ce_lsi_lk_lyr_status; /* 0x00z208 */
  119. u64 ce_lsi_lk_lyr_int_stat; /* 0x00z210 */
  120. u64 ce_lsi_lk_ly_int_stat_test; /* 0x00z218 */
  121. u64 ce_lsi_lk_ly_int_stat_mask; /* 0x00z220 */
  122. u64 ce_pad_00z228[3]; /* 0x00z228 -- 0x00z238 */
  123. u64 ce_lsi_fc_upd_ctl; /* 0x00z240 */
  124. u64 ce_pad_00z248[3]; /* 0x00z248 -- 0x00z258 */
  125. u64 ce_lsi_flw_ctl_upd_to_timer; /* 0x00z260 */
  126. u64 ce_lsi_flw_ctl_upd_timer0; /* 0x00z268 */
  127. u64 ce_lsi_flw_ctl_upd_timer1; /* 0x00z270 */
  128. u64 ce_pad_00z278[49]; /* 0x00z278 -- 0x00z3F8 */
  129. u64 ce_lsi_freq_nak_lat_thrsh; /* 0x00z400 */
  130. u64 ce_lsi_ack_nak_lat_tmr; /* 0x00z408 */
  131. u64 ce_lsi_rply_tmr_thr; /* 0x00z410 */
  132. u64 ce_lsi_rply_tmr; /* 0x00z418 */
  133. u64 ce_lsi_rply_num_stat; /* 0x00z420 */
  134. u64 ce_lsi_rty_buf_max_addr; /* 0x00z428 */
  135. u64 ce_lsi_rty_fifo_ptr; /* 0x00z430 */
  136. u64 ce_lsi_rty_fifo_rd_wr_ptr; /* 0x00z438 */
  137. u64 ce_lsi_rty_fifo_cred; /* 0x00z440 */
  138. u64 ce_lsi_seq_cnt; /* 0x00z448 */
  139. u64 ce_lsi_ack_sent_seq_num; /* 0x00z450 */
  140. u64 ce_lsi_seq_cnt_fifo_max_addr; /* 0x00z458 */
  141. u64 ce_lsi_seq_cnt_fifo_ptr; /* 0x00z460 */
  142. u64 ce_lsi_seq_cnt_rd_wr_ptr; /* 0x00z468 */
  143. u64 ce_lsi_tx_lk_ts_ctl; /* 0x00z470 */
  144. u64 ce_pad_00z478; /* 0x00z478 */
  145. u64 ce_lsi_mem_addr_ctl; /* 0x00z480 */
  146. u64 ce_lsi_mem_d_ld0; /* 0x00z488 */
  147. u64 ce_lsi_mem_d_ld1; /* 0x00z490 */
  148. u64 ce_lsi_mem_d_ld2; /* 0x00z498 */
  149. u64 ce_lsi_mem_d_ld3; /* 0x00z4A0 */
  150. u64 ce_lsi_mem_d_ld4; /* 0x00z4A8 */
  151. u64 ce_pad_00z4B0[2]; /* 0x00z4B0 -- 0x00z4B8 */
  152. u64 ce_lsi_rty_d_cnt; /* 0x00z4C0 */
  153. u64 ce_lsi_seq_buf_cnt; /* 0x00z4C8 */
  154. u64 ce_lsi_seq_buf_bt_d; /* 0x00z4D0 */
  155. u64 ce_pad_00z4D8; /* 0x00z4D8 */
  156. u64 ce_lsi_ack_lat_thr; /* 0x00z4E0 */
  157. u64 ce_pad_00z4E8[3]; /* 0x00z4E8 -- 0x00z4F8 */
  158. u64 ce_lsi_nxt_rcv_seq_1_cntr; /* 0x00z500 */
  159. u64 ce_lsi_unsp_dllp_rcvd; /* 0x00z508 */
  160. u64 ce_lsi_rcv_lk_ts_ctl; /* 0x00z510 */
  161. u64 ce_pad_00z518[29]; /* 0x00z518 -- 0x00z5F8 */
  162. u64 ce_lsi_phy_lyr_cfg; /* 0x00z600 */
  163. u64 ce_pad_00z608; /* 0x00z608 */
  164. u64 ce_lsi_phy_lyr_int_stat; /* 0x00z610 */
  165. u64 ce_lsi_phy_lyr_int_stat_test; /* 0x00z618 */
  166. u64 ce_lsi_phy_lyr_int_mask; /* 0x00z620 */
  167. u64 ce_pad_00z628[11]; /* 0x00z628 -- 0x00z678 */
  168. u64 ce_lsi_rcv_phy_cfg; /* 0x00z680 */
  169. u64 ce_lsi_rcv_phy_stat1; /* 0x00z688 */
  170. u64 ce_lsi_rcv_phy_stat2; /* 0x00z690 */
  171. u64 ce_lsi_rcv_phy_stat3; /* 0x00z698 */
  172. u64 ce_lsi_rcv_phy_int_stat; /* 0x00z6A0 */
  173. u64 ce_lsi_rcv_phy_int_stat_test; /* 0x00z6A8 */
  174. u64 ce_lsi_rcv_phy_int_mask; /* 0x00z6B0 */
  175. u64 ce_pad_00z6B8[9]; /* 0x00z6B8 -- 0x00z6F8 */
  176. u64 ce_lsi_tx_phy_cfg; /* 0x00z700 */
  177. u64 ce_lsi_tx_phy_stat; /* 0x00z708 */
  178. u64 ce_lsi_tx_phy_int_stat; /* 0x00z710 */
  179. u64 ce_lsi_tx_phy_int_stat_test; /* 0x00z718 */
  180. u64 ce_lsi_tx_phy_int_mask; /* 0x00z720 */
  181. u64 ce_lsi_tx_phy_stat2; /* 0x00z728 */
  182. u64 ce_pad_00z730[10]; /* 0x00z730 -- 0x00z77F */
  183. u64 ce_lsi_ltssm_cfg1; /* 0x00z780 */
  184. u64 ce_lsi_ltssm_cfg2; /* 0x00z788 */
  185. u64 ce_lsi_ltssm_cfg3; /* 0x00z790 */
  186. u64 ce_lsi_ltssm_cfg4; /* 0x00z798 */
  187. u64 ce_lsi_ltssm_cfg5; /* 0x00z7A0 */
  188. u64 ce_lsi_ltssm_stat1; /* 0x00z7A8 */
  189. u64 ce_lsi_ltssm_stat2; /* 0x00z7B0 */
  190. u64 ce_lsi_ltssm_int_stat; /* 0x00z7B8 */
  191. u64 ce_lsi_ltssm_int_stat_test; /* 0x00z7C0 */
  192. u64 ce_lsi_ltssm_int_mask; /* 0x00z7C8 */
  193. u64 ce_lsi_ltssm_stat_wr_en; /* 0x00z7D0 */
  194. u64 ce_pad_00z7D8[5]; /* 0x00z7D8 -- 0x00z7F8 */
  195. u64 ce_lsi_gb_cfg1; /* 0x00z800 */
  196. u64 ce_lsi_gb_cfg2; /* 0x00z808 */
  197. u64 ce_lsi_gb_cfg3; /* 0x00z810 */
  198. u64 ce_lsi_gb_cfg4; /* 0x00z818 */
  199. u64 ce_lsi_gb_stat; /* 0x00z820 */
  200. u64 ce_lsi_gb_int_stat; /* 0x00z828 */
  201. u64 ce_lsi_gb_int_stat_test; /* 0x00z830 */
  202. u64 ce_lsi_gb_int_mask; /* 0x00z838 */
  203. u64 ce_lsi_gb_pwr_dn1; /* 0x00z840 */
  204. u64 ce_lsi_gb_pwr_dn2; /* 0x00z848 */
  205. u64 ce_pad_00z850[246]; /* 0x00z850 -- 0x00zFF8 */
  206. } ce_lsi[2];
  207. u64 ce_pad_004000[10]; /* 0x004000 -- 0x004048 */
  208. /*
  209. * CRM: Coretalk Receive Module Registers
  210. */
  211. u64 ce_crm_debug_mux; /* 0x004050 */
  212. u64 ce_pad_004058; /* 0x004058 */
  213. u64 ce_crm_ssp_err_cmd_wrd; /* 0x004060 */
  214. u64 ce_crm_ssp_err_addr; /* 0x004068 */
  215. u64 ce_crm_ssp_err_syn; /* 0x004070 */
  216. u64 ce_pad_004078[499]; /* 0x004078 -- 0x005008 */
  217. /*
  218. * CXM: Coretalk Xmit Module Registers
  219. */
  220. u64 ce_cxm_dyn_credit_status; /* 0x005010 */
  221. u64 ce_cxm_last_credit_status; /* 0x005018 */
  222. u64 ce_cxm_credit_limit; /* 0x005020 */
  223. u64 ce_cxm_force_credit; /* 0x005028 */
  224. u64 ce_cxm_disable_bypass; /* 0x005030 */
  225. u64 ce_pad_005038[3]; /* 0x005038 -- 0x005048 */
  226. u64 ce_cxm_debug_mux; /* 0x005050 */
  227. u64 ce_pad_005058[501]; /* 0x005058 -- 0x005FF8 */
  228. /*
  229. * DTL: Downstream Transaction Layer Regs (Link#1 and Link#2)
  230. * DTL: Link#1 MMRs at start at 0x006000, Link#2 MMRs at 0x008000
  231. * DTL: the comment offsets at far right: let 'y' = {6 or 8}
  232. *
  233. * UTL: Downstream Transaction Layer Regs (Link#1 and Link#2)
  234. * UTL: Link#1 MMRs at start at 0x007000, Link#2 MMRs at 0x009000
  235. * UTL: the comment offsets at far right: let 'z' = {7 or 9}
  236. */
  237. #define ce_dtl(link_num) ce_dtl_utl[link_num-1]
  238. #define ce_utl(link_num) ce_dtl_utl[link_num-1]
  239. struct ce_dtl_utl_reg {
  240. /* DTL */
  241. u64 ce_dtl_dtdr_credit_limit; /* 0x00y000 */
  242. u64 ce_dtl_dtdr_credit_force; /* 0x00y008 */
  243. u64 ce_dtl_dyn_credit_status; /* 0x00y010 */
  244. u64 ce_dtl_dtl_last_credit_stat; /* 0x00y018 */
  245. u64 ce_dtl_dtl_ctrl; /* 0x00y020 */
  246. u64 ce_pad_00y028[5]; /* 0x00y028 -- 0x00y048 */
  247. u64 ce_dtl_debug_sel; /* 0x00y050 */
  248. u64 ce_pad_00y058[501]; /* 0x00y058 -- 0x00yFF8 */
  249. /* UTL */
  250. u64 ce_utl_utl_ctrl; /* 0x00z000 */
  251. u64 ce_utl_debug_sel; /* 0x00z008 */
  252. u64 ce_pad_00z010[510]; /* 0x00z010 -- 0x00zFF8 */
  253. } ce_dtl_utl[2];
  254. u64 ce_pad_00A000[514]; /* 0x00A000 -- 0x00B008 */
  255. /*
  256. * URE: Upstream Request Engine
  257. */
  258. u64 ce_ure_dyn_credit_status; /* 0x00B010 */
  259. u64 ce_ure_last_credit_status; /* 0x00B018 */
  260. u64 ce_ure_credit_limit; /* 0x00B020 */
  261. u64 ce_pad_00B028; /* 0x00B028 */
  262. u64 ce_ure_control; /* 0x00B030 */
  263. u64 ce_ure_status; /* 0x00B038 */
  264. u64 ce_pad_00B040[2]; /* 0x00B040 -- 0x00B048 */
  265. u64 ce_ure_debug_sel; /* 0x00B050 */
  266. u64 ce_ure_pcie_debug_sel; /* 0x00B058 */
  267. u64 ce_ure_ssp_err_cmd_wrd; /* 0x00B060 */
  268. u64 ce_ure_ssp_err_addr; /* 0x00B068 */
  269. u64 ce_ure_page_map; /* 0x00B070 */
  270. u64 ce_ure_dir_map[TIOCE_NUM_PORTS]; /* 0x00B078 */
  271. u64 ce_ure_pipe_sel1; /* 0x00B088 */
  272. u64 ce_ure_pipe_mask1; /* 0x00B090 */
  273. u64 ce_ure_pipe_sel2; /* 0x00B098 */
  274. u64 ce_ure_pipe_mask2; /* 0x00B0A0 */
  275. u64 ce_ure_pcie1_credits_sent; /* 0x00B0A8 */
  276. u64 ce_ure_pcie1_credits_used; /* 0x00B0B0 */
  277. u64 ce_ure_pcie1_credit_limit; /* 0x00B0B8 */
  278. u64 ce_ure_pcie2_credits_sent; /* 0x00B0C0 */
  279. u64 ce_ure_pcie2_credits_used; /* 0x00B0C8 */
  280. u64 ce_ure_pcie2_credit_limit; /* 0x00B0D0 */
  281. u64 ce_ure_pcie_force_credit; /* 0x00B0D8 */
  282. u64 ce_ure_rd_tnum_val; /* 0x00B0E0 */
  283. u64 ce_ure_rd_tnum_rsp_rcvd; /* 0x00B0E8 */
  284. u64 ce_ure_rd_tnum_esent_timer; /* 0x00B0F0 */
  285. u64 ce_ure_rd_tnum_error; /* 0x00B0F8 */
  286. u64 ce_ure_rd_tnum_first_cl; /* 0x00B100 */
  287. u64 ce_ure_rd_tnum_link_buf; /* 0x00B108 */
  288. u64 ce_ure_wr_tnum_val; /* 0x00B110 */
  289. u64 ce_ure_sram_err_addr0; /* 0x00B118 */
  290. u64 ce_ure_sram_err_addr1; /* 0x00B120 */
  291. u64 ce_ure_sram_err_addr2; /* 0x00B128 */
  292. u64 ce_ure_sram_rd_addr0; /* 0x00B130 */
  293. u64 ce_ure_sram_rd_addr1; /* 0x00B138 */
  294. u64 ce_ure_sram_rd_addr2; /* 0x00B140 */
  295. u64 ce_ure_sram_wr_addr0; /* 0x00B148 */
  296. u64 ce_ure_sram_wr_addr1; /* 0x00B150 */
  297. u64 ce_ure_sram_wr_addr2; /* 0x00B158 */
  298. u64 ce_ure_buf_flush10; /* 0x00B160 */
  299. u64 ce_ure_buf_flush11; /* 0x00B168 */
  300. u64 ce_ure_buf_flush12; /* 0x00B170 */
  301. u64 ce_ure_buf_flush13; /* 0x00B178 */
  302. u64 ce_ure_buf_flush20; /* 0x00B180 */
  303. u64 ce_ure_buf_flush21; /* 0x00B188 */
  304. u64 ce_ure_buf_flush22; /* 0x00B190 */
  305. u64 ce_ure_buf_flush23; /* 0x00B198 */
  306. u64 ce_ure_pcie_control1; /* 0x00B1A0 */
  307. u64 ce_ure_pcie_control2; /* 0x00B1A8 */
  308. u64 ce_pad_00B1B0[458]; /* 0x00B1B0 -- 0x00BFF8 */
  309. /* Upstream Data Buffer, Port1 */
  310. struct ce_ure_maint_ups_dat1_data {
  311. u64 data63_0[512]; /* 0x00C000 -- 0x00CFF8 */
  312. u64 data127_64[512]; /* 0x00D000 -- 0x00DFF8 */
  313. u64 parity[512]; /* 0x00E000 -- 0x00EFF8 */
  314. } ce_ure_maint_ups_dat1;
  315. /* Upstream Header Buffer, Port1 */
  316. struct ce_ure_maint_ups_hdr1_data {
  317. u64 data63_0[512]; /* 0x00F000 -- 0x00FFF8 */
  318. u64 data127_64[512]; /* 0x010000 -- 0x010FF8 */
  319. u64 parity[512]; /* 0x011000 -- 0x011FF8 */
  320. } ce_ure_maint_ups_hdr1;
  321. /* Upstream Data Buffer, Port2 */
  322. struct ce_ure_maint_ups_dat2_data {
  323. u64 data63_0[512]; /* 0x012000 -- 0x012FF8 */
  324. u64 data127_64[512]; /* 0x013000 -- 0x013FF8 */
  325. u64 parity[512]; /* 0x014000 -- 0x014FF8 */
  326. } ce_ure_maint_ups_dat2;
  327. /* Upstream Header Buffer, Port2 */
  328. struct ce_ure_maint_ups_hdr2_data {
  329. u64 data63_0[512]; /* 0x015000 -- 0x015FF8 */
  330. u64 data127_64[512]; /* 0x016000 -- 0x016FF8 */
  331. u64 parity[512]; /* 0x017000 -- 0x017FF8 */
  332. } ce_ure_maint_ups_hdr2;
  333. /* Downstream Data Buffer */
  334. struct ce_ure_maint_dns_dat_data {
  335. u64 data63_0[512]; /* 0x018000 -- 0x018FF8 */
  336. u64 data127_64[512]; /* 0x019000 -- 0x019FF8 */
  337. u64 parity[512]; /* 0x01A000 -- 0x01AFF8 */
  338. } ce_ure_maint_dns_dat;
  339. /* Downstream Header Buffer */
  340. struct ce_ure_maint_dns_hdr_data {
  341. u64 data31_0[64]; /* 0x01B000 -- 0x01B1F8 */
  342. u64 data95_32[64]; /* 0x01B200 -- 0x01B3F8 */
  343. u64 parity[64]; /* 0x01B400 -- 0x01B5F8 */
  344. } ce_ure_maint_dns_hdr;
  345. /* RCI Buffer Data */
  346. struct ce_ure_maint_rci_data {
  347. u64 data41_0[64]; /* 0x01B600 -- 0x01B7F8 */
  348. u64 data69_42[64]; /* 0x01B800 -- 0x01B9F8 */
  349. } ce_ure_maint_rci;
  350. /* Response Queue */
  351. u64 ce_ure_maint_rspq[64]; /* 0x01BA00 -- 0x01BBF8 */
  352. u64 ce_pad_01C000[4224]; /* 0x01BC00 -- 0x023FF8 */
  353. /* Admin Build-a-Packet Buffer */
  354. struct ce_adm_maint_bap_buf_data {
  355. u64 data63_0[258]; /* 0x024000 -- 0x024808 */
  356. u64 data127_64[258]; /* 0x024810 -- 0x025018 */
  357. u64 parity[258]; /* 0x025020 -- 0x025828 */
  358. } ce_adm_maint_bap_buf;
  359. u64 ce_pad_025830[5370]; /* 0x025830 -- 0x02FFF8 */
  360. /* URE: 40bit PMU ATE Buffer */ /* 0x030000 -- 0x037FF8 */
  361. u64 ce_ure_ate40[TIOCE_NUM_M40_ATES];
  362. /* URE: 32/40bit PMU ATE Buffer */ /* 0x038000 -- 0x03BFF8 */
  363. u64 ce_ure_ate3240[TIOCE_NUM_M3240_ATES];
  364. u64 ce_pad_03C000[2050]; /* 0x03C000 -- 0x040008 */
  365. /*
  366. * DRE: Down Stream Request Engine
  367. */
  368. u64 ce_dre_dyn_credit_status1; /* 0x040010 */
  369. u64 ce_dre_dyn_credit_status2; /* 0x040018 */
  370. u64 ce_dre_last_credit_status1; /* 0x040020 */
  371. u64 ce_dre_last_credit_status2; /* 0x040028 */
  372. u64 ce_dre_credit_limit1; /* 0x040030 */
  373. u64 ce_dre_credit_limit2; /* 0x040038 */
  374. u64 ce_dre_force_credit1; /* 0x040040 */
  375. u64 ce_dre_force_credit2; /* 0x040048 */
  376. u64 ce_dre_debug_mux1; /* 0x040050 */
  377. u64 ce_dre_debug_mux2; /* 0x040058 */
  378. u64 ce_dre_ssp_err_cmd_wrd; /* 0x040060 */
  379. u64 ce_dre_ssp_err_addr; /* 0x040068 */
  380. u64 ce_dre_comp_err_cmd_wrd; /* 0x040070 */
  381. u64 ce_dre_comp_err_addr; /* 0x040078 */
  382. u64 ce_dre_req_status; /* 0x040080 */
  383. u64 ce_dre_config1; /* 0x040088 */
  384. u64 ce_dre_config2; /* 0x040090 */
  385. u64 ce_dre_config_req_status; /* 0x040098 */
  386. u64 ce_pad_0400A0[12]; /* 0x0400A0 -- 0x0400F8 */
  387. u64 ce_dre_dyn_fifo; /* 0x040100 */
  388. u64 ce_pad_040108[3]; /* 0x040108 -- 0x040118 */
  389. u64 ce_dre_last_fifo; /* 0x040120 */
  390. u64 ce_pad_040128[27]; /* 0x040128 -- 0x0401F8 */
  391. /* DRE Downstream Head Queue */
  392. struct ce_dre_maint_ds_head_queue {
  393. u64 data63_0[32]; /* 0x040200 -- 0x0402F8 */
  394. u64 data127_64[32]; /* 0x040300 -- 0x0403F8 */
  395. u64 parity[32]; /* 0x040400 -- 0x0404F8 */
  396. } ce_dre_maint_ds_head_q;
  397. u64 ce_pad_040500[352]; /* 0x040500 -- 0x040FF8 */
  398. /* DRE Downstream Data Queue */
  399. struct ce_dre_maint_ds_data_queue {
  400. u64 data63_0[256]; /* 0x041000 -- 0x0417F8 */
  401. u64 ce_pad_041800[256]; /* 0x041800 -- 0x041FF8 */
  402. u64 data127_64[256]; /* 0x042000 -- 0x0427F8 */
  403. u64 ce_pad_042800[256]; /* 0x042800 -- 0x042FF8 */
  404. u64 parity[256]; /* 0x043000 -- 0x0437F8 */
  405. u64 ce_pad_043800[256]; /* 0x043800 -- 0x043FF8 */
  406. } ce_dre_maint_ds_data_q;
  407. /* DRE URE Upstream Response Queue */
  408. struct ce_dre_maint_ure_us_rsp_queue {
  409. u64 data63_0[8]; /* 0x044000 -- 0x044038 */
  410. u64 ce_pad_044040[24]; /* 0x044040 -- 0x0440F8 */
  411. u64 data127_64[8]; /* 0x044100 -- 0x044138 */
  412. u64 ce_pad_044140[24]; /* 0x044140 -- 0x0441F8 */
  413. u64 parity[8]; /* 0x044200 -- 0x044238 */
  414. u64 ce_pad_044240[24]; /* 0x044240 -- 0x0442F8 */
  415. } ce_dre_maint_ure_us_rsp_q;
  416. u64 ce_dre_maint_us_wrt_rsp[32];/* 0x044300 -- 0x0443F8 */
  417. u64 ce_end_of_struct; /* 0x044400 */
  418. } tioce_t;
  419. /* ce_lsiX_gb_cfg1 register bit masks & shifts */
  420. #define CE_LSI_GB_CFG1_RXL0S_THS_SHFT 0
  421. #define CE_LSI_GB_CFG1_RXL0S_THS_MASK (0xffULL << 0)
  422. #define CE_LSI_GB_CFG1_RXL0S_SMP_SHFT 8
  423. #define CE_LSI_GB_CFG1_RXL0S_SMP_MASK (0xfULL << 8)
  424. #define CE_LSI_GB_CFG1_RXL0S_ADJ_SHFT 12
  425. #define CE_LSI_GB_CFG1_RXL0S_ADJ_MASK (0x7ULL << 12)
  426. #define CE_LSI_GB_CFG1_RXL0S_FLT_SHFT 15
  427. #define CE_LSI_GB_CFG1_RXL0S_FLT_MASK (0x1ULL << 15)
  428. #define CE_LSI_GB_CFG1_LPBK_SEL_SHFT 16
  429. #define CE_LSI_GB_CFG1_LPBK_SEL_MASK (0x3ULL << 16)
  430. #define CE_LSI_GB_CFG1_LPBK_EN_SHFT 18
  431. #define CE_LSI_GB_CFG1_LPBK_EN_MASK (0x1ULL << 18)
  432. #define CE_LSI_GB_CFG1_RVRS_LB_SHFT 19
  433. #define CE_LSI_GB_CFG1_RVRS_LB_MASK (0x1ULL << 19)
  434. #define CE_LSI_GB_CFG1_RVRS_CLK_SHFT 20
  435. #define CE_LSI_GB_CFG1_RVRS_CLK_MASK (0x3ULL << 20)
  436. #define CE_LSI_GB_CFG1_SLF_TS_SHFT 24
  437. #define CE_LSI_GB_CFG1_SLF_TS_MASK (0xfULL << 24)
  438. /* ce_adm_int_mask/ce_adm_int_status register bit defines */
  439. #define CE_ADM_INT_CE_ERROR_SHFT 0
  440. #define CE_ADM_INT_LSI1_IP_ERROR_SHFT 1
  441. #define CE_ADM_INT_LSI2_IP_ERROR_SHFT 2
  442. #define CE_ADM_INT_PCIE_ERROR_SHFT 3
  443. #define CE_ADM_INT_PORT1_HOTPLUG_EVENT_SHFT 4
  444. #define CE_ADM_INT_PORT2_HOTPLUG_EVENT_SHFT 5
  445. #define CE_ADM_INT_PCIE_PORT1_DEV_A_SHFT 6
  446. #define CE_ADM_INT_PCIE_PORT1_DEV_B_SHFT 7
  447. #define CE_ADM_INT_PCIE_PORT1_DEV_C_SHFT 8
  448. #define CE_ADM_INT_PCIE_PORT1_DEV_D_SHFT 9
  449. #define CE_ADM_INT_PCIE_PORT2_DEV_A_SHFT 10
  450. #define CE_ADM_INT_PCIE_PORT2_DEV_B_SHFT 11
  451. #define CE_ADM_INT_PCIE_PORT2_DEV_C_SHFT 12
  452. #define CE_ADM_INT_PCIE_PORT2_DEV_D_SHFT 13
  453. #define CE_ADM_INT_PCIE_MSG_SHFT 14 /*see int_dest_14*/
  454. #define CE_ADM_INT_PCIE_MSG_SLOT_0_SHFT 14
  455. #define CE_ADM_INT_PCIE_MSG_SLOT_1_SHFT 15
  456. #define CE_ADM_INT_PCIE_MSG_SLOT_2_SHFT 16
  457. #define CE_ADM_INT_PCIE_MSG_SLOT_3_SHFT 17
  458. #define CE_ADM_INT_PORT1_PM_PME_MSG_SHFT 22
  459. #define CE_ADM_INT_PORT2_PM_PME_MSG_SHFT 23
  460. /* ce_adm_force_int register bit defines */
  461. #define CE_ADM_FORCE_INT_PCIE_PORT1_DEV_A_SHFT 0
  462. #define CE_ADM_FORCE_INT_PCIE_PORT1_DEV_B_SHFT 1
  463. #define CE_ADM_FORCE_INT_PCIE_PORT1_DEV_C_SHFT 2
  464. #define CE_ADM_FORCE_INT_PCIE_PORT1_DEV_D_SHFT 3
  465. #define CE_ADM_FORCE_INT_PCIE_PORT2_DEV_A_SHFT 4
  466. #define CE_ADM_FORCE_INT_PCIE_PORT2_DEV_B_SHFT 5
  467. #define CE_ADM_FORCE_INT_PCIE_PORT2_DEV_C_SHFT 6
  468. #define CE_ADM_FORCE_INT_PCIE_PORT2_DEV_D_SHFT 7
  469. #define CE_ADM_FORCE_INT_ALWAYS_SHFT 8
  470. /* ce_adm_int_dest register bit masks & shifts */
  471. #define INTR_VECTOR_SHFT 56
  472. /* ce_adm_error_mask and ce_adm_error_summary register bit masks */
  473. #define CE_ADM_ERR_CRM_SSP_REQ_INVALID (0x1ULL << 0)
  474. #define CE_ADM_ERR_SSP_REQ_HEADER (0x1ULL << 1)
  475. #define CE_ADM_ERR_SSP_RSP_HEADER (0x1ULL << 2)
  476. #define CE_ADM_ERR_SSP_PROTOCOL_ERROR (0x1ULL << 3)
  477. #define CE_ADM_ERR_SSP_SBE (0x1ULL << 4)
  478. #define CE_ADM_ERR_SSP_MBE (0x1ULL << 5)
  479. #define CE_ADM_ERR_CXM_CREDIT_OFLOW (0x1ULL << 6)
  480. #define CE_ADM_ERR_DRE_SSP_REQ_INVAL (0x1ULL << 7)
  481. #define CE_ADM_ERR_SSP_REQ_LONG (0x1ULL << 8)
  482. #define CE_ADM_ERR_SSP_REQ_OFLOW (0x1ULL << 9)
  483. #define CE_ADM_ERR_SSP_REQ_SHORT (0x1ULL << 10)
  484. #define CE_ADM_ERR_SSP_REQ_SIDEBAND (0x1ULL << 11)
  485. #define CE_ADM_ERR_SSP_REQ_ADDR_ERR (0x1ULL << 12)
  486. #define CE_ADM_ERR_SSP_REQ_BAD_BE (0x1ULL << 13)
  487. #define CE_ADM_ERR_PCIE_COMPL_TIMEOUT (0x1ULL << 14)
  488. #define CE_ADM_ERR_PCIE_UNEXP_COMPL (0x1ULL << 15)
  489. #define CE_ADM_ERR_PCIE_ERR_COMPL (0x1ULL << 16)
  490. #define CE_ADM_ERR_DRE_CREDIT_OFLOW (0x1ULL << 17)
  491. #define CE_ADM_ERR_DRE_SRAM_PE (0x1ULL << 18)
  492. #define CE_ADM_ERR_SSP_RSP_INVALID (0x1ULL << 19)
  493. #define CE_ADM_ERR_SSP_RSP_LONG (0x1ULL << 20)
  494. #define CE_ADM_ERR_SSP_RSP_SHORT (0x1ULL << 21)
  495. #define CE_ADM_ERR_SSP_RSP_SIDEBAND (0x1ULL << 22)
  496. #define CE_ADM_ERR_URE_SSP_RSP_UNEXP (0x1ULL << 23)
  497. #define CE_ADM_ERR_URE_SSP_WR_REQ_TIMEOUT (0x1ULL << 24)
  498. #define CE_ADM_ERR_URE_SSP_RD_REQ_TIMEOUT (0x1ULL << 25)
  499. #define CE_ADM_ERR_URE_ATE3240_PAGE_FAULT (0x1ULL << 26)
  500. #define CE_ADM_ERR_URE_ATE40_PAGE_FAULT (0x1ULL << 27)
  501. #define CE_ADM_ERR_URE_CREDIT_OFLOW (0x1ULL << 28)
  502. #define CE_ADM_ERR_URE_SRAM_PE (0x1ULL << 29)
  503. #define CE_ADM_ERR_ADM_SSP_RSP_UNEXP (0x1ULL << 30)
  504. #define CE_ADM_ERR_ADM_SSP_REQ_TIMEOUT (0x1ULL << 31)
  505. #define CE_ADM_ERR_MMR_ACCESS_ERROR (0x1ULL << 32)
  506. #define CE_ADM_ERR_MMR_ADDR_ERROR (0x1ULL << 33)
  507. #define CE_ADM_ERR_ADM_CREDIT_OFLOW (0x1ULL << 34)
  508. #define CE_ADM_ERR_ADM_SRAM_PE (0x1ULL << 35)
  509. #define CE_ADM_ERR_DTL1_MIN_PDATA_CREDIT_ERR (0x1ULL << 36)
  510. #define CE_ADM_ERR_DTL1_INF_COMPL_CRED_UPDT_ERR (0x1ULL << 37)
  511. #define CE_ADM_ERR_DTL1_INF_POSTED_CRED_UPDT_ERR (0x1ULL << 38)
  512. #define CE_ADM_ERR_DTL1_INF_NPOSTED_CRED_UPDT_ERR (0x1ULL << 39)
  513. #define CE_ADM_ERR_DTL1_COMP_HD_CRED_MAX_ERR (0x1ULL << 40)
  514. #define CE_ADM_ERR_DTL1_COMP_D_CRED_MAX_ERR (0x1ULL << 41)
  515. #define CE_ADM_ERR_DTL1_NPOSTED_HD_CRED_MAX_ERR (0x1ULL << 42)
  516. #define CE_ADM_ERR_DTL1_NPOSTED_D_CRED_MAX_ERR (0x1ULL << 43)
  517. #define CE_ADM_ERR_DTL1_POSTED_HD_CRED_MAX_ERR (0x1ULL << 44)
  518. #define CE_ADM_ERR_DTL1_POSTED_D_CRED_MAX_ERR (0x1ULL << 45)
  519. #define CE_ADM_ERR_DTL2_MIN_PDATA_CREDIT_ERR (0x1ULL << 46)
  520. #define CE_ADM_ERR_DTL2_INF_COMPL_CRED_UPDT_ERR (0x1ULL << 47)
  521. #define CE_ADM_ERR_DTL2_INF_POSTED_CRED_UPDT_ERR (0x1ULL << 48)
  522. #define CE_ADM_ERR_DTL2_INF_NPOSTED_CRED_UPDT_ERR (0x1ULL << 49)
  523. #define CE_ADM_ERR_DTL2_COMP_HD_CRED_MAX_ERR (0x1ULL << 50)
  524. #define CE_ADM_ERR_DTL2_COMP_D_CRED_MAX_ERR (0x1ULL << 51)
  525. #define CE_ADM_ERR_DTL2_NPOSTED_HD_CRED_MAX_ERR (0x1ULL << 52)
  526. #define CE_ADM_ERR_DTL2_NPOSTED_D_CRED_MAX_ERR (0x1ULL << 53)
  527. #define CE_ADM_ERR_DTL2_POSTED_HD_CRED_MAX_ERR (0x1ULL << 54)
  528. #define CE_ADM_ERR_DTL2_POSTED_D_CRED_MAX_ERR (0x1ULL << 55)
  529. #define CE_ADM_ERR_PORT1_PCIE_COR_ERR (0x1ULL << 56)
  530. #define CE_ADM_ERR_PORT1_PCIE_NFAT_ERR (0x1ULL << 57)
  531. #define CE_ADM_ERR_PORT1_PCIE_FAT_ERR (0x1ULL << 58)
  532. #define CE_ADM_ERR_PORT2_PCIE_COR_ERR (0x1ULL << 59)
  533. #define CE_ADM_ERR_PORT2_PCIE_NFAT_ERR (0x1ULL << 60)
  534. #define CE_ADM_ERR_PORT2_PCIE_FAT_ERR (0x1ULL << 61)
  535. /* ce_adm_ure_ups_buf_barrier_flush register bit masks and shifts */
  536. #define FLUSH_SEL_PORT1_PIPE0_SHFT 0
  537. #define FLUSH_SEL_PORT1_PIPE1_SHFT 4
  538. #define FLUSH_SEL_PORT1_PIPE2_SHFT 8
  539. #define FLUSH_SEL_PORT1_PIPE3_SHFT 12
  540. #define FLUSH_SEL_PORT2_PIPE0_SHFT 16
  541. #define FLUSH_SEL_PORT2_PIPE1_SHFT 20
  542. #define FLUSH_SEL_PORT2_PIPE2_SHFT 24
  543. #define FLUSH_SEL_PORT2_PIPE3_SHFT 28
  544. /* ce_dre_config1 register bit masks and shifts */
  545. #define CE_DRE_RO_ENABLE (0x1ULL << 0)
  546. #define CE_DRE_DYN_RO_ENABLE (0x1ULL << 1)
  547. #define CE_DRE_SUP_CONFIG_COMP_ERROR (0x1ULL << 2)
  548. #define CE_DRE_SUP_IO_COMP_ERROR (0x1ULL << 3)
  549. #define CE_DRE_ADDR_MODE_SHFT 4
  550. /* ce_dre_config_req_status register bit masks */
  551. #define CE_DRE_LAST_CONFIG_COMPLETION (0x7ULL << 0)
  552. #define CE_DRE_DOWNSTREAM_CONFIG_ERROR (0x1ULL << 3)
  553. #define CE_DRE_CONFIG_COMPLETION_VALID (0x1ULL << 4)
  554. #define CE_DRE_CONFIG_REQUEST_ACTIVE (0x1ULL << 5)
  555. /* ce_ure_control register bit masks & shifts */
  556. #define CE_URE_RD_MRG_ENABLE (0x1ULL << 0)
  557. #define CE_URE_WRT_MRG_ENABLE1 (0x1ULL << 4)
  558. #define CE_URE_WRT_MRG_ENABLE2 (0x1ULL << 5)
  559. #define CE_URE_WRT_MRG_TIMER_SHFT 12
  560. #define CE_URE_WRT_MRG_TIMER_MASK (0x7FFULL << CE_URE_WRT_MRG_TIMER_SHFT)
  561. #define CE_URE_WRT_MRG_TIMER(x) (((u64)(x) << \
  562. CE_URE_WRT_MRG_TIMER_SHFT) & \
  563. CE_URE_WRT_MRG_TIMER_MASK)
  564. #define CE_URE_RSPQ_BYPASS_DISABLE (0x1ULL << 24)
  565. #define CE_URE_UPS_DAT1_PAR_DISABLE (0x1ULL << 32)
  566. #define CE_URE_UPS_HDR1_PAR_DISABLE (0x1ULL << 33)
  567. #define CE_URE_UPS_DAT2_PAR_DISABLE (0x1ULL << 34)
  568. #define CE_URE_UPS_HDR2_PAR_DISABLE (0x1ULL << 35)
  569. #define CE_URE_ATE_PAR_DISABLE (0x1ULL << 36)
  570. #define CE_URE_RCI_PAR_DISABLE (0x1ULL << 37)
  571. #define CE_URE_RSPQ_PAR_DISABLE (0x1ULL << 38)
  572. #define CE_URE_DNS_DAT_PAR_DISABLE (0x1ULL << 39)
  573. #define CE_URE_DNS_HDR_PAR_DISABLE (0x1ULL << 40)
  574. #define CE_URE_MALFORM_DISABLE (0x1ULL << 44)
  575. #define CE_URE_UNSUP_DISABLE (0x1ULL << 45)
  576. /* ce_ure_page_map register bit masks & shifts */
  577. #define CE_URE_ATE3240_ENABLE (0x1ULL << 0)
  578. #define CE_URE_ATE40_ENABLE (0x1ULL << 1)
  579. #define CE_URE_PAGESIZE_SHFT 4
  580. #define CE_URE_PAGESIZE_MASK (0x7ULL << CE_URE_PAGESIZE_SHFT)
  581. #define CE_URE_4K_PAGESIZE (0x0ULL << CE_URE_PAGESIZE_SHFT)
  582. #define CE_URE_16K_PAGESIZE (0x1ULL << CE_URE_PAGESIZE_SHFT)
  583. #define CE_URE_64K_PAGESIZE (0x2ULL << CE_URE_PAGESIZE_SHFT)
  584. #define CE_URE_128K_PAGESIZE (0x3ULL << CE_URE_PAGESIZE_SHFT)
  585. #define CE_URE_256K_PAGESIZE (0x4ULL << CE_URE_PAGESIZE_SHFT)
  586. /* ce_ure_pipe_sel register bit masks & shifts */
  587. #define PKT_TRAFIC_SHRT 16
  588. #define BUS_SRC_ID_SHFT 8
  589. #define DEV_SRC_ID_SHFT 3
  590. #define FNC_SRC_ID_SHFT 0
  591. #define CE_URE_TC_MASK (0x07ULL << PKT_TRAFIC_SHRT)
  592. #define CE_URE_BUS_MASK (0xFFULL << BUS_SRC_ID_SHFT)
  593. #define CE_URE_DEV_MASK (0x1FULL << DEV_SRC_ID_SHFT)
  594. #define CE_URE_FNC_MASK (0x07ULL << FNC_SRC_ID_SHFT)
  595. #define CE_URE_PIPE_BUS(b) (((u64)(b) << BUS_SRC_ID_SHFT) & \
  596. CE_URE_BUS_MASK)
  597. #define CE_URE_PIPE_DEV(d) (((u64)(d) << DEV_SRC_ID_SHFT) & \
  598. CE_URE_DEV_MASK)
  599. #define CE_URE_PIPE_FNC(f) (((u64)(f) << FNC_SRC_ID_SHFT) & \
  600. CE_URE_FNC_MASK)
  601. #define CE_URE_SEL1_SHFT 0
  602. #define CE_URE_SEL2_SHFT 20
  603. #define CE_URE_SEL3_SHFT 40
  604. #define CE_URE_SEL1_MASK (0x7FFFFULL << CE_URE_SEL1_SHFT)
  605. #define CE_URE_SEL2_MASK (0x7FFFFULL << CE_URE_SEL2_SHFT)
  606. #define CE_URE_SEL3_MASK (0x7FFFFULL << CE_URE_SEL3_SHFT)
  607. /* ce_ure_pipe_mask register bit masks & shifts */
  608. #define CE_URE_MASK1_SHFT 0
  609. #define CE_URE_MASK2_SHFT 20
  610. #define CE_URE_MASK3_SHFT 40
  611. #define CE_URE_MASK1_MASK (0x7FFFFULL << CE_URE_MASK1_SHFT)
  612. #define CE_URE_MASK2_MASK (0x7FFFFULL << CE_URE_MASK2_SHFT)
  613. #define CE_URE_MASK3_MASK (0x7FFFFULL << CE_URE_MASK3_SHFT)
  614. /* ce_ure_pcie_control1 register bit masks & shifts */
  615. #define CE_URE_SI (0x1ULL << 0)
  616. #define CE_URE_ELAL_SHFT 4
  617. #define CE_URE_ELAL_MASK (0x7ULL << CE_URE_ELAL_SHFT)
  618. #define CE_URE_ELAL_SET(n) (((u64)(n) << CE_URE_ELAL_SHFT) & \
  619. CE_URE_ELAL_MASK)
  620. #define CE_URE_ELAL1_SHFT 8
  621. #define CE_URE_ELAL1_MASK (0x7ULL << CE_URE_ELAL1_SHFT)
  622. #define CE_URE_ELAL1_SET(n) (((u64)(n) << CE_URE_ELAL1_SHFT) & \
  623. CE_URE_ELAL1_MASK)
  624. #define CE_URE_SCC (0x1ULL << 12)
  625. #define CE_URE_PN1_SHFT 16
  626. #define CE_URE_PN1_MASK (0xFFULL << CE_URE_PN1_SHFT)
  627. #define CE_URE_PN2_SHFT 24
  628. #define CE_URE_PN2_MASK (0xFFULL << CE_URE_PN2_SHFT)
  629. #define CE_URE_PN1_SET(n) (((u64)(n) << CE_URE_PN1_SHFT) & \
  630. CE_URE_PN1_MASK)
  631. #define CE_URE_PN2_SET(n) (((u64)(n) << CE_URE_PN2_SHFT) & \
  632. CE_URE_PN2_MASK)
  633. /* ce_ure_pcie_control2 register bit masks & shifts */
  634. #define CE_URE_ABP (0x1ULL << 0)
  635. #define CE_URE_PCP (0x1ULL << 1)
  636. #define CE_URE_MSP (0x1ULL << 2)
  637. #define CE_URE_AIP (0x1ULL << 3)
  638. #define CE_URE_PIP (0x1ULL << 4)
  639. #define CE_URE_HPS (0x1ULL << 5)
  640. #define CE_URE_HPC (0x1ULL << 6)
  641. #define CE_URE_SPLV_SHFT 7
  642. #define CE_URE_SPLV_MASK (0xFFULL << CE_URE_SPLV_SHFT)
  643. #define CE_URE_SPLV_SET(n) (((u64)(n) << CE_URE_SPLV_SHFT) & \
  644. CE_URE_SPLV_MASK)
  645. #define CE_URE_SPLS_SHFT 15
  646. #define CE_URE_SPLS_MASK (0x3ULL << CE_URE_SPLS_SHFT)
  647. #define CE_URE_SPLS_SET(n) (((u64)(n) << CE_URE_SPLS_SHFT) & \
  648. CE_URE_SPLS_MASK)
  649. #define CE_URE_PSN1_SHFT 19
  650. #define CE_URE_PSN1_MASK (0x1FFFULL << CE_URE_PSN1_SHFT)
  651. #define CE_URE_PSN2_SHFT 32
  652. #define CE_URE_PSN2_MASK (0x1FFFULL << CE_URE_PSN2_SHFT)
  653. #define CE_URE_PSN1_SET(n) (((u64)(n) << CE_URE_PSN1_SHFT) & \
  654. CE_URE_PSN1_MASK)
  655. #define CE_URE_PSN2_SET(n) (((u64)(n) << CE_URE_PSN2_SHFT) & \
  656. CE_URE_PSN2_MASK)
  657. /*
  658. * PIO address space ranges for CE
  659. */
  660. /* Local CE Registers Space */
  661. #define CE_PIO_MMR 0x00000000
  662. #define CE_PIO_MMR_LEN 0x04000000
  663. /* PCI Compatible Config Space */
  664. #define CE_PIO_CONFIG_SPACE 0x04000000
  665. #define CE_PIO_CONFIG_SPACE_LEN 0x04000000
  666. /* PCI I/O Space Alias */
  667. #define CE_PIO_IO_SPACE_ALIAS 0x08000000
  668. #define CE_PIO_IO_SPACE_ALIAS_LEN 0x08000000
  669. /* PCI Enhanced Config Space */
  670. #define CE_PIO_E_CONFIG_SPACE 0x10000000
  671. #define CE_PIO_E_CONFIG_SPACE_LEN 0x10000000
  672. /* PCI I/O Space */
  673. #define CE_PIO_IO_SPACE 0x100000000
  674. #define CE_PIO_IO_SPACE_LEN 0x100000000
  675. /* PCI MEM Space */
  676. #define CE_PIO_MEM_SPACE 0x200000000
  677. #define CE_PIO_MEM_SPACE_LEN TIO_HWIN_SIZE
  678. /*
  679. * CE PCI Enhanced Config Space shifts & masks
  680. */
  681. #define CE_E_CONFIG_BUS_SHFT 20
  682. #define CE_E_CONFIG_BUS_MASK (0xFF << CE_E_CONFIG_BUS_SHFT)
  683. #define CE_E_CONFIG_DEVICE_SHFT 15
  684. #define CE_E_CONFIG_DEVICE_MASK (0x1F << CE_E_CONFIG_DEVICE_SHFT)
  685. #define CE_E_CONFIG_FUNC_SHFT 12
  686. #define CE_E_CONFIG_FUNC_MASK (0x7 << CE_E_CONFIG_FUNC_SHFT)
  687. #endif /* __ASM_IA64_SN_TIOCE_H__ */