chafsr.h 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. #ifndef _SPARC64_CHAFSR_H
  2. #define _SPARC64_CHAFSR_H
  3. /* Cheetah Asynchronous Fault Status register, ASI=0x4C VA<63:0>=0x0 */
  4. /* Comments indicate which processor variants on which the bit definition
  5. * is valid. Codes are:
  6. * ch --> cheetah
  7. * ch+ --> cheetah plus
  8. * jp --> jalapeno
  9. */
  10. /* All bits of this register except M_SYNDROME and E_SYNDROME are
  11. * read, write 1 to clear. M_SYNDROME and E_SYNDROME are read-only.
  12. */
  13. /* Software bit set by linux trap handlers to indicate that the trap was
  14. * signalled at %tl >= 1.
  15. */
  16. #define CHAFSR_TL1 (1UL << 63UL) /* n/a */
  17. /* Unmapped error from system bus for prefetch queue or
  18. * store queue read operation
  19. */
  20. #define CHPAFSR_DTO (1UL << 59UL) /* ch+ */
  21. /* Bus error from system bus for prefetch queue or store queue
  22. * read operation
  23. */
  24. #define CHPAFSR_DBERR (1UL << 58UL) /* ch+ */
  25. /* Hardware corrected E-cache Tag ECC error */
  26. #define CHPAFSR_THCE (1UL << 57UL) /* ch+ */
  27. /* System interface protocol error, hw timeout caused */
  28. #define JPAFSR_JETO (1UL << 57UL) /* jp */
  29. /* SW handled correctable E-cache Tag ECC error */
  30. #define CHPAFSR_TSCE (1UL << 56UL) /* ch+ */
  31. /* Parity error on system snoop results */
  32. #define JPAFSR_SCE (1UL << 56UL) /* jp */
  33. /* Uncorrectable E-cache Tag ECC error */
  34. #define CHPAFSR_TUE (1UL << 55UL) /* ch+ */
  35. /* System interface protocol error, illegal command detected */
  36. #define JPAFSR_JEIC (1UL << 55UL) /* jp */
  37. /* Uncorrectable system bus data ECC error due to prefetch
  38. * or store fill request
  39. */
  40. #define CHPAFSR_DUE (1UL << 54UL) /* ch+ */
  41. /* System interface protocol error, illegal ADTYPE detected */
  42. #define JPAFSR_JEIT (1UL << 54UL) /* jp */
  43. /* Multiple errors of the same type have occurred. This bit is set when
  44. * an uncorrectable error or a SW correctable error occurs and the status
  45. * bit to report that error is already set. When multiple errors of
  46. * different types are indicated by setting multiple status bits.
  47. *
  48. * This bit is not set if multiple HW corrected errors with the same
  49. * status bit occur, only uncorrectable and SW correctable ones have
  50. * this behavior.
  51. *
  52. * This bit is not set when multiple ECC errors happen within a single
  53. * 64-byte system bus transaction. Only the first ECC error in a 16-byte
  54. * subunit will be logged. All errors in subsequent 16-byte subunits
  55. * from the same 64-byte transaction are ignored.
  56. */
  57. #define CHAFSR_ME (1UL << 53UL) /* ch,ch+,jp */
  58. /* Privileged state error has occurred. This is a capture of PSTATE.PRIV
  59. * at the time the error is detected.
  60. */
  61. #define CHAFSR_PRIV (1UL << 52UL) /* ch,ch+,jp */
  62. /* The following bits 51 (CHAFSR_PERR) to 33 (CHAFSR_CE) are sticky error
  63. * bits and record the most recently detected errors. Bits accumulate
  64. * errors that have been detected since the last write to clear the bit.
  65. */
  66. /* System interface protocol error. The processor asserts its' ERROR
  67. * pin when this event occurs and it also logs a specific cause code
  68. * into a JTAG scannable flop.
  69. */
  70. #define CHAFSR_PERR (1UL << 51UL) /* ch,ch+,jp */
  71. /* Internal processor error. The processor asserts its' ERROR
  72. * pin when this event occurs and it also logs a specific cause code
  73. * into a JTAG scannable flop.
  74. */
  75. #define CHAFSR_IERR (1UL << 50UL) /* ch,ch+,jp */
  76. /* System request parity error on incoming address */
  77. #define CHAFSR_ISAP (1UL << 49UL) /* ch,ch+,jp */
  78. /* HW Corrected system bus MTAG ECC error */
  79. #define CHAFSR_EMC (1UL << 48UL) /* ch,ch+ */
  80. /* Parity error on L2 cache tag SRAM */
  81. #define JPAFSR_ETP (1UL << 48UL) /* jp */
  82. /* Uncorrectable system bus MTAG ECC error */
  83. #define CHAFSR_EMU (1UL << 47UL) /* ch,ch+ */
  84. /* Out of range memory error has occurred */
  85. #define JPAFSR_OM (1UL << 47UL) /* jp */
  86. /* HW Corrected system bus data ECC error for read of interrupt vector */
  87. #define CHAFSR_IVC (1UL << 46UL) /* ch,ch+ */
  88. /* Error due to unsupported store */
  89. #define JPAFSR_UMS (1UL << 46UL) /* jp */
  90. /* Uncorrectable system bus data ECC error for read of interrupt vector */
  91. #define CHAFSR_IVU (1UL << 45UL) /* ch,ch+,jp */
  92. /* Unmapped error from system bus */
  93. #define CHAFSR_TO (1UL << 44UL) /* ch,ch+,jp */
  94. /* Bus error response from system bus */
  95. #define CHAFSR_BERR (1UL << 43UL) /* ch,ch+,jp */
  96. /* SW Correctable E-cache ECC error for instruction fetch or data access
  97. * other than block load.
  98. */
  99. #define CHAFSR_UCC (1UL << 42UL) /* ch,ch+,jp */
  100. /* Uncorrectable E-cache ECC error for instruction fetch or data access
  101. * other than block load.
  102. */
  103. #define CHAFSR_UCU (1UL << 41UL) /* ch,ch+,jp */
  104. /* Copyout HW Corrected ECC error */
  105. #define CHAFSR_CPC (1UL << 40UL) /* ch,ch+,jp */
  106. /* Copyout Uncorrectable ECC error */
  107. #define CHAFSR_CPU (1UL << 39UL) /* ch,ch+,jp */
  108. /* HW Corrected ECC error from E-cache for writeback */
  109. #define CHAFSR_WDC (1UL << 38UL) /* ch,ch+,jp */
  110. /* Uncorrectable ECC error from E-cache for writeback */
  111. #define CHAFSR_WDU (1UL << 37UL) /* ch,ch+,jp */
  112. /* HW Corrected ECC error from E-cache for store merge or block load */
  113. #define CHAFSR_EDC (1UL << 36UL) /* ch,ch+,jp */
  114. /* Uncorrectable ECC error from E-cache for store merge or block load */
  115. #define CHAFSR_EDU (1UL << 35UL) /* ch,ch+,jp */
  116. /* Uncorrectable system bus data ECC error for read of memory or I/O */
  117. #define CHAFSR_UE (1UL << 34UL) /* ch,ch+,jp */
  118. /* HW Corrected system bus data ECC error for read of memory or I/O */
  119. #define CHAFSR_CE (1UL << 33UL) /* ch,ch+,jp */
  120. /* Uncorrectable ECC error from remote cache/memory */
  121. #define JPAFSR_RUE (1UL << 32UL) /* jp */
  122. /* Correctable ECC error from remote cache/memory */
  123. #define JPAFSR_RCE (1UL << 31UL) /* jp */
  124. /* JBUS parity error on returned read data */
  125. #define JPAFSR_BP (1UL << 30UL) /* jp */
  126. /* JBUS parity error on data for writeback or block store */
  127. #define JPAFSR_WBP (1UL << 29UL) /* jp */
  128. /* Foreign read to DRAM incurring correctable ECC error */
  129. #define JPAFSR_FRC (1UL << 28UL) /* jp */
  130. /* Foreign read to DRAM incurring uncorrectable ECC error */
  131. #define JPAFSR_FRU (1UL << 27UL) /* jp */
  132. #define CHAFSR_ERRORS (CHAFSR_PERR | CHAFSR_IERR | CHAFSR_ISAP | CHAFSR_EMC | \
  133. CHAFSR_EMU | CHAFSR_IVC | CHAFSR_IVU | CHAFSR_TO | \
  134. CHAFSR_BERR | CHAFSR_UCC | CHAFSR_UCU | CHAFSR_CPC | \
  135. CHAFSR_CPU | CHAFSR_WDC | CHAFSR_WDU | CHAFSR_EDC | \
  136. CHAFSR_EDU | CHAFSR_UE | CHAFSR_CE)
  137. #define CHPAFSR_ERRORS (CHPAFSR_DTO | CHPAFSR_DBERR | CHPAFSR_THCE | \
  138. CHPAFSR_TSCE | CHPAFSR_TUE | CHPAFSR_DUE | \
  139. CHAFSR_PERR | CHAFSR_IERR | CHAFSR_ISAP | CHAFSR_EMC | \
  140. CHAFSR_EMU | CHAFSR_IVC | CHAFSR_IVU | CHAFSR_TO | \
  141. CHAFSR_BERR | CHAFSR_UCC | CHAFSR_UCU | CHAFSR_CPC | \
  142. CHAFSR_CPU | CHAFSR_WDC | CHAFSR_WDU | CHAFSR_EDC | \
  143. CHAFSR_EDU | CHAFSR_UE | CHAFSR_CE)
  144. #define JPAFSR_ERRORS (JPAFSR_JETO | JPAFSR_SCE | JPAFSR_JEIC | \
  145. JPAFSR_JEIT | CHAFSR_PERR | CHAFSR_IERR | \
  146. CHAFSR_ISAP | JPAFSR_ETP | JPAFSR_OM | \
  147. JPAFSR_UMS | CHAFSR_IVU | CHAFSR_TO | \
  148. CHAFSR_BERR | CHAFSR_UCC | CHAFSR_UCU | \
  149. CHAFSR_CPC | CHAFSR_CPU | CHAFSR_WDC | \
  150. CHAFSR_WDU | CHAFSR_EDC | CHAFSR_EDU | \
  151. CHAFSR_UE | CHAFSR_CE | JPAFSR_RUE | \
  152. JPAFSR_RCE | JPAFSR_BP | JPAFSR_WBP | \
  153. JPAFSR_FRC | JPAFSR_FRU)
  154. /* Active JBUS request signal when error occurred */
  155. #define JPAFSR_JBREQ (0x7UL << 24UL) /* jp */
  156. #define JPAFSR_JBREQ_SHIFT 24UL
  157. /* L2 cache way information */
  158. #define JPAFSR_ETW (0x3UL << 22UL) /* jp */
  159. #define JPAFSR_ETW_SHIFT 22UL
  160. /* System bus MTAG ECC syndrome. This field captures the status of the
  161. * first occurrence of the highest-priority error according to the M_SYND
  162. * overwrite policy. After the AFSR sticky bit, corresponding to the error
  163. * for which the M_SYND is reported, is cleared, the contents of the M_SYND
  164. * field will be unchanged by will be unfrozen for further error capture.
  165. */
  166. #define CHAFSR_M_SYNDROME (0xfUL << 16UL) /* ch,ch+,jp */
  167. #define CHAFSR_M_SYNDROME_SHIFT 16UL
  168. /* Agenid Id of the foreign device causing the UE/CE errors */
  169. #define JPAFSR_AID (0x1fUL << 9UL) /* jp */
  170. #define JPAFSR_AID_SHIFT 9UL
  171. /* System bus or E-cache data ECC syndrome. This field captures the status
  172. * of the first occurrence of the highest-priority error according to the
  173. * E_SYND overwrite policy. After the AFSR sticky bit, corresponding to the
  174. * error for which the E_SYND is reported, is cleare, the contents of the E_SYND
  175. * field will be unchanged but will be unfrozen for further error capture.
  176. */
  177. #define CHAFSR_E_SYNDROME (0x1ffUL << 0UL) /* ch,ch+,jp */
  178. #define CHAFSR_E_SYNDROME_SHIFT 0UL
  179. /* The AFSR must be explicitly cleared by software, it is not cleared automatically
  180. * by a read. Writes to bits <51:33> with bits set will clear the corresponding
  181. * bits in the AFSR. Bits associated with disrupting traps must be cleared before
  182. * interrupts are re-enabled to prevent multiple traps for the same error. I.e.
  183. * PSTATE.IE and AFSR bits control delivery of disrupting traps.
  184. *
  185. * Since there is only one AFAR, when multiple events have been logged by the
  186. * bits in the AFSR, at most one of these events will have its status captured
  187. * in the AFAR. The highest priority of those event bits will get AFAR logging.
  188. * The AFAR will be unlocked and available to capture the address of another event
  189. * as soon as the one bit in AFSR that corresponds to the event logged in AFAR is
  190. * cleared. For example, if AFSR.CE is detected, then AFSR.UE (which overwrites
  191. * the AFAR), and AFSR.UE is cleared by not AFSR.CE, then the AFAR will be unlocked
  192. * and ready for another event, even though AFSR.CE is still set. The same rules
  193. * also apply to the M_SYNDROME and E_SYNDROME fields of the AFSR.
  194. */
  195. #endif /* _SPARC64_CHAFSR_H */