ecc.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*
  2. * ecc.h: Definitions and defines for the external cache/memory
  3. * controller on the sun4m.
  4. *
  5. * Copyright (C) 1995 David S. Miller ([email protected])
  6. */
  7. #ifndef _SPARC_ECC_H
  8. #define _SPARC_ECC_H
  9. /* These registers are accessed through the SRMMU passthrough ASI 0x20 */
  10. #define ECC_ENABLE 0x00000000 /* ECC enable register */
  11. #define ECC_FSTATUS 0x00000008 /* ECC fault status register */
  12. #define ECC_FADDR 0x00000010 /* ECC fault address register */
  13. #define ECC_DIGNOSTIC 0x00000018 /* ECC diagnostics register */
  14. #define ECC_MBAENAB 0x00000020 /* MBus arbiter enable register */
  15. #define ECC_DMESG 0x00001000 /* Diagnostic message passing area */
  16. /* ECC MBus Arbiter Enable register:
  17. *
  18. * ----------------------------------------
  19. * | |SBUS|MOD3|MOD2|MOD1|RSV|
  20. * ----------------------------------------
  21. * 31 5 4 3 2 1 0
  22. *
  23. * SBUS: Enable MBus Arbiter on the SBus 0=off 1=on
  24. * MOD3: Enable MBus Arbiter on MBus module 3 0=off 1=on
  25. * MOD2: Enable MBus Arbiter on MBus module 2 0=off 1=on
  26. * MOD1: Enable MBus Arbiter on MBus module 1 0=off 1=on
  27. */
  28. #define ECC_MBAE_SBUS 0x00000010
  29. #define ECC_MBAE_MOD3 0x00000008
  30. #define ECC_MBAE_MOD2 0x00000004
  31. #define ECC_MBAE_MOD1 0x00000002
  32. /* ECC Fault Control Register layout:
  33. *
  34. * -----------------------------
  35. * | RESV | ECHECK | EINT |
  36. * -----------------------------
  37. * 31 2 1 0
  38. *
  39. * ECHECK: Enable ECC checking. 0=off 1=on
  40. * EINT: Enable Interrupts for correctable errors. 0=off 1=on
  41. */
  42. #define ECC_FCR_CHECK 0x00000002
  43. #define ECC_FCR_INTENAB 0x00000001
  44. /* ECC Fault Address Register Zero layout:
  45. *
  46. * -----------------------------------------------------
  47. * | MID | S | RSV | VA | BM |AT| C| SZ |TYP| PADDR |
  48. * -----------------------------------------------------
  49. * 31-28 27 26-22 21-14 13 12 11 10-8 7-4 3-0
  50. *
  51. * MID: ModuleID of the faulting processor. ie. who did it?
  52. * S: Supervisor/Privileged access? 0=no 1=yes
  53. * VA: Bits 19-12 of the virtual faulting address, these are the
  54. * superset bits in the virtual cache and can be used for
  55. * a flush operation if necessary.
  56. * BM: Boot mode? 0=no 1=yes This is just like the SRMMU boot
  57. * mode bit.
  58. * AT: Did this fault happen during an atomic instruction? 0=no
  59. * 1=yes. This means either an 'ldstub' or 'swap' instruction
  60. * was in progress (but not finished) when this fault happened.
  61. * This indicated whether the bus was locked when the fault
  62. * occurred.
  63. * C: Did the pte for this access indicate that it was cacheable?
  64. * 0=no 1=yes
  65. * SZ: The size of the transaction.
  66. * TYP: The transaction type.
  67. * PADDR: Bits 35-32 of the physical address for the fault.
  68. */
  69. #define ECC_FADDR0_MIDMASK 0xf0000000
  70. #define ECC_FADDR0_S 0x08000000
  71. #define ECC_FADDR0_VADDR 0x003fc000
  72. #define ECC_FADDR0_BMODE 0x00002000
  73. #define ECC_FADDR0_ATOMIC 0x00001000
  74. #define ECC_FADDR0_CACHE 0x00000800
  75. #define ECC_FADDR0_SIZE 0x00000700
  76. #define ECC_FADDR0_TYPE 0x000000f0
  77. #define ECC_FADDR0_PADDR 0x0000000f
  78. /* ECC Fault Address Register One layout:
  79. *
  80. * -------------------------------------
  81. * | Physical Address 31-0 |
  82. * -------------------------------------
  83. * 31 0
  84. *
  85. * You get the upper 4 bits of the physical address from the
  86. * PADDR field in ECC Fault Address Zero register.
  87. */
  88. /* ECC Fault Status Register layout:
  89. *
  90. * ----------------------------------------------
  91. * | RESV|C2E|MULT|SYNDROME|DWORD|UNC|TIMEO|BS|C|
  92. * ----------------------------------------------
  93. * 31-18 17 16 15-8 7-4 3 2 1 0
  94. *
  95. * C2E: A C2 graphics error occurred. 0=no 1=yes (SS10 only)
  96. * MULT: Multiple errors occurred ;-O 0=no 1=prom_panic(yes)
  97. * SYNDROME: Controller is mentally unstable.
  98. * DWORD:
  99. * UNC: Uncorrectable error. 0=no 1=yes
  100. * TIMEO: Timeout occurred. 0=no 1=yes
  101. * BS: C2 graphics bad slot access. 0=no 1=yes (SS10 only)
  102. * C: Correctable error? 0=no 1=yes
  103. */
  104. #define ECC_FSR_C2ERR 0x00020000
  105. #define ECC_FSR_MULT 0x00010000
  106. #define ECC_FSR_SYND 0x0000ff00
  107. #define ECC_FSR_DWORD 0x000000f0
  108. #define ECC_FSR_UNC 0x00000008
  109. #define ECC_FSR_TIMEO 0x00000004
  110. #define ECC_FSR_BADSLOT 0x00000002
  111. #define ECC_FSR_C 0x00000001
  112. #endif /* !(_SPARC_ECC_H) */