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

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_HUBNI_NEXT_H
  10. #define _ASM_IA64_SN_SN1_HUBNI_NEXT_H
  11. #define NI_LOCAL_ENTRIES        128
  12. #define NI_META_ENTRIES        1
  13. #define NI_LOCAL_TABLE(_x)      (NI_LOCAL_TABLE_0 + (8 * (_x)))
  14. #define NI_META_TABLE(_x)       (NI_GLOBAL_TABLE + (8 * (_x)))
  15. /**************************************************************
  16.   Masks and shifts for NI registers are defined below. 
  17. **************************************************************/
  18. #define NPS_LINKUP_SHFT        1
  19. #define NPS_LINKUP_MASK        (UINT64_CAST 0x1 << 1)
  20. #define NPR_LOCALRESET          (UINT64_CAST 1 << 2)    /* Reset loc. bdrck */
  21. #define NPR_PORTRESET           (UINT64_CAST 1 << 1)    /* Send warm reset  */
  22. #define NPR_LINKRESET           (UINT64_CAST 1 << 0)    /* Send link reset  */
  23. /* NI_DIAG_PARMS bit definitions */
  24. #define NDP_SENDERROR           (UINT64_CAST 1 <<  0)   /* Send data error  */
  25. #define NDP_PORTDISABLE         (UINT64_CAST 1 <<  1)   /* Port disable     */
  26. #define NDP_SENDERROFF          (UINT64_CAST 1 <<  2)   /* Disable send error recovery */
  27. /* NI_PORT_ERROR mask and shift definitions (some are not present in SN0) */
  28. #define NPE_LINKRESET (UINT64_CAST 1 << 52)
  29. #define NPE_INTLONG_SHFT 48
  30. #define NPE_INTLONG_MASK (UINT64_CAST 0xf << NPE_INTLONG_SHFT)
  31. #define NPE_INTSHORT_SHFT 44
  32. #define NPE_INTSHORT_MASK (UINT64_CAST 0xf << NPE_INTSHORT_SHFT)
  33. #define NPE_EXTBADHEADER_SHFT 40
  34. #define NPE_EXTBADHEADER_MASK (UINT64_CAST 0xf << NPE_EXTBADHEADER_SHFT)
  35. #define NPE_EXTLONG_SHFT 36
  36. #define NPE_EXTLONG_MASK (UINT64_CAST 0xf << NPE_EXTLONG_SHFT)
  37. #define NPE_EXTSHORT_SHFT 32
  38. #define NPE_EXTSHORT_MASK (UINT64_CAST 0xf << NPE_EXTSHORT_SHFT)
  39. #define NPE_FIFOOVFLOW_SHFT 28
  40. #define NPE_FIFOOVFLOW_MASK (UINT64_CAST 0xf << NPE_FIFOOVFLOW_SHFT)
  41. #define NPE_TAILTO_SHFT 24
  42. #define NPE_TAILTO_MASK (UINT64_CAST 0xf << NPE_TAILTO_SHFT)
  43. #define NPE_RETRYCOUNT_SHFT 16
  44. #define NPE_RETRYCOUNT_MASK (UINT64_CAST 0xff << NPE_RETRYCOUNT_SHFT)
  45. #define NPE_CBERRCOUNT_SHFT 8
  46. #define NPE_CBERRCOUNT_MASK (UINT64_CAST 0xff << NPE_CBERRCOUNT_SHFT)
  47. #define NPE_SNERRCOUNT_SHFT 0
  48. #define NPE_SNERRCOUNT_MASK (UINT64_CAST 0xff << NPE_SNERRCOUNT_SHFT)
  49. #define NPE_COUNT_MAX 0xff
  50. #define NPE_FATAL_ERRORS (NPE_LINKRESET | NPE_INTLONG_MASK |
  51.  NPE_INTSHORT_MASK | NPE_EXTBADHEADER_MASK |
  52.  NPE_EXTLONG_MASK | NPE_EXTSHORT_MASK |
  53.  NPE_FIFOOVFLOW_MASK | NPE_TAILTO_MASK)
  54. #ifndef __ASSEMBLY__
  55. /* NI_PORT_HEADER[AB] registers (not automatically generated) */
  56. #ifdef LITTLE_ENDIAN
  57. typedef union ni_port_header_a_u {
  58. bdrkreg_t ni_port_header_a_regval;
  59. struct  {
  60. bdrkreg_t pha_v                     :  1;
  61.                 bdrkreg_t       pha_age                   :      8;
  62.                 bdrkreg_t       pha_direction             :      4;
  63.                 bdrkreg_t       pha_destination           :      8;
  64.                 bdrkreg_t       pha_reserved_1            :      3;
  65.                 bdrkreg_t       pha_command               :      8;
  66.                 bdrkreg_t       pha_prexsel               :      3;
  67.                 bdrkreg_t       pha_address_b             :     27;
  68.                 bdrkreg_t       pha_reserved              :      2;
  69. } ni_port_header_a_fld_s;
  70. } ni_port_header_a_u_t;
  71. #else
  72. typedef union ni_port_header_a_u {
  73. bdrkreg_t ni_port_header_a_regval;
  74. struct {
  75. bdrkreg_t pha_reserved   :  2;
  76. bdrkreg_t pha_address_b   : 27;
  77. bdrkreg_t pha_prexsel   :  3;
  78. bdrkreg_t pha_command   :  8;
  79. bdrkreg_t pha_reserved_1   :  3;
  80. bdrkreg_t pha_destination   :  8;
  81. bdrkreg_t pha_direction   :  4;
  82. bdrkreg_t pha_age   :  8;
  83. bdrkreg_t pha_v   :  1;
  84. } ni_port_header_a_fld_s;
  85. } ni_port_header_a_u_t;
  86. #endif
  87. #ifdef LITTLE_ENDIAN
  88. typedef union ni_port_header_b_u {
  89. bdrkreg_t ni_port_header_b_regval;
  90. struct  {
  91. bdrkreg_t phb_supplemental           : 11;
  92.                 bdrkreg_t       phb_reserved_2            :      5;
  93.                 bdrkreg_t       phb_source                :     11;
  94.                 bdrkreg_t       phb_reserved_1            :      8;
  95.                 bdrkreg_t       phb_address_a             :      3;
  96.                 bdrkreg_t       phb_address_c             :      8;
  97.                 bdrkreg_t       phb_reserved              :     18;
  98. } ni_port_header_b_fld_s;
  99. } ni_port_header_b_u_t;
  100. #else
  101. typedef union ni_port_header_b_u {
  102. bdrkreg_t ni_port_header_b_regval;
  103. struct {
  104. bdrkreg_t phb_reserved   : 18;
  105. bdrkreg_t phb_address_c   :  8;
  106. bdrkreg_t phb_address_a   :  3;
  107. bdrkreg_t phb_reserved_1   :  8;
  108. bdrkreg_t phb_source   : 11;
  109. bdrkreg_t phb_reserved_2   :  5;
  110. bdrkreg_t phb_supplemental    : 11;
  111. } ni_port_header_b_fld_s;
  112. } ni_port_header_b_u_t;
  113. #endif
  114. #endif
  115. /* NI_RESET_ENABLE mask definitions */
  116. #define NRE_RESETOK (UINT64_CAST 1) /* Let LLP reset bedrock */
  117. /* NI PORT_ERRORS, Max number of RETRY_COUNT, Check Bit, and Sequence   */
  118. /* Number errors (8 bit counters that do not wrap).                     */
  119. #define NI_LLP_RETRY_MAX        0xff
  120. #define NI_LLP_CB_MAX           0xff
  121. #define NI_LLP_SN_MAX           0xff
  122. /* NI_PORT_PARMS shift and mask definitions */
  123. #define NPP_VCH_ERR_EN_SHFT 31
  124. #define NPP_VCH_ERR_EN_MASK (0xf << NPP_VCH_ERR_EN_SHFT)
  125. #define NPP_SQUASH_ERR_EN_SHFT 30
  126. #define NPP_SQUASH_ERR_EN_MASK (0x1 << NPP_SQUASH_ERR_EN_SHFT)
  127. #define NPP_FIRST_ERR_EN_SHFT 29
  128. #define NPP_FIRST_ERR_EN_MASK (0x1 << NPP_FIRST_ERR_EN_SHFT)
  129. #define NPP_D_AVAIL_SEL_SHFT 26
  130. #define NPP_D_AVAIL_SEL_MASK (0x3 << NPP_D_AVAIL_SEL_SHFT)
  131. #define NPP_MAX_RETRY_SHFT 16
  132. #define NPP_MAX_RETRY_MASK (0x3ff << NPP_MAX_RETRY_SHFT)
  133. #define NPP_NULL_TIMEOUT_SHFT 10
  134. #define NPP_NULL_TIMEOUT_MASK (0x3f << NPP_NULL_TIMEOUT_SHFT)
  135. #define NPP_MAX_BURST_SHFT 0
  136. #define NPP_MAX_BURST_MASK (0x3ff << NPP_MAX_BURST_SHFT)
  137. #define NPP_RESET_DEFAULTS (0xf << NPP_VCH_ERR_EN_SHFT |   
  138.  0x1 << NPP_FIRST_ERR_EN_SHFT | 
  139.  0x3ff << NPP_MAX_RETRY_SHFT |  
  140.  0x6 << NPP_NULL_TIMEOUT_SHFT | 
  141.  0x3f0 << NPP_MAX_BURST_SHFT)
  142. #endif /* _ASM_IA64_SN_SN1_HUBNI_NEXT_H */