hubpi_next.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:12k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /* $Id$
  2.  *
  3.  * This file is subject to the terms and conditions of the GNU General Public
  4.  * License.  See the file "COPYING" in the main directory of this archive
  5.  * for more details.
  6.  *
  7.  * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved.
  8.  */
  9. #ifndef _ASM_IA64_SN_SN1_HUBPI_NEXT_H
  10. #define _ASM_IA64_SN_SN1_HUBPI_NEXT_H
  11. /* define for remote PI_1 space. It is always half of a node_addressspace
  12.  * from PI_0. The normal REMOTE_HUB space for PI registers access
  13.  * the PI_0 space, unless they are qualified by PI_1.
  14.  */
  15. #define PI_0(x) (x)
  16. #define PI_1(x) ((x) + 0x200000)
  17. #define PIREG(x,sn) ((sn) ? PI_1(x) : PI_0(x))
  18. #define PI_MIN_STACK_SIZE 4096  /* For figuring out the size to set */
  19. #define PI_STACK_SIZE_SHFT      12      /* 4k */
  20. #define PI_STACKADDR_OFFSET     (PI_ERR_STACK_ADDR_B - PI_ERR_STACK_ADDR_A)
  21. #define PI_ERRSTAT_OFFSET       (PI_ERR_STATUS0_B - PI_ERR_STATUS0_A)
  22. #define PI_RDCLR_OFFSET         (PI_ERR_STATUS0_A_RCLR - PI_ERR_STATUS0_A)
  23. /* these macros are correct, but fix their users to understand two PIs
  24.    and 4 CPUs (slices) per bedrock */
  25. #define PI_INT_MASK_OFFSET      (PI_INT_MASK0_B - PI_INT_MASK0_A)
  26. #define PI_INT_SET_OFFSET       (PI_CC_PEND_CLR_B - PI_CC_PEND_CLR_A)
  27. #define PI_NMI_OFFSET (PI_NMI_B - PI_NMI_A)
  28. #define ERR_STACK_SIZE_BYTES(_sz) 
  29.        ((_sz) ? (PI_MIN_STACK_SIZE << ((_sz) - 1)) : 0)
  30. #define PI_CRB_STS_P (1 << 9)  /* "P" (partial word read/write) bit */
  31. #define PI_CRB_STS_V (1 << 8) /* "V" (valid) bit */
  32. #define PI_CRB_STS_R (1 << 7) /* "R" (response data sent to CPU) */
  33. #define PI_CRB_STS_A (1 << 6) /* "A" (data ack. received) bit */
  34. #define PI_CRB_STS_W (1 << 5) /* "W" (waiting for write compl.) */
  35. #define PI_CRB_STS_H (1 << 4) /* "H" (gathering invalidates) bit */
  36. #define PI_CRB_STS_I (1 << 3) /* "I" (targ. inbound invalidate) */
  37. #define PI_CRB_STS_T (1 << 2) /* "T" (targ. inbound intervention) */
  38. #define PI_CRB_STS_E (0x3) /* "E" (coherent read type) */
  39. /* When the "P" bit is set in the sk_crb_sts field of an error stack
  40.  * entry, the "R," "A," "H," and "I" bits are actually bits 6..3 of
  41.  * the address.  This macro extracts those address bits and shifts
  42.  * them to their proper positions, ready to be ORed in to the rest of
  43.  * the address (which is calculated as sk_addr << 7).
  44.  */
  45. #define PI_CRB_STS_ADDR_BITS(sts) 
  46.     ((sts) & (PI_CRB_STS_I | PI_CRB_STS_H) | 
  47.      ((sts) & (PI_CRB_STS_A | PI_CRB_STS_R)) >> 1)
  48. #ifndef __ASSEMBLY__
  49. /*
  50.  * format of error stack and error status registers.
  51.  */
  52. #ifdef LITTLE_ENDIAN
  53. struct err_stack_format {
  54.         uint64_t      sk_err_type:  3,   /* error type        */
  55.                         sk_suppl   :  3,   /* lowest 3 bit of supplemental */
  56.                         sk_t5_req  :  3,   /* RRB T5 request number */
  57.                         sk_crb_num :  3,   /* WRB (0 to 7) or RRB (0 to 4) */
  58.                         sk_rw_rb   :  1,   /* RRB == 0, WRB == 1 */
  59.                         sk_crb_sts : 10,   /* status from RRB or WRB */
  60.                         sk_cmd     :  8,   /* message command */
  61. sk_addr    : 33;   /* address */
  62. };
  63. #else
  64. struct err_stack_format {
  65. uint64_t sk_addr    : 33,   /* address */
  66. sk_cmd    :  8,   /* message command */
  67. sk_crb_sts : 10,   /* status from RRB or WRB */
  68. sk_rw_rb   :  1,   /* RRB == 0, WRB == 1 */
  69. sk_crb_num :  3,   /* WRB (0 to 7) or RRB (0 to 4) */
  70. sk_t5_req  :  3,   /* RRB T5 request number */
  71. sk_suppl   :  3,   /* lowest 3 bit of supplemental */
  72. sk_err_type:  3;   /* error type */
  73. };
  74. #endif
  75. typedef union pi_err_stack {
  76.         uint64_t      pi_stk_word;
  77.         struct  err_stack_format pi_stk_fmt;
  78. } pi_err_stack_t;
  79. /* Simplified version of pi_err_status0_a_u_t (PI_ERR_STATUS0_A) */
  80. #ifdef LITTLE_ENDIAN
  81. struct err_status0_format {
  82. uint64_t s0_err_type :  3, /* Encoded error cause */
  83.                         s0_proc_req_num :  3,   /* Request number for RRB only */
  84.                         s0_supplemental : 11,   /* ncoming message sup field */
  85.                         s0_cmd          :  8,   /* Incoming message command */
  86.                         s0_addr         : 37,   /* Address */
  87.                         s0_over_run     :  1,   /* Subsequent errors spooled */
  88. s0_valid        :  1;   /* error is valid */
  89. };
  90. #else
  91. struct err_status0_format {
  92. uint64_t s0_valid :  1, /* error is valid */
  93. s0_over_run :  1, /* Subsequent errors spooled */
  94. s0_addr : 37, /* Address */
  95. s0_cmd :  8, /* Incoming message command */
  96. s0_supplemental : 11, /* ncoming message sup field */
  97. s0_proc_req_num :  3, /* Request number for RRB only */
  98. s0_err_type :  3; /* Encoded error cause */
  99. };
  100. #endif
  101. typedef union pi_err_stat0 {
  102. uint64_t pi_stat0_word;
  103.         struct err_status0_format pi_stat0_fmt;
  104. } pi_err_stat0_t;
  105. /* Simplified version of pi_err_status1_a_u_t (PI_ERR_STATUS1_A) */
  106. #ifdef LITTLE_ENDIAN
  107. struct err_status1_format {
  108.  uint64_t s1_spl_cnt : 21,   /* number spooled to memory */
  109.                         s1_to_cnt  :  8,   /* crb timeout counter */
  110.                         s1_inval_cnt:10,   /* signed invalidate counter RRB */
  111.                         s1_crb_num :  3,   /* WRB (0 to 7) or RRB (0 to 4) */
  112.                         s1_rw_rb   :  1,   /* RRB == 0, WRB == 1 */
  113.                         s1_crb_sts : 10,   /* status from RRB or WRB */
  114. s1_src     : 11;   /* message source */
  115. };
  116. #else
  117. struct err_status1_format {
  118. uint64_t s1_src    : 11,   /* message source */
  119. s1_crb_sts : 10,   /* status from RRB or WRB */
  120. s1_rw_rb   :  1,   /* RRB == 0, WRB == 1 */
  121. s1_crb_num :  3,   /* WRB (0 to 7) or RRB (0 to 4) */
  122. s1_inval_cnt:10,   /* signed invalidate counter RRB */
  123. s1_to_cnt  :  8,   /* crb timeout counter */
  124. s1_spl_cnt : 21;   /* number spooled to memory */
  125. };
  126. #endif
  127. typedef union pi_err_stat1 {
  128. uint64_t pi_stat1_word;
  129. struct err_status1_format pi_stat1_fmt;
  130. } pi_err_stat1_t;
  131. #endif
  132. /* Error stack types (sk_err_type) for reads: */
  133. #define PI_ERR_RD_AERR 0 /* Read Access Error */
  134. #define PI_ERR_RD_PRERR         1 /* Uncached Partitial Read */
  135. #define PI_ERR_RD_DERR          2 /* Directory Error */
  136. #define PI_ERR_RD_TERR          3 /* read timeout */
  137. #define PI_ERR_RD_PERR 4 /* Poison Access Violation */
  138. #define PI_ERR_RD_NACK 5 /* Excessive NACKs */
  139. #define PI_ERR_RD_RDE 6 /* Response Data Error */
  140. #define PI_ERR_RD_PLERR 7 /* Packet Length Error */
  141. /* Error stack types (sk_err_type) for writes: */
  142. #define PI_ERR_WR_WERR          0 /* Write Access Error */
  143. #define PI_ERR_WR_PWERR         1 /* Uncached Write Error */
  144. #define PI_ERR_WR_TERR          3 /* write timeout */
  145. #define PI_ERR_WR_RDE 6 /* Response Data Error */
  146. #define PI_ERR_WR_PLERR 7 /* Packet Length Error */
  147. /* For backwards compatibility */
  148. #define PI_RT_COUNT PI_RT_COUNTER    /* Real Time Counter      */
  149. #define PI_RT_EN_A PI_RT_INT_EN_A   /* RT int for CPU A enable         */
  150. #define PI_RT_EN_B PI_RT_INT_EN_B   /* RT int for CPU B enable         */
  151. #define PI_PROF_EN_A PI_PROF_INT_EN_A /* PROF int for CPU A enable       */
  152. #define PI_PROF_EN_B PI_PROF_INT_EN_B /* PROF int for CPU B enable       */
  153. #define PI_RT_PEND_A    PI_RT_INT_PEND_A /* RT interrupt pending      */
  154. #define PI_RT_PEND_B    PI_RT_INT_PEND_B /* RT interrupt pending      */
  155. #define PI_PROF_PEND_A  PI_PROF_INT_PEND_A /* Profiling interrupt pending   */
  156. #define PI_PROF_PEND_B  PI_PROF_INT_PEND_B /* Profiling interrupt pending   */
  157. /* Bits in PI_SYSAD_ERRCHK_EN */
  158. #define PI_SYSAD_ERRCHK_ECCGEN  0x01    /* Enable ECC generation            */
  159. #define PI_SYSAD_ERRCHK_QUALGEN 0x02    /* Enable data quality signal gen.  */
  160. #define PI_SYSAD_ERRCHK_SADP    0x04    /* Enable SysAD parity checking     */
  161. #define PI_SYSAD_ERRCHK_CMDP    0x08    /* Enable SysCmd parity checking    */
  162. #define PI_SYSAD_ERRCHK_STATE   0x10    /* Enable SysState parity checking  */
  163. #define PI_SYSAD_ERRCHK_QUAL    0x20    /* Enable data quality checking     */
  164. #define PI_SYSAD_CHECK_ALL      0x3f    /* Generate and check all signals.  */
  165. /* CALIAS values */
  166. #define PI_CALIAS_SIZE_0        0
  167. #define PI_CALIAS_SIZE_4K       1
  168. #define PI_CALIAS_SIZE_8K       2
  169. #define PI_CALIAS_SIZE_16K      3
  170. #define PI_CALIAS_SIZE_32K      4
  171. #define PI_CALIAS_SIZE_64K      5
  172. #define PI_CALIAS_SIZE_128K     6
  173. #define PI_CALIAS_SIZE_256K     7
  174. #define PI_CALIAS_SIZE_512K     8
  175. #define PI_CALIAS_SIZE_1M       9
  176. #define PI_CALIAS_SIZE_2M       10
  177. #define PI_CALIAS_SIZE_4M       11
  178. #define PI_CALIAS_SIZE_8M       12
  179. #define PI_CALIAS_SIZE_16M      13
  180. #define PI_CALIAS_SIZE_32M      14
  181. #define PI_CALIAS_SIZE_64M      15
  182. /* Fields in PI_ERR_STATUS0_[AB] */
  183. #define PI_ERR_ST0_VALID_MASK 0x8000000000000000
  184. #define PI_ERR_ST0_VALID_SHFT 63
  185. /* Fields in PI_SPURIOUS_HDR_0 */
  186. #define PI_SPURIOUS_HDR_VALID_MASK 0x8000000000000000
  187. #define PI_SPURIOUS_HDR_VALID_SHFT 63
  188. /* Fields in PI_NACK_CNT_A/B */
  189. #define PI_NACK_CNT_EN_SHFT 20
  190. #define PI_NACK_CNT_EN_MASK 0x100000
  191. #define PI_NACK_CNT_MASK 0x0fffff
  192. #define PI_NACK_CNT_MAX 0x0fffff
  193. /* Bits in PI_ERR_INT_PEND */
  194. #define PI_ERR_SPOOL_CMP_B 0x000000001 /* Spool end hit high water */
  195. #define PI_ERR_SPOOL_CMP_A 0x000000002
  196. #define PI_ERR_SPUR_MSG_B 0x000000004 /* Spurious message intr.   */
  197. #define PI_ERR_SPUR_MSG_A 0x000000008
  198. #define PI_ERR_WRB_TERR_B 0x000000010 /* WRB TERR     */
  199. #define PI_ERR_WRB_TERR_A 0x000000020
  200. #define PI_ERR_WRB_WERR_B 0x000000040 /* WRB WERR      */
  201. #define PI_ERR_WRB_WERR_A 0x000000080
  202. #define PI_ERR_SYSSTATE_B 0x000000100 /* SysState parity error    */
  203. #define PI_ERR_SYSSTATE_A 0x000000200
  204. #define PI_ERR_SYSAD_DATA_B 0x000000400 /* SysAD data parity error  */
  205. #define PI_ERR_SYSAD_DATA_A 0x000000800
  206. #define PI_ERR_SYSAD_ADDR_B 0x000001000 /* SysAD addr parity error  */
  207. #define PI_ERR_SYSAD_ADDR_A 0x000002000
  208. #define PI_ERR_SYSCMD_DATA_B 0x000004000 /* SysCmd data parity error */
  209. #define PI_ERR_SYSCMD_DATA_A 0x000008000
  210. #define PI_ERR_SYSCMD_ADDR_B 0x000010000 /* SysCmd addr parity error */
  211. #define PI_ERR_SYSCMD_ADDR_A 0x000020000
  212. #define PI_ERR_BAD_SPOOL_B 0x000040000 /* Error spooling to memory */
  213. #define PI_ERR_BAD_SPOOL_A 0x000080000
  214. #define PI_ERR_UNCAC_UNCORR_B 0x000100000 /* Uncached uncorrectable   */
  215. #define PI_ERR_UNCAC_UNCORR_A 0x000200000
  216. #define PI_ERR_SYSSTATE_TAG_B 0x000400000 /* SysState tag parity error */
  217. #define PI_ERR_SYSSTATE_TAG_A 0x000800000
  218. #define PI_ERR_MD_UNCORR 0x001000000 /* Must be cleared in MD    */
  219. #define PI_ERR_SYSAD_BAD_DATA_B 0x002000000 /* SysAD Data quality bad   */
  220. #define PI_ERR_SYSAD_BAD_DATA_A 0x004000000
  221. #define PI_ERR_UE_CACHED_B 0x008000000 /* UE during cached load    */
  222. #define PI_ERR_UE_CACHED_A 0x010000000
  223. #define PI_ERR_PKT_LEN_ERR_B 0x020000000 /* Xbar data too long/short */
  224. #define PI_ERR_PKT_LEN_ERR_A 0x040000000
  225. #define PI_ERR_IRB_ERR_B 0x080000000 /* Protocol error           */
  226. #define PI_ERR_IRB_ERR_A 0x100000000
  227. #define PI_ERR_IRB_TIMEOUT_B 0x200000000 /* IRB_B got a timeout      */
  228. #define PI_ERR_IRB_TIMEOUT_A 0x400000000
  229. #define PI_ERR_CLEAR_ALL_A 0x554aaaaaa
  230. #define PI_ERR_CLEAR_ALL_B 0x2aa555555
  231. /*
  232.  * The following three macros define all possible error int pends. 
  233.  */
  234. #define PI_FATAL_ERR_CPU_A (PI_ERR_IRB_TIMEOUT_A | 
  235.  PI_ERR_IRB_ERR_A | 
  236.  PI_ERR_PKT_LEN_ERR_A | 
  237.  PI_ERR_SYSSTATE_TAG_A  | 
  238.  PI_ERR_BAD_SPOOL_A  | 
  239.  PI_ERR_SYSCMD_ADDR_A  | 
  240.  PI_ERR_SYSCMD_DATA_A  | 
  241.  PI_ERR_SYSAD_ADDR_A  | 
  242.  PI_ERR_SYSAD_DATA_A | 
  243.  PI_ERR_SYSSTATE_A)
  244. #define PI_MISC_ERR_CPU_A (PI_ERR_UE_CACHED_A | 
  245.  PI_ERR_SYSAD_BAD_DATA_A| 
  246.  PI_ERR_UNCAC_UNCORR_A  | 
  247.  PI_ERR_WRB_WERR_A  | 
  248.  PI_ERR_WRB_TERR_A  | 
  249.  PI_ERR_SPUR_MSG_A  | 
  250.  PI_ERR_SPOOL_CMP_A)
  251. #define PI_FATAL_ERR_CPU_B (PI_ERR_IRB_TIMEOUT_B | 
  252.  PI_ERR_IRB_ERR_B | 
  253.  PI_ERR_PKT_LEN_ERR_B | 
  254.  PI_ERR_SYSSTATE_TAG_B  | 
  255.  PI_ERR_BAD_SPOOL_B  | 
  256.  PI_ERR_SYSCMD_ADDR_B  | 
  257.  PI_ERR_SYSCMD_DATA_B  | 
  258.  PI_ERR_SYSAD_ADDR_B  | 
  259.  PI_ERR_SYSAD_DATA_B | 
  260.  PI_ERR_SYSSTATE_B)
  261. #define PI_MISC_ERR_CPU_B (PI_ERR_UE_CACHED_B | 
  262.  PI_ERR_SYSAD_BAD_DATA_B| 
  263.  PI_ERR_UNCAC_UNCORR_B  | 
  264.  PI_ERR_WRB_WERR_B  | 
  265.  PI_ERR_WRB_TERR_B  | 
  266.  PI_ERR_SPUR_MSG_B  | 
  267.  PI_ERR_SPOOL_CMP_B)
  268. #define PI_ERR_GENERIC (PI_ERR_MD_UNCORR)
  269. /* Values for PI_MAX_CRB_TIMEOUT and PI_CRB_SFACTOR */
  270. #define PMCT_MAX 0xff
  271. #define PCS_MAX 0xffffff
  272. /* pi_err_status0_a_u_t address shift */
  273. #define ERR_STAT0_ADDR_SHFT     3
  274. /* PI error read/write bit (RRB == 0, WRB == 1) */
  275. /* pi_err_status1_a_u_t.pi_err_status1_a_fld_s.esa_wrb */
  276. #define PI_ERR_RRB 0
  277. #define PI_ERR_WRB 1
  278. /* Error stack address shift, for use with pi_stk_fmt.sk_addr */
  279. #define ERR_STK_ADDR_SHFT 3
  280. #endif /* _ASM_IA64_SN_SN1_HUBPI_NEXT_H */