synchronousMemoryDatabase.c 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. /*
  2. * linux/arch/alpha/kernel/err_titan.c
  3. *
  4. * Copyright (C) 2000 Jeff Wiedemeier (Compaq Computer Corporation)
  5. *
  6. * Error handling code supporting TITAN systems
  7. */
  8. #include <linux/init.h>
  9. #include <linux/pci.h>
  10. #include <linux/sched.h>
  11. #include <asm/io.h>
  12. #include <asm/core_titan.h>
  13. #include <asm/hwrpb.h>
  14. #include <asm/smp.h>
  15. #include <asm/err_common.h>
  16. #include <asm/err_ev6.h>
  17. #include <asm/irq_regs.h>
  18. #include "err_impl.h"
  19. #include "proto.h"
  20. static int
  21. titan_parse_c_misc(u64 c_misc, int print)
  22. {
  23. #ifdef CONFIG_VERBOSE_MCHECK
  24. char *src;
  25. int nxs = 0;
  26. #endif
  27. int status = MCHK_DISPOSITION_REPORT;
  28. #define TITAN__CCHIP_MISC__NXM (1UL << 28)
  29. #define TITAN__CCHIP_MISC__NXS__S (29)
  30. #define TITAN__CCHIP_MISC__NXS__M (0x7)
  31. if (!(c_misc & TITAN__CCHIP_MISC__NXM))
  32. return MCHK_DISPOSITION_UNKNOWN_ERROR;
  33. #ifdef CONFIG_VERBOSE_MCHECK
  34. if (!print)
  35. return status;
  36. nxs = EXTRACT(c_misc, TITAN__CCHIP_MISC__NXS);
  37. switch(nxs) {
  38. case 0: /* CPU 0 */
  39. case 1: /* CPU 1 */
  40. case 2: /* CPU 2 */
  41. case 3: /* CPU 3 */
  42. src = "CPU";
  43. /* num is already the CPU number */
  44. break;
  45. case 4: /* Pchip 0 */
  46. case 5: /* Pchip 1 */
  47. src = "Pchip";
  48. nxs -= 4;
  49. break;
  50. default:/* reserved */
  51. src = "Unknown, NXS =";
  52. /* leave num untouched */
  53. break;
  54. }
  55. printk("%s Non-existent memory access from: %s %d\n",
  56. err_print_prefix, src, nxs);
  57. #endif /* CONFIG_VERBOSE_MCHECK */
  58. return status;
  59. }
  60. static int
  61. titan_parse_p_serror(int which, u64 serror, int print)
  62. {
  63. int status = MCHK_DISPOSITION_REPORT;
  64. #ifdef CONFIG_VERBOSE_MCHECK
  65. static const char * const serror_src[] = {
  66. "GPCI", "APCI", "AGP HP", "AGP LP"
  67. };
  68. static const char * const serror_cmd[] = {
  69. "DMA Read", "DMA RMW", "SGTE Read", "Reserved"
  70. };
  71. #endif /* CONFIG_VERBOSE_MCHECK */
  72. #define TITAN__PCHIP_SERROR__LOST_UECC (1UL << 0)
  73. #define TITAN__PCHIP_SERROR__UECC (1UL << 1)
  74. #define TITAN__PCHIP_SERROR__CRE (1UL << 2)
  75. #define TITAN__PCHIP_SERROR__NXIO (1UL << 3)
  76. #define TITAN__PCHIP_SERROR__LOST_CRE (1UL << 4)
  77. #define TITAN__PCHIP_SERROR__ECCMASK (TITAN__PCHIP_SERROR__UECC | \
  78. TITAN__PCHIP_SERROR__CRE)
  79. #define TITAN__PCHIP_SERROR__ERRMASK (TITAN__PCHIP_SERROR__LOST_UECC | \
  80. TITAN__PCHIP_SERROR__UECC | \
  81. TITAN__PCHIP_SERROR__CRE | \
  82. TITAN__PCHIP_SERROR__NXIO | \
  83. TITAN__PCHIP_SERROR__LOST_CRE)
  84. #define TITAN__PCHIP_SERROR__SRC__S (52)
  85. #define TITAN__PCHIP_SERROR__SRC__M (0x3)
  86. #define TITAN__PCHIP_SERROR__CMD__S (54)
  87. #define TITAN__PCHIP_SERROR__CMD__M (0x3)
  88. #define TITAN__PCHIP_SERROR__SYN__S (56)
  89. #define TITAN__PCHIP_SERROR__SYN__M (0xff)
  90. #define TITAN__PCHIP_SERROR__ADDR__S (15)
  91. #define TITAN__PCHIP_SERROR__ADDR__M (0xffffffffUL)
  92. if (!(serror & TITAN__PCHIP_SERROR__ERRMASK))
  93. return MCHK_DISPOSITION_UNKNOWN_ERROR;
  94. #ifdef CONFIG_VERBOSE_MCHECK
  95. if (!print)
  96. return status;
  97. printk("%s PChip %d SERROR: %016llx\n",
  98. err_print_prefix, which, serror);
  99. if (serror & TITAN__PCHIP_SERROR__ECCMASK) {
  100. printk("%s %sorrectable ECC Error:\n"
  101. " Source: %-6s Command: %-8s Syndrome: 0x%08x\n"
  102. " Address: 0x%llx\n",
  103. err_print_prefix,
  104. (serror & TITAN__PCHIP_SERROR__UECC) ? "Unc" : "C",
  105. serror_src[EXTRACT(serror, TITAN__PCHIP_SERROR__SRC)],
  106. serror_cmd[EXTRACT(serror, TITAN__PCHIP_SERROR__CMD)],
  107. (unsigned)EXTRACT(serror, TITAN__PCHIP_SERROR__SYN),
  108. EXTRACT(serror, TITAN__PCHIP_SERROR__ADDR));
  109. }
  110. if (serror & TITAN__PCHIP_SERROR__NXIO)
  111. printk("%s Non Existent I/O Error\n", err_print_prefix);
  112. if (serror & TITAN__PCHIP_SERROR__LOST_UECC)
  113. printk("%s Lost Uncorrectable ECC Error\n",
  114. err_print_prefix);
  115. if (serror & TITAN__PCHIP_SERROR__LOST_CRE)
  116. printk("%s Lost Correctable ECC Error\n", err_print_prefix);
  117. #endif /* CONFIG_VERBOSE_MCHECK */
  118. return status;
  119. }
  120. static int
  121. titan_parse_p_perror(int which, int port, u64 perror, int print)
  122. {
  123. int cmd;
  124. unsigned long addr;
  125. int status = MCHK_DISPOSITION_REPORT;
  126. #ifdef CONFIG_VERBOSE_MCHECK
  127. static const char * const perror_cmd[] = {
  128. "Interrupt Acknowledge", "Special Cycle",
  129. "I/O Read", "I/O Write",
  130. "Reserved", "Reserved",
  131. "Memory Read", "Memory Write",
  132. "Reserved", "Reserved",
  133. "Configuration Read", "Configuration Write",
  134. "Memory Read Multiple", "Dual Address Cycle",
  135. "Memory Read Line", "Memory Write and Invalidate"
  136. };
  137. #endif /* CONFIG_VERBOSE_MCHECK */
  138. #define TITAN__PCHIP_PERROR__LOST (1UL << 0)
  139. #define TITAN__PCHIP_PERROR__SERR (1UL << 1)
  140. #define TITAN__PCHIP_PERROR__PERR (1UL << 2)
  141. #define TITAN__PCHIP_PERROR__DCRTO (1UL << 3)
  142. #define TITAN__PCHIP_PERROR__SGE (1UL << 4)
  143. #define TITAN__PCHIP_PERROR__APE (1UL << 5)
  144. #define TITAN__PCHIP_PERROR__TA (1UL << 6)
  145. #define TITAN__PCHIP_PERROR__DPE (1UL << 7)
  146. #define TITAN__PCHIP_PERROR__NDS (1UL << 8)
  147. #define TITAN__PCHIP_PERROR__IPTPR (1UL << 9)
  148. #define TITAN__PCHIP_PERROR__IPTPW (1UL << 10)
  149. #define TITAN__PCHIP_PERROR__ERRMASK (TITAN__PCHIP_PERROR__LOST | \
  150. TITAN__PCHIP_PERROR__SERR | \
  151. TITAN__PCHIP_PERROR__PERR | \
  152. TITAN__PCHIP_PERROR__DCRTO | \
  153. TITAN__PCHIP_PERROR__SGE | \
  154. TITAN__PCHIP_PERROR__APE | \
  155. TITAN__PCHIP_PERROR__TA | \
  156. TITAN__PCHIP_PERROR__DPE | \
  157. TITAN__PCHIP_PERROR__NDS | \
  158. TITAN__PCHIP_PERROR__IPTPR | \
  159. TITAN__PCHIP_PERROR__IPTPW)
  160. #define TITAN__PCHIP_PERROR__DAC (1UL << 47)
  161. #define TITAN__PCHIP_PERROR__MWIN (1UL << 48)
  162. #define TITAN__PCHIP_PERROR__CMD__S (52)
  163. #define TITAN__PCHIP_PERROR__CMD__M (0x0f)
  164. #define TITAN__PCHIP_PERROR__ADDR__S (14)
  165. #define TITAN__PCHIP_PERROR__ADDR__M (0x1fffffffful)
  166. if (!(perror & TITAN__PCHIP_PERROR__ERRMASK))
  167. return MCHK_DISPOSITION_UNKNOWN_ERROR;
  168. cmd = EXTRACT(perror, TITAN__PCHIP_PERROR__CMD);
  169. addr = EXTRACT(perror, TITAN__PCHIP_PERROR__ADDR) << 2;
  170. /*
  171. * Initializing the BIOS on a video card on a bus without
  172. * a south bridge (subtractive decode agent) can result in
  173. * master aborts as the BIOS probes the capabilities of the