hubio.h 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988
  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. * Derived from IRIX <sys/SN/SN0/hubio.h>, Revision 1.80.
  7. *
  8. * Copyright (C) 1992 - 1997, 1999 Silicon Graphics, Inc.
  9. * Copyright (C) 1999 by Ralf Baechle
  10. */
  11. #ifndef _ASM_SGI_SN_SN0_HUBIO_H
  12. #define _ASM_SGI_SN_SN0_HUBIO_H
  13. /*
  14. * Hub I/O interface registers
  15. *
  16. * All registers in this file are subject to change until Hub chip tapeout.
  17. * In general, the longer software name should be used when available.
  18. */
  19. /*
  20. * Slightly friendlier names for some common registers.
  21. * The hardware definitions follow.
  22. */
  23. #define IIO_WIDGET IIO_WID /* Widget identification */
  24. #define IIO_WIDGET_STAT IIO_WSTAT /* Widget status register */
  25. #define IIO_WIDGET_CTRL IIO_WCR /* Widget control register */
  26. #define IIO_WIDGET_TOUT IIO_WRTO /* Widget request timeout */
  27. #define IIO_WIDGET_FLUSH IIO_WTFR /* Widget target flush */
  28. #define IIO_PROTECT IIO_ILAPR /* IO interface protection */
  29. #define IIO_PROTECT_OVRRD IIO_ILAPO /* IO protect override */
  30. #define IIO_OUTWIDGET_ACCESS IIO_IOWA /* Outbound widget access */
  31. #define IIO_INWIDGET_ACCESS IIO_IIWA /* Inbound widget access */
  32. #define IIO_INDEV_ERR_MASK IIO_IIDEM /* Inbound device error mask */
  33. #define IIO_LLP_CSR IIO_ILCSR /* LLP control and status */
  34. #define IIO_LLP_LOG IIO_ILLR /* LLP log */
  35. #define IIO_XTALKCC_TOUT IIO_IXCC /* Xtalk credit count timeout*/
  36. #define IIO_XTALKTT_TOUT IIO_IXTT /* Xtalk tail timeout */
  37. #define IIO_IO_ERR_CLR IIO_IECLR /* IO error clear */
  38. #define IIO_BTE_CRB_CNT IIO_IBCN /* IO BTE CRB count */
  39. #define IIO_LLP_CSR_IS_UP 0x00002000
  40. #define IIO_LLP_CSR_LLP_STAT_MASK 0x00003000
  41. #define IIO_LLP_CSR_LLP_STAT_SHFT 12
  42. /* key to IIO_PROTECT_OVRRD */
  43. #define IIO_PROTECT_OVRRD_KEY 0x53474972756c6573ull /* "SGIrules" */
  44. /* BTE register names */
  45. #define IIO_BTE_STAT_0 IIO_IBLS_0 /* Also BTE length/status 0 */
  46. #define IIO_BTE_SRC_0 IIO_IBSA_0 /* Also BTE source address 0 */
  47. #define IIO_BTE_DEST_0 IIO_IBDA_0 /* Also BTE dest. address 0 */
  48. #define IIO_BTE_CTRL_0 IIO_IBCT_0 /* Also BTE control/terminate 0 */
  49. #define IIO_BTE_NOTIFY_0 IIO_IBNA_0 /* Also BTE notification 0 */
  50. #define IIO_BTE_INT_0 IIO_IBIA_0 /* Also BTE interrupt 0 */
  51. #define IIO_BTE_OFF_0 0 /* Base offset from BTE 0 regs. */
  52. #define IIO_BTE_OFF_1 IIO_IBLS_1 - IIO_IBLS_0 /* Offset from base to BTE 1 */
  53. /* BTE register offsets from base */
  54. #define BTEOFF_STAT 0
  55. #define BTEOFF_SRC (IIO_BTE_SRC_0 - IIO_BTE_STAT_0)
  56. #define BTEOFF_DEST (IIO_BTE_DEST_0 - IIO_BTE_STAT_0)
  57. #define BTEOFF_CTRL (IIO_BTE_CTRL_0 - IIO_BTE_STAT_0)
  58. #define BTEOFF_NOTIFY (IIO_BTE_NOTIFY_0 - IIO_BTE_STAT_0)
  59. #define BTEOFF_INT (IIO_BTE_INT_0 - IIO_BTE_STAT_0)
  60. /*
  61. * The following definitions use the names defined in the IO interface
  62. * document for ease of reference. When possible, software should
  63. * generally use the longer but clearer names defined above.
  64. */
  65. #define IIO_BASE 0x400000
  66. #define IIO_BASE_BTE0 0x410000
  67. #define IIO_BASE_BTE1 0x420000
  68. #define IIO_BASE_PERF 0x430000
  69. #define IIO_PERF_CNT 0x430008
  70. #define IO_PERF_SETS 32
  71. #define IIO_WID 0x400000 /* Widget identification */
  72. #define IIO_WSTAT 0x400008 /* Widget status */
  73. #define IIO_WCR 0x400020 /* Widget control */
  74. #define IIO_WSTAT_ECRAZY (1ULL << 32) /* Hub gone crazy */
  75. #define IIO_WSTAT_TXRETRY (1ULL << 9) /* Hub Tx Retry timeout */
  76. #define IIO_WSTAT_TXRETRY_MASK (0x7F)
  77. #define IIO_WSTAT_TXRETRY_SHFT (16)
  78. #define IIO_WSTAT_TXRETRY_CNT(w) (((w) >> IIO_WSTAT_TXRETRY_SHFT) & \
  79. IIO_WSTAT_TXRETRY_MASK)
  80. #define IIO_ILAPR 0x400100 /* Local Access Protection */
  81. #define IIO_ILAPO 0x400108 /* Protection override */
  82. #define IIO_IOWA 0x400110 /* outbound widget access */
  83. #define IIO_IIWA 0x400118 /* inbound widget access */
  84. #define IIO_IIDEM 0x400120 /* Inbound Device Error Mask */
  85. #define IIO_ILCSR 0x400128 /* LLP control and status */
  86. #define IIO_ILLR 0x400130 /* LLP Log */
  87. #define IIO_IIDSR 0x400138 /* Interrupt destination */
  88. #define IIO_IIBUSERR 0x1400208 /* Reads here cause a bus error. */
  89. /* IO Interrupt Destination Register */
  90. #define IIO_IIDSR_SENT_SHIFT 28
  91. #define IIO_IIDSR_SENT_MASK 0x10000000
  92. #define IIO_IIDSR_ENB_SHIFT 24
  93. #define IIO_IIDSR_ENB_MASK 0x01000000
  94. #define IIO_IIDSR_NODE_SHIFT 8
  95. #define IIO_IIDSR_NODE_MASK 0x0000ff00
  96. #define IIO_IIDSR_LVL_SHIFT 0
  97. #define IIO_IIDSR_LVL_MASK 0x0000003f
  98. /* GFX Flow Control Node/Widget Register */
  99. #define IIO_IGFX_0 0x400140 /* gfx node/widget register 0 */
  100. #define IIO_IGFX_1 0x400148 /* gfx node/widget register 1 */
  101. #define IIO_IGFX_W_NUM_BITS 4 /* size of widget num field */
  102. #define IIO_IGFX_W_NUM_MASK ((1<<IIO_IGFX_W_NUM_BITS)-1)
  103. #define IIO_IGFX_W_NUM_SHIFT 0
  104. #define IIO_IGFX_N_NUM_BITS 9 /* size of node num field */
  105. #define IIO_IGFX_N_NUM_MASK ((1<<IIO_IGFX_N_NUM_BITS)-1)
  106. #define IIO_IGFX_N_NUM_SHIFT 4
  107. #define IIO_IGFX_P_NUM_BITS 1 /* size of processor num field */
  108. #define IIO_IGFX_P_NUM_MASK ((1<<IIO_IGFX_P_NUM_BITS)-1)
  109. #define IIO_IGFX_P_NUM_SHIFT 16
  110. #define IIO_IGFX_VLD_BITS 1 /* size of valid field */
  111. #define IIO_IGFX_VLD_MASK ((1<<IIO_IGFX_VLD_BITS)-1)
  112. #define IIO_IGFX_VLD_SHIFT 20
  113. #define IIO_IGFX_INIT(widget, node, cpu, valid) (\
  114. (((widget) & IIO_IGFX_W_NUM_MASK) << IIO_IGFX_W_NUM_SHIFT) | \
  115. (((node) & IIO_IGFX_N_NUM_MASK) << IIO_IGFX_N_NUM_SHIFT) | \
  116. (((cpu) & IIO_IGFX_P_NUM_MASK) << IIO_IGFX_P_NUM_SHIFT) | \
  117. (((valid) & IIO_IGFX_VLD_MASK) << IIO_IGFX_VLD_SHIFT) )
  118. /* Scratch registers (not all bits available) */
  119. #define IIO_SCRATCH_REG0 0x400150
  120. #define IIO_SCRATCH_REG1 0x400158
  121. #define IIO_SCRATCH_MASK 0x0000000f00f11fff
  122. #define IIO_SCRATCH_BIT0_0 0x0000000800000000
  123. #define IIO_SCRATCH_BIT0_1 0x0000000400000000
  124. #define IIO_SCRATCH_BIT0_2 0x0000000200000000
  125. #define IIO_SCRATCH_BIT0_3 0x0000000100000000
  126. #define IIO_SCRATCH_BIT0_4 0x0000000000800000
  127. #define IIO_SCRATCH_BIT0_5 0x0000000000400000
  128. #define IIO_SCRATCH_BIT0_6 0x0000000000200000
  129. #define IIO_SCRATCH_BIT0_7 0x0000000000100000
  130. #define IIO_SCRATCH_BIT0_8 0x0000000000010000
  131. #define IIO_SCRATCH_BIT0_9 0x0000000000001000
  132. #define IIO_SCRATCH_BIT0_R 0x0000000000000fff
  133. /* IO Translation Table Entries */
  134. #define IIO_NUM_ITTES 7 /* ITTEs numbered 0..6 */
  135. /* Hw manuals number them 1..7! */
  136. /*
  137. * As a permanent workaround for a bug in the PI side of the hub, we've
  138. * redefined big window 7 as small window 0.
  139. */
  140. #define HUB_NUM_BIG_WINDOW IIO_NUM_ITTES - 1
  141. /*
  142. * Use the top big window as a surrogate for the first small window
  143. */
  144. #define SWIN0_BIGWIN HUB_NUM_BIG_WINDOW
  145. #define ILCSR_WARM_RESET 0x100
  146. /*
  147. * The IO LLP control status register and widget control register
  148. */
  149. #ifndef __ASSEMBLY__
  150. typedef union hubii_wid_u {
  151. u64 wid_reg_value;
  152. struct {
  153. u64 wid_rsvd: 32, /* unused */
  154. wid_rev_num: 4, /* revision number */
  155. wid_part_num: 16, /* the widget type: hub=c101 */
  156. wid_mfg_num: 11, /* Manufacturer id (IBM) */
  157. wid_rsvd1: 1; /* Reserved */
  158. } wid_fields_s;
  159. } hubii_wid_t;
  160. typedef union hubii_wcr_u {
  161. u64 wcr_reg_value;
  162. struct {
  163. u64 wcr_rsvd: 41, /* unused */
  164. wcr_e_thresh: 5, /* elasticity threshold */
  165. wcr_dir_con: 1, /* widget direct connect */
  166. wcr_f_bad_pkt: 1, /* Force bad llp pkt enable */
  167. wcr_xbar_crd: 3, /* LLP crossbar credit */
  168. wcr_rsvd1: 8, /* Reserved */
  169. wcr_tag_mode: 1, /* Tag mode */
  170. wcr_widget_id: 4; /* LLP crossbar credit */
  171. } wcr_fields_s;
  172. } hubii_wcr_t;
  173. #define iwcr_dir_con wcr_fields_s.wcr_dir_con
  174. typedef union hubii_wstat_u {
  175. u64 reg_value;
  176. struct {
  177. u64 rsvd1: 31,
  178. crazy: 1, /* Crazy bit */
  179. rsvd2: 8,
  180. llp_tx_cnt: 8, /* LLP Xmit retry counter */
  181. rsvd3: 6,
  182. tx_max_rtry: 1, /* LLP Retry Timeout Signal */
  183. rsvd4: 2,
  184. xt_tail_to: 1, /* Xtalk Tail Timeout */
  185. xt_crd_to: 1, /* Xtalk Credit Timeout */
  186. pending: 4; /* Pending Requests */
  187. } wstat_fields_s;
  188. } hubii_wstat_t;
  189. typedef union hubii_ilcsr_u {
  190. u64 icsr_reg_value;
  191. struct {
  192. u64 icsr_rsvd: 22, /* unused */
  193. icsr_max_burst: 10, /* max burst */
  194. icsr_rsvd4: 6, /* reserved */
  195. icsr_max_retry: 10, /* max retry */
  196. icsr_rsvd3: 2, /* reserved */
  197. icsr_lnk_stat: 2, /* link status */
  198. icsr_bm8: 1, /* Bit mode 8 */
  199. icsr_llp_en: 1, /* LLP enable bit */
  200. icsr_rsvd2: 1, /* reserver */
  201. icsr_wrm_reset: 1, /* Warm reset bit */
  202. icsr_rsvd1: 2, /* Data ready offset */
  203. icsr_null_to: 6; /* Null timeout */
  204. } icsr_fields_s;
  205. } hubii_ilcsr_t;
  206. typedef union hubii_iowa_u {
  207. u64 iowa_reg_value;
  208. struct {
  209. u64 iowa_rsvd: 48, /* unused */
  210. iowa_wxoac: 8, /* xtalk widget access bits */
  211. iowa_rsvd1: 7, /* xtalk widget access bits */
  212. iowa_w0oac: 1; /* xtalk widget access bits */
  213. } iowa_fields_s;
  214. } hubii_iowa_t;
  215. typedef union hubii_iiwa_u {
  216. u64 iiwa_reg_value;
  217. struct {
  218. u64 iiwa_rsvd: 48, /* unused */
  219. iiwa_wxiac: 8, /* hub wid access bits */
  220. iiwa_rsvd1: 7, /* reserved */
  221. iiwa_w0iac: 1; /* hub wid0 access */
  222. } iiwa_fields_s;
  223. } hubii_iiwa_t;
  224. typedef union hubii_illr_u {
  225. u64 illr_reg_value;
  226. struct {
  227. u64 illr_rsvd: 32, /* unused */
  228. illr_cb_cnt: 16, /* checkbit error count */
  229. illr_sn_cnt: 16; /* sequence number count */
  230. } illr_fields_s;
  231. } hubii_illr_t;
  232. /* The structures below are defined to extract and modify the ii
  233. performance registers */
  234. /* io_perf_sel allows the caller to specify what tests will be
  235. performed */
  236. typedef union io_perf_sel {
  237. u64 perf_sel_reg;
  238. struct {
  239. u64 perf_rsvd : 48,
  240. perf_icct : 8,
  241. perf_ippr1 : 4,
  242. perf_ippr0 : 4;
  243. } perf_sel_bits;
  244. } io_perf_sel_t;
  245. /* io_perf_cnt is to extract the count from the hub registers. Due to
  246. hardware problems there is only one counter, not two. */
  247. typedef union io_perf_cnt {
  248. u64 perf_cnt;
  249. struct {
  250. u64 perf_rsvd1 : 32,
  251. perf_rsvd2 : 12,
  252. perf_cnt : 20;
  253. } perf_cnt_bits;
  254. } io_perf_cnt_t;
  255. #endif /* !__ASSEMBLY__ */
  256. #define LNK_STAT_WORKING 0x2
  257. #define IIO_LLP_CB_MAX 0xffff
  258. #define IIO_LLP_SN_MAX 0xffff
  259. /* IO PRB Entries */
  260. #define IIO_NUM_IPRBS (9)
  261. #define IIO_IOPRB_0 0x400198 /* PRB entry 0 */
  262. #define IIO_IOPRB_8 0x4001a0 /* PRB entry 8 */
  263. #define IIO_IOPRB_9 0x4001a8 /* PRB entry 9 */
  264. #define IIO_IOPRB_A 0x4001b0 /* PRB entry a */
  265. #define IIO_IOPRB_B 0x4001b8 /* PRB entry b */
  266. #define IIO_IOPRB_C 0x4001c0 /* PRB entry c */
  267. #define IIO_IOPRB_D 0x4001c8 /* PRB entry d */
  268. #define IIO_IOPRB_E 0x4001d0 /* PRB entry e */
  269. #define IIO_IOPRB_F 0x4001d8 /* PRB entry f */
  270. #define IIO_IXCC 0x4001e0 /* Crosstalk credit count timeout */
  271. #define IIO_IXTCC IIO_IXCC
  272. #define IIO_IMEM 0x4001e8 /* Miscellaneous Enable Mask */
  273. #define IIO_IXTT 0x4001f0 /* Crosstalk tail timeout */
  274. #define IIO_IECLR 0x4001f8 /* IO error clear */
  275. #define IIO_IBCN 0x400200 /* IO BTE CRB count */
  276. /*
  277. * IIO_IMEM Register fields.
  278. */
  279. #define IIO_IMEM_W0ESD 0x1 /* Widget 0 shut down due to error */
  280. #define IIO_IMEM_B0ESD (1 << 4) /* BTE 0 shut down due to error */
  281. #define IIO_IMEM_B1ESD (1 << 8) /* BTE 1 Shut down due to error */
  282. /* PIO Read address Table Entries */
  283. #define IIO_IPCA 0x400300 /* PRB Counter adjust */
  284. #define IIO_NUM_PRTES 8 /* Total number of PRB table entries */
  285. #define IIO_PRTE_0 0x400308 /* PIO Read address table entry 0 */
  286. #define IIO_PRTE(_x) (IIO_PRTE_0 + (8 * (_x)))
  287. #define IIO_WIDPRTE(x) IIO_PRTE(((x) - 8)) /* widget ID to its PRTE num */
  288. #define IIO_IPDR 0x400388 /* PIO table entry deallocation */
  289. #define IIO_ICDR 0x400390 /* CRB Entry Deallocation */
  290. #define IIO_IFDR 0x400398 /* IOQ FIFO Depth */
  291. #define IIO_IIAP 0x4003a0 /* IIQ Arbitration Parameters */
  292. #define IIO_IMMR IIO_IIAP
  293. #define IIO_ICMR 0x4003a8 /* CRB Managment Register */
  294. #define IIO_ICCR 0x4003b0 /* CRB Control Register */
  295. #define IIO_ICTO 0x4003b8 /* CRB Time Out Register */
  296. #define IIO_ICTP 0x4003c0 /* CRB Time Out Prescalar */
  297. /*
  298. * ICMR register fields
  299. */
  300. #define IIO_ICMR_PC_VLD_SHFT 36
  301. #define IIO_ICMR_PC_VLD_MASK (0x7fffUL << IIO_ICMR_PC_VLD_SHFT)
  302. #define IIO_ICMR_CRB_VLD_SHFT 20
  303. #define IIO_ICMR_CRB_VLD_MASK (0x7fffUL << IIO_ICMR_CRB_VLD_SHFT)
  304. #define IIO_ICMR_FC_CNT_SHFT 16
  305. #define IIO_ICMR_FC_CNT_MASK (0xf << IIO_ICMR_FC_CNT_SHFT)
  306. #define IIO_ICMR_C_CNT_SHFT 4
  307. #define IIO_ICMR_C_CNT_MASK (0xf << IIO_ICMR_C_CNT_SHFT)
  308. #define IIO_ICMR_P_CNT_SHFT 0
  309. #define IIO_ICMR_P_CNT_MASK (0xf << IIO_ICMR_P_CNT_SHFT)
  310. #define IIO_ICMR_PRECISE (1UL << 52)
  311. #define IIO_ICMR_CLR_RPPD (1UL << 13)
  312. #define IIO_ICMR_CLR_RQPD (1UL << 12)
  313. /*
  314. * IIO PIO Deallocation register field masks : (IIO_IPDR)
  315. */
  316. #define IIO_IPDR_PND (1 << 4)
  317. /*
  318. * IIO CRB deallocation register field masks: (IIO_ICDR)
  319. */
  320. #define IIO_ICDR_PND (1 << 4)
  321. /*
  322. * IIO CRB control register Fields: IIO_ICCR
  323. */
  324. #define IIO_ICCR_PENDING (0x10000)
  325. #define IIO_ICCR_CMD_MASK (0xFF)
  326. #define IIO_ICCR_CMD_SHFT (7)
  327. #define IIO_ICCR_CMD_NOP (0x0) /* No Op */
  328. #define IIO_ICCR_CMD_WAKE (0x100) /* Reactivate CRB entry and process */
  329. #define IIO_ICCR_CMD_TIMEOUT (0x200) /* Make CRB timeout & mark invalid */
  330. #define IIO_ICCR_CMD_EJECT (0x400) /* Contents of entry written to memory
  331. * via a WB
  332. */
  333. #define IIO_ICCR_CMD_FLUSH (0x800)
  334. /*
  335. * CRB manipulation macros
  336. * The CRB macros are slightly complicated, since there are up to
  337. * four registers associated with each CRB entry.
  338. */
  339. #define IIO_NUM_CRBS 15 /* Number of CRBs */
  340. #define IIO_NUM_NORMAL_CRBS 12 /* Number of regular CRB entries */
  341. #define IIO_NUM_PC_CRBS 4 /* Number of partial cache CRBs */
  342. #define IIO_ICRB_OFFSET 8
  343. #define IIO_ICRB_0 0x400400
  344. /* XXX - This is now tuneable:
  345. #define IIO_FIRST_PC_ENTRY 12
  346. */
  347. #define IIO_ICRB_A(_x) (IIO_ICRB_0 + (4 * IIO_ICRB_OFFSET * (_x)))
  348. #define IIO_ICRB_B(_x) (IIO_ICRB_A(_x) + 1*IIO_ICRB_OFFSET)
  349. #define IIO_ICRB_C(_x) (IIO_ICRB_A(_x) + 2*IIO_ICRB_OFFSET)
  350. #define IIO_ICRB_D(_x) (IIO_ICRB_A(_x) + 3*IIO_ICRB_OFFSET)
  351. /* XXX - IBUE register coming for Hub 2 */
  352. /*
  353. *
  354. * CRB Register description.
  355. *
  356. * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING
  357. * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING
  358. * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING
  359. * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING
  360. * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING
  361. *
  362. * Many of the fields in CRB are status bits used by hardware
  363. * for implementation of the protocol. It's very dangerous to
  364. * mess around with the CRB registers.
  365. *
  366. * It's OK to read the CRB registers and try to make sense out of the
  367. * fields in CRB.
  368. *
  369. * Updating CRB requires all activities in Hub IIO to be quiesced.
  370. * otherwise, a write to CRB could corrupt other CRB entries.
  371. * CRBs are here only as a back door peek to hub IIO's status.
  372. * Quiescing implies no dmas no PIOs
  373. * either directly from the cpu or from sn0net.
  374. * this is not something that can be done easily. So, AVOID updating
  375. * CRBs.
  376. */
  377. /*
  378. * Fields in CRB Register A
  379. */
  380. #ifndef __ASSEMBLY__
  381. typedef union icrba_u {
  382. u64 reg_value;
  383. struct {
  384. u64 resvd: 6,
  385. stall_bte0: 1, /* Stall BTE 0 */
  386. stall_bte1: 1, /* Stall BTE 1 */
  387. error: 1, /* CRB has an error */
  388. ecode: 3, /* Error Code */
  389. lnetuce: 1, /* SN0net Uncorrectable error */
  390. mark: 1, /* CRB Has been marked */
  391. xerr: 1, /* Error bit set in xtalk header */
  392. sidn: 4, /* SIDN field from xtalk */
  393. tnum: 5, /* TNUM field in xtalk */
  394. addr: 38, /* Address of request */
  395. valid: 1, /* Valid status */
  396. iow: 1; /* IO Write operation */
  397. } icrba_fields_s;
  398. } icrba_t;
  399. /* This is an alternate typedef for the HUB1 CRB A in order to allow
  400. runtime selection of the format based on the REV_ID field of the
  401. NI_STATUS_REV_ID register. */
  402. typedef union h1_icrba_u {
  403. u64 reg_value;
  404. struct {
  405. u64 resvd: 6,
  406. unused: 1, /* Unused but RW!! */
  407. error: 1, /* CRB has an error */
  408. ecode: 4, /* Error Code */
  409. lnetuce: 1, /* SN0net Uncorrectable error */
  410. mark: 1, /* CRB Has been marked */
  411. xerr: 1, /* Error bit set in xtalk header */
  412. sidn: 4, /* SIDN field from xtalk */
  413. tnum: 5, /* TNUM field in xtalk */
  414. addr: 38, /* Address of request */
  415. valid: 1, /* Valid status */
  416. iow: 1; /* IO Write operation */
  417. } h1_icrba_fields_s;
  418. } h1_icrba_t;
  419. /* XXX - Is this still right? Check the spec. */
  420. #define ICRBN_A_CERR_SHFT 54
  421. #define ICRBN_A_ERR_MASK 0x3ff
  422. #if 0 /* Disabled, this causes namespace polution and break allmodconfig */
  423. /*
  424. * Easy access macros.
  425. */
  426. #define a_error icrba_fields_s.error
  427. #define a_ecode icrba_fields_s.ecode
  428. #define a_lnetuce icrba_fields_s.lnetuce
  429. #define a_mark icrba_fields_s.mark
  430. #define a_xerr icrba_fields_s.xerr
  431. #define a_sidn icrba_fields_s.sidn
  432. #define a_tnum icrba_fields_s.tnum
  433. #define a_addr icrba_fields_s.addr
  434. #define a_valid icrba_fields_s.valid
  435. #define a_iow icrba_fields_s.iow
  436. #endif
  437. #endif /* !__ASSEMBLY__ */
  438. #define IIO_ICRB_ADDR_SHFT 2 /* Shift to get proper address */
  439. /*
  440. * values for "ecode" field
  441. */
  442. #define IIO_ICRB_ECODE_DERR 0 /* Directory error due to IIO access */
  443. #define IIO_ICRB_ECODE_PERR 1 /* Poison error on IO access */
  444. #define IIO_ICRB_ECODE_WERR 2 /* Write error by IIO access
  445. * e.g. WINV to a Read only line.
  446. */
  447. #define IIO_ICRB_ECODE_AERR 3 /* Access error caused by IIO access */
  448. #define IIO_ICRB_ECODE_PWERR 4 /* Error on partial write */
  449. #define IIO_ICRB_ECODE_PRERR 5 /* Error on partial read */
  450. #define IIO_ICRB_ECODE_TOUT 6 /* CRB timeout before deallocating */
  451. #define IIO_ICRB_ECODE_XTERR 7 /* Incoming xtalk pkt had error bit */
  452. /*
  453. * Fields in CRB Register B
  454. */
  455. #ifndef __ASSEMBLY__
  456. typedef union icrbb_u {
  457. u64 reg_value;
  458. struct {
  459. u64 rsvd1: 5,
  460. btenum: 1, /* BTE to which entry belongs to */
  461. cohtrans: 1, /* Coherent transaction */
  462. xtsize: 2, /* Xtalk operation size
  463. * 0: Double Word
  464. * 1: 32 Bytes.
  465. * 2: 128 Bytes,
  466. * 3: Reserved.
  467. */
  468. srcnode: 9, /* Source Node ID */
  469. srcinit: 2, /* Source Initiator:
  470. * See below for field values.
  471. */
  472. useold: 1, /* Use OLD command for processing */
  473. imsgtype: 2, /* Incoming message type
  474. * see below for field values
  475. */
  476. imsg: 8, /* Incoming message */
  477. initator: 3, /* Initiator of original request
  478. * See below for field values.
  479. */
  480. reqtype: 5, /* Identifies type of request
  481. * See below for field values.
  482. */
  483. rsvd2: 7,
  484. ackcnt: 11, /* Invalidate ack count */
  485. resp: 1, /* data response given to processor */
  486. ack: 1, /* indicates data ack received */
  487. hold: 1, /* entry is gathering inval acks */
  488. wb_pend:1, /* waiting for writeback to complete */
  489. intvn: 1, /* Intervention */
  490. stall_ib: 1, /* Stall Ibuf (from crosstalk) */
  491. stall_intr: 1; /* Stall internal interrupts */
  492. } icrbb_field_s;
  493. } icrbb_t;
  494. /* This is an alternate typedef for the HUB1 CRB B in order to allow
  495. runtime selection of the format based on the REV_ID field of the
  496. NI_STATUS_REV_ID register. */
  497. typedef union h1_icrbb_u {
  498. u64 reg_value;
  499. struct {
  500. u64 rsvd1: 5,
  501. btenum: 1, /* BTE to which entry belongs to */
  502. cohtrans: 1, /* Coherent transaction */
  503. xtsize: 2, /* Xtalk operation size
  504. * 0: Double Word
  505. * 1: 32 Bytes.
  506. * 2: 128 Bytes,
  507. * 3: Reserved.
  508. */
  509. srcnode: 9, /* Source Node ID */
  510. srcinit: 2, /* Source Initiator:
  511. * See below for field values.
  512. */
  513. useold: 1, /* Use OLD command for processing */
  514. imsgtype: 2, /* Incoming message type
  515. * see below for field values
  516. */
  517. imsg: 8, /* Incoming message */
  518. initator: 3, /* Initiator of original request
  519. * See below for field values.
  520. */
  521. rsvd2: 1,
  522. pcache: 1, /* entry belongs to partial cache */
  523. reqtype: 5, /* Identifies type of request
  524. * See below for field values.
  525. */
  526. stl_ib: 1, /* stall Ibus coming from xtalk */
  527. stl_intr: 1, /* Stall internal interrupts */
  528. stl_bte0: 1, /* Stall BTE 0 */
  529. stl_bte1: 1, /* Stall BTE 1 */
  530. intrvn: 1, /* Req was target of intervention */
  531. ackcnt: 11, /* Invalidate ack count */
  532. resp: 1, /* data response given to processor */
  533. ack: 1, /* indicates data ack received */
  534. hold: 1, /* entry is gathering inval acks */
  535. wb_pend:1, /* waiting for writeback to complete */
  536. sleep: 1, /* xtalk req sleeping till IO-sync */
  537. pnd_reply: 1, /* replies not issed due to IOQ full */
  538. pnd_req: 1; /* reqs not issued due to IOQ full */
  539. } h1_icrbb_field_s;
  540. } h1_icrbb_t;
  541. #define b_imsgtype icrbb_field_s.imsgtype
  542. #define b_btenum icrbb_field_s.btenum
  543. #define b_cohtrans icrbb_field_s.cohtrans
  544. #define b_xtsize icrbb_field_s.xtsize
  545. #define b_srcnode icrbb_field_s.srcnode
  546. #define b_srcinit icrbb_field_s.srcinit
  547. #define b_imsgtype icrbb_field_s.imsgtype
  548. #define b_imsg icrbb_field_s.imsg
  549. #define b_initiator icrbb_field_s.initiator
  550. #endif /* !__ASSEMBLY__ */
  551. /*
  552. * values for field xtsize
  553. */
  554. #define IIO_ICRB_XTSIZE_DW 0 /* Xtalk operation size is 8 bytes */
  555. #define IIO_ICRB_XTSIZE_32 1 /* Xtalk operation size is 32 bytes */
  556. #define IIO_ICRB_XTSIZE_128 2 /* Xtalk operation size is 128 bytes */
  557. /*
  558. * values for field srcinit
  559. */
  560. #define IIO_ICRB_PROC0 0 /* Source of request is Proc 0 */
  561. #define IIO_ICRB_PROC1 1 /* Source of request is Proc 1 */
  562. #define IIO_ICRB_GB_REQ 2 /* Source is Guranteed BW request */
  563. #define IIO_ICRB_IO_REQ 3 /* Source is Normal IO request */
  564. /*
  565. * Values for field imsgtype
  566. */
  567. #define IIO_ICRB_IMSGT_XTALK 0 /* Incoming Meessage from Xtalk */
  568. #define IIO_ICRB_IMSGT_BTE 1 /* Incoming message from BTE */
  569. #define IIO_ICRB_IMSGT_SN0NET 2 /* Incoming message from SN0 net */
  570. #define IIO_ICRB_IMSGT_CRB 3 /* Incoming message from CRB ??? */
  571. /*
  572. * values for field initiator.
  573. */
  574. #define IIO_ICRB_INIT_XTALK 0 /* Message originated in xtalk */
  575. #define IIO_ICRB_INIT_BTE0 0x1 /* Message originated in BTE 0 */
  576. #define IIO_ICRB_INIT_SN0NET 0x2 /* Message originated in SN0net */
  577. #define IIO_ICRB_INIT_CRB 0x3 /* Message originated in CRB ? */
  578. #define IIO_ICRB_INIT_BTE1 0x5 /* MEssage originated in BTE 1 */
  579. /*
  580. * Values for field reqtype.
  581. */
  582. /* XXX - Need to fix this for Hub 2 */
  583. #define IIO_ICRB_REQ_DWRD 0 /* Request type double word */
  584. #define IIO_ICRB_REQ_QCLRD 1 /* Request is Qrtr Caceh line Rd */
  585. #define IIO_ICRB_REQ_BLKRD 2 /* Request is block read */
  586. #define IIO_ICRB_REQ_RSHU 6 /* Request is BTE block read */
  587. #define IIO_ICRB_REQ_REXU 7 /* request is BTE Excl Read */
  588. #define IIO_ICRB_REQ_RDEX 8 /* Request is Read Exclusive */
  589. #define IIO_ICRB_REQ_WINC 9 /* Request is Write Invalidate */
  590. #define IIO_ICRB_REQ_BWINV 10 /* Request is BTE Winv */
  591. #define IIO_ICRB_REQ_PIORD 11 /* Request is PIO read */
  592. #define IIO_ICRB_REQ_PIOWR 12 /* Request is PIO Write */
  593. #define IIO_ICRB_REQ_PRDM 13 /* Request is Fetch&Op */
  594. #define IIO_ICRB_REQ_PWRM 14 /* Request is Store &Op */
  595. #define IIO_ICRB_REQ_PTPWR 15 /* Request is Peer to peer */
  596. #define IIO_ICRB_REQ_WB 16 /* Request is Write back */
  597. #define IIO_ICRB_REQ_DEX 17 /* Retained DEX Cache line */
  598. /*
  599. * Fields in CRB Register C
  600. */
  601. #ifndef __ASSEMBLY__
  602. typedef union icrbc_s {
  603. u64 reg_value;
  604. struct {
  605. u64 rsvd: 6,
  606. sleep: 1,
  607. pricnt: 4, /* Priority count sent with Read req */
  608. pripsc: 4, /* Priority Pre scalar */
  609. bteop: 1, /* BTE Operation */
  610. push_be: 34, /* Push address Byte enable
  611. * Holds push addr, if CRB is for BTE
  612. * If CRB belongs to Partial cache,
  613. * this contains byte enables bits
  614. * ([47:46] = 0)
  615. */
  616. suppl: 11, /* Supplemental field */
  617. barrop: 1, /* Barrier Op bit set in xtalk req */
  618. doresp: 1, /* Xtalk req needs a response */
  619. gbr: 1; /* GBR bit set in xtalk packet */
  620. } icrbc_field_s;
  621. } icrbc_t;
  622. #define c_pricnt icrbc_field_s.pricnt
  623. #define c_pripsc icrbc_field_s.pripsc
  624. #define c_bteop icrbc_field_s.bteop
  625. #define c_bteaddr icrbc_field_s.push_be /* push_be field has 2 names */
  626. #define c_benable icrbc_field_s.push_be /* push_be field has 2 names */
  627. #define c_suppl icrbc_field_s.suppl
  628. #define c_barrop icrbc_field_s.barrop
  629. #define c_doresp icrbc_field_s.doresp
  630. #define c_gbr icrbc_field_s.gbr
  631. #endif /* !__ASSEMBLY__ */
  632. /*
  633. * Fields in CRB Register D
  634. */
  635. #ifndef __ASSEMBLY__
  636. typedef union icrbd_s {
  637. u64 reg_value;
  638. struct {
  639. u64 rsvd: 38,
  640. toutvld: 1, /* Timeout in progress for this CRB */
  641. ctxtvld: 1, /* Context field below is valid */
  642. rsvd2: 1,
  643. context: 15, /* Bit vector:
  644. * Has a bit set for each CRB entry
  645. * which needs to be deallocated
  646. * before this CRB entry is processed.
  647. * Set only for barrier operations.
  648. */
  649. timeout: 8; /* Timeout Upper 8 bits */
  650. } icrbd_field_s;
  651. } icrbd_t;
  652. #define icrbd_toutvld icrbd_field_s.toutvld
  653. #define icrbd_ctxtvld icrbd_field_s.ctxtvld
  654. #define icrbd_context icrbd_field_s.context
  655. typedef union hubii_ifdr_u {
  656. u64 hi_ifdr_value;
  657. struct {
  658. u64 ifdr_rsvd: 49,
  659. ifdr_maxrp: 7,
  660. ifdr_rsvd1: 1,
  661. ifdr_maxrq: 7;
  662. } hi_ifdr_fields;
  663. } hubii_ifdr_t;
  664. #endif /* !__ASSEMBLY__ */
  665. /*
  666. * Hardware designed names for the BTE control registers.
  667. */
  668. #define IIO_IBLS_0 0x410000 /* BTE length/status 0 */
  669. #define IIO_IBSA_0 0x410008 /* BTE source address 0 */
  670. #define IIO_IBDA_0 0x410010 /* BTE destination address 0 */
  671. #define IIO_IBCT_0 0x410018 /* BTE control/terminate 0 */
  672. #define IIO_IBNA_0 0x410020 /* BTE notification address 0 */
  673. #define IIO_IBNR_0 IIO_IBNA_0
  674. #define IIO_IBIA_0 0x410028 /* BTE interrupt address 0 */
  675. #define IIO_IBLS_1 0x420000 /* BTE length/status 1 */
  676. #define IIO_IBSA_1 0x420008 /* BTE source address 1 */
  677. #define IIO_IBDA_1 0x420010 /* BTE destination address 1 */
  678. #define IIO_IBCT_1 0x420018 /* BTE control/terminate 1 */
  679. #define IIO_IBNA_1 0x420020 /* BTE notification address 1 */
  680. #define IIO_IBNR_1 IIO_IBNA_1
  681. #define IIO_IBIA_1 0x420028 /* BTE interrupt address 1 */
  682. /*
  683. * More miscellaneous registers
  684. */
  685. #define IIO_IPCR 0x430000 /* Performance Control */
  686. #define IIO_IPPR 0x430008 /* Performance Profiling */
  687. /*
  688. * IO Error Clear register bit field definitions
  689. */
  690. #define IECLR_BTE1 (1 << 18) /* clear bte error 1 ??? */
  691. #define IECLR_BTE0 (1 << 17) /* clear bte error 0 ??? */
  692. #define IECLR_CRAZY (1 << 16) /* clear crazy bit in wstat reg */
  693. #define IECLR_PRB_F (1 << 15) /* clear err bit in PRB_F reg */
  694. #define IECLR_PRB_E (1 << 14) /* clear err bit in PRB_E reg */
  695. #define IECLR_PRB_D (1 << 13) /* clear err bit in PRB_D reg */
  696. #define IECLR_PRB_C (1 << 12) /* clear err bit in PRB_C reg */
  697. #define IECLR_PRB_B (1 << 11) /* clear err bit in PRB_B reg */
  698. #define IECLR_PRB_A (1 << 10) /* clear err bit in PRB_A reg */
  699. #define IECLR_PRB_9 (1 << 9) /* clear err bit in PRB_9 reg */
  700. #define IECLR_PRB_8 (1 << 8) /* clear err bit in PRB_8 reg */
  701. #define IECLR_PRB_0 (1 << 0) /* clear err bit in PRB_0 reg */
  702. /*
  703. * IO PIO Read Table Entry format
  704. */
  705. #ifndef __ASSEMBLY__
  706. typedef union iprte_a {
  707. u64 entry;
  708. struct {
  709. u64 rsvd1 : 7, /* Reserved field */
  710. valid : 1, /* Maps to a timeout entry */
  711. rsvd2 : 1,
  712. srcnode : 9, /* Node which did this PIO */
  713. initiator : 2, /* If T5A or T5B or IO */
  714. rsvd3 : 3,
  715. addr : 38, /* Physical address of PIO */
  716. rsvd4 : 3;
  717. } iprte_fields;
  718. } iprte_a_t;
  719. #define iprte_valid iprte_fields.valid
  720. #define iprte_timeout iprte_fields.timeout
  721. #define iprte_srcnode iprte_fields.srcnode
  722. #define iprte_init iprte_fields.initiator
  723. #define iprte_addr iprte_fields.addr
  724. #endif /* !__ASSEMBLY__ */
  725. #define IPRTE_ADDRSHFT 3
  726. /*
  727. * Hub IIO PRB Register format.
  728. */
  729. #ifndef __ASSEMBLY__
  730. /*
  731. * Note: Fields bnakctr, anakctr, xtalkctrmode, ovflow fields are
  732. * "Status" fields, and should only be used in case of clean up after errors.
  733. */
  734. typedef union iprb_u {
  735. u64 reg_value;
  736. struct {
  737. u64 rsvd1: 15,
  738. error: 1, /* Widget rcvd wr resp pkt w/ error */
  739. ovflow: 5, /* Over flow count. perf measurement */
  740. fire_and_forget: 1, /* Launch Write without response */
  741. mode: 2, /* Widget operation Mode */
  742. rsvd2: 2,
  743. bnakctr: 14,
  744. rsvd3: 2,
  745. anakctr: 14,
  746. xtalkctr: 8;
  747. } iprb_fields_s;
  748. } iprb_t;
  749. #define iprb_regval reg_value
  750. #define iprb_error iprb_fields_s.error
  751. #define iprb_ovflow iprb_fields_s.ovflow
  752. #define iprb_ff iprb_fields_s.fire_and_forget
  753. #define iprb_mode iprb_fields_s.mode
  754. #define iprb_bnakctr iprb_fields_s.bnakctr
  755. #define iprb_anakctr iprb_fields_s.anakctr
  756. #define iprb_xtalkctr iprb_fields_s.xtalkctr
  757. #endif /* !__ASSEMBLY__ */
  758. /*
  759. * values for mode field in iprb_t.
  760. * For details of the meanings of NAK and Accept, refer the PIO flow
  761. * document
  762. */
  763. #define IPRB_MODE_NORMAL (0)
  764. #define IPRB_MODE_COLLECT_A (1) /* PRB in collect A mode */
  765. #define IPRB_MODE_SERVICE_A (2) /* NAK B and Accept A */
  766. #define IPRB_MODE_SERVICE_B (3) /* NAK A and Accept B */
  767. /*
  768. * IO CRB entry C_A to E_A : Partial (cache) CRBS
  769. */
  770. #ifndef __ASSEMBLY__
  771. typedef union icrbp_a {
  772. u64 ip_reg; /* the entire register value */
  773. struct {
  774. u64 error: 1, /* 63, error occurred */
  775. ln_uce: 1, /* 62: uncorrectable memory */
  776. ln_ae: 1, /* 61: protection violation */
  777. ln_werr:1, /* 60: write access error */
  778. ln_aerr:1, /* 59: sn0net: Address error */
  779. ln_perr:1, /* 58: sn0net: poison error */
  780. timeout:1, /* 57: CRB timed out */
  781. l_bdpkt:1, /* 56: truncated pkt on sn0net */
  782. c_bdpkt:1, /* 55: truncated pkt on xtalk */
  783. c_err: 1, /* 54: incoming xtalk req, err set*/
  784. rsvd1: 12, /* 53-42: reserved */
  785. valid: 1, /* 41: Valid status */
  786. sidn: 4, /* 40-37: SIDN field of xtalk rqst */
  787. tnum: 5, /* 36-32: TNUM of xtalk request */
  788. bo: 1, /* 31: barrier op set in xtalk rqst*/
  789. resprqd:1, /* 30: xtalk rqst requires response*/
  790. gbr: 1, /* 29: gbr bit set in xtalk rqst */
  791. size: 2, /* 28-27: size of xtalk request */
  792. excl: 4, /* 26-23: exclusive bit(s) */
  793. stall: 3, /* 22-20: stall (xtalk, bte 0/1) */
  794. intvn: 1, /* 19: rqst target of intervention*/
  795. resp: 1, /* 18: Data response given to t5 */
  796. ack: 1, /* 17: Data ack received. */
  797. hold: 1, /* 16: crb gathering invalidate acks*/
  798. wb: 1, /* 15: writeback pending. */
  799. ack_cnt:11, /* 14-04: counter of invalidate acks*/
  800. tscaler:4; /* 03-00: Timeout prescaler */
  801. } ip_fmt;
  802. } icrbp_a_t;
  803. #endif /* !__ASSEMBLY__ */
  804. /*
  805. * A couple of defines to go with the above structure.
  806. */
  807. #define ICRBP_A_CERR_SHFT 54
  808. #define ICRBP_A_ERR_MASK 0x3ff
  809. #ifndef __ASSEMBLY__
  810. typedef union hubii_idsr {
  811. u64 iin_reg;
  812. struct {
  813. u64 rsvd1 : 35,
  814. isent : 1,
  815. rsvd2 : 3,
  816. ienable: 1,
  817. rsvd : 7,
  818. node : 9,
  819. rsvd4 : 1,
  820. level : 7;
  821. } iin_fmt;
  822. } hubii_idsr_t;
  823. #endif /* !__ASSEMBLY__ */
  824. /*
  825. * IO BTE Length/Status (IIO_IBLS) register bit field definitions
  826. */
  827. #define IBLS_BUSY (0x1 << 20)
  828. #define IBLS_ERROR_SHFT 16
  829. #define IBLS_ERROR (0x1 << IBLS_ERROR_SHFT)
  830. #define IBLS_LENGTH_MASK 0xffff
  831. /*
  832. * IO BTE Control/Terminate register (IBCT) register bit field definitions
  833. */
  834. #define IBCT_POISON (0x1 << 8)
  835. #define IBCT_NOTIFY (0x1 << 4)
  836. #define IBCT_ZFIL_MODE (0x1 << 0)
  837. /*
  838. * IO BTE Interrupt Address Register (IBIA) register bit field definitions
  839. */
  840. #define IBIA_LEVEL_SHFT 16
  841. #define IBIA_LEVEL_MASK (0x7f << IBIA_LEVEL_SHFT)
  842. #define IBIA_NODE_ID_SHFT 0
  843. #define IBIA_NODE_ID_MASK (0x1ff)
  844. /*
  845. * Miscellaneous hub constants
  846. */
  847. /* Number of widgets supported by hub */
  848. #define HUB_NUM_WIDGET 9
  849. #define HUB_WIDGET_ID_MIN 0x8
  850. #define HUB_WIDGET_ID_MAX 0xf
  851. #define HUB_WIDGET_PART_NUM 0xc101
  852. #define MAX_HUBS_PER_XBOW 2
  853. /*
  854. * Get a hub's widget id from widget control register
  855. */
  856. #define IIO_WCR_WID_GET(nasid) (REMOTE_HUB_L(nasid, III_WCR) & 0xf)
  857. #define IIO_WST_ERROR_MASK (UINT64_CAST 1 << 32) /* Widget status error */
  858. /*
  859. * Number of credits Hub widget has while sending req/response to
  860. * xbow.
  861. * Value of 3 is required by Xbow 1.1
  862. * We may be able to increase this to 4 with Xbow 1.2.
  863. */
  864. #define HUBII_XBOW_CREDIT 3
  865. #define HUBII_XBOW_REV2_CREDIT 4
  866. #endif /* _ASM_SGI_SN_SN0_HUBIO_H */