mpc85xx_edac.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. /*
  2. * Freescale MPC85xx Memory Controller kenel module
  3. * Author: Dave Jiang <djiang@mvista.com>
  4. *
  5. * 2006-2007 (c) MontaVista Software, Inc. This file is licensed under
  6. * the terms of the GNU General Public License version 2. This program
  7. * is licensed "as is" without any warranty of any kind, whether express
  8. * or implied.
  9. *
  10. */
  11. #ifndef _MPC85XX_EDAC_H_
  12. #define _MPC85XX_EDAC_H_
  13. #define MPC85XX_REVISION " Ver: 2.0.0"
  14. #define EDAC_MOD_STR "MPC85xx_edac"
  15. #define mpc85xx_printk(level, fmt, arg...) \
  16. edac_printk(level, "MPC85xx", fmt, ##arg)
  17. #define mpc85xx_mc_printk(mci, level, fmt, arg...) \
  18. edac_mc_chipset_printk(mci, level, "MPC85xx", fmt, ##arg)
  19. /*
  20. * DRAM error defines
  21. */
  22. /* DDR_SDRAM_CFG */
  23. #define MPC85XX_MC_DDR_SDRAM_CFG 0x0110
  24. #define MPC85XX_MC_CS_BNDS_0 0x0000
  25. #define MPC85XX_MC_CS_BNDS_1 0x0008
  26. #define MPC85XX_MC_CS_BNDS_2 0x0010
  27. #define MPC85XX_MC_CS_BNDS_3 0x0018
  28. #define MPC85XX_MC_CS_BNDS_OFS 0x0008
  29. #define MPC85XX_MC_DATA_ERR_INJECT_HI 0x0e00
  30. #define MPC85XX_MC_DATA_ERR_INJECT_LO 0x0e04
  31. #define MPC85XX_MC_ECC_ERR_INJECT 0x0e08
  32. #define MPC85XX_MC_CAPTURE_DATA_HI 0x0e20
  33. #define MPC85XX_MC_CAPTURE_DATA_LO 0x0e24
  34. #define MPC85XX_MC_CAPTURE_ECC 0x0e28
  35. #define MPC85XX_MC_ERR_DETECT 0x0e40
  36. #define MPC85XX_MC_ERR_DISABLE 0x0e44
  37. #define MPC85XX_MC_ERR_INT_EN 0x0e48
  38. #define MPC85XX_MC_CAPTURE_ATRIBUTES 0x0e4c
  39. #define MPC85XX_MC_CAPTURE_ADDRESS 0x0e50
  40. #define MPC85XX_MC_ERR_SBE 0x0e58
  41. #define DSC_MEM_EN 0x80000000
  42. #define DSC_ECC_EN 0x20000000
  43. #define DSC_RD_EN 0x10000000
  44. #define DSC_DBW_MASK 0x00180000
  45. #define DSC_DBW_32 0x00080000
  46. #define DSC_DBW_64 0x00000000
  47. #define DSC_SDTYPE_MASK 0x07000000
  48. #define DSC_SDTYPE_DDR 0x02000000
  49. #define DSC_SDTYPE_DDR2 0x03000000
  50. #define DSC_SDTYPE_DDR3 0x07000000
  51. #define DSC_X32_EN 0x00000020
  52. /* Err_Int_En */
  53. #define DDR_EIE_MSEE 0x1 /* memory select */
  54. #define DDR_EIE_SBEE 0x4 /* single-bit ECC error */
  55. #define DDR_EIE_MBEE 0x8 /* multi-bit ECC error */
  56. /* Err_Detect */
  57. #define DDR_EDE_MSE 0x1 /* memory select */
  58. #define DDR_EDE_SBE 0x4 /* single-bit ECC error */
  59. #define DDR_EDE_MBE 0x8 /* multi-bit ECC error */
  60. #define DDR_EDE_MME 0x80000000 /* multiple memory errors */
  61. /* Err_Disable */
  62. #define DDR_EDI_MSED 0x1 /* memory select disable */
  63. #define DDR_EDI_SBED 0x4 /* single-bit ECC error disable */
  64. #define DDR_EDI_MBED 0x8 /* multi-bit ECC error disable */
  65. /*
  66. * L2 Err defines
  67. */
  68. #define MPC85XX_L2_ERRINJHI 0x0000
  69. #define MPC85XX_L2_ERRINJLO 0x0004
  70. #define MPC85XX_L2_ERRINJCTL 0x0008
  71. #define MPC85XX_L2_CAPTDATAHI 0x0020
  72. #define MPC85XX_L2_CAPTDATALO 0x0024
  73. #define MPC85XX_L2_CAPTECC 0x0028
  74. #define MPC85XX_L2_ERRDET 0x0040
  75. #define MPC85XX_L2_ERRDIS 0x0044
  76. #define MPC85XX_L2_ERRINTEN 0x0048
  77. #define MPC85XX_L2_ERRATTR 0x004c
  78. #define MPC85XX_L2_ERRADDR 0x0050
  79. #define MPC85XX_L2_ERRCTL 0x0058
  80. /* Error Interrupt Enable */
  81. #define L2_EIE_L2CFGINTEN 0x1
  82. #define L2_EIE_SBECCINTEN 0x4
  83. #define L2_EIE_MBECCINTEN 0x8
  84. #define L2_EIE_TPARINTEN 0x10
  85. #define L2_EIE_MASK (L2_EIE_L2CFGINTEN | L2_EIE_SBECCINTEN | \
  86. L2_EIE_MBECCINTEN | L2_EIE_TPARINTEN)
  87. /* Error Detect */
  88. #define L2_EDE_L2CFGERR 0x1
  89. #define L2_EDE_SBECCERR 0x4
  90. #define L2_EDE_MBECCERR 0x8
  91. #define L2_EDE_TPARERR 0x10
  92. #define L2_EDE_MULL2ERR 0x80000000
  93. #define L2_EDE_CE_MASK L2_EDE_SBECCERR
  94. #define L2_EDE_UE_MASK (L2_EDE_L2CFGERR | L2_EDE_MBECCERR | \
  95. L2_EDE_TPARERR)
  96. #define L2_EDE_MASK (L2_EDE_L2CFGERR | L2_EDE_SBECCERR | \
  97. L2_EDE_MBECCERR | L2_EDE_TPARERR | L2_EDE_MULL2ERR)
  98. /*
  99. * PCI Err defines
  100. */
  101. #define PCI_EDE_TOE 0x00000001
  102. #define PCI_EDE_SCM 0x00000002
  103. #define PCI_EDE_IRMSV 0x00000004
  104. #define PCI_EDE_ORMSV 0x00000008
  105. #define PCI_EDE_OWMSV 0x00000010
  106. #define PCI_EDE_TGT_ABRT 0x00000020
  107. #define PCI_EDE_MST_ABRT 0x00000040
  108. #define PCI_EDE_TGT_PERR 0x00000080
  109. #define PCI_EDE_MST_PERR 0x00000100
  110. #define PCI_EDE_RCVD_SERR 0x00000200
  111. #define PCI_EDE_ADDR_PERR 0x00000400
  112. #define PCI_EDE_MULTI_ERR 0x80000000
  113. #define PCI_EDE_PERR_MASK (PCI_EDE_TGT_PERR | PCI_EDE_MST_PERR | \
  114. PCI_EDE_ADDR_PERR)
  115. #define MPC85XX_PCI_ERR_DR 0x0000
  116. #define MPC85XX_PCI_ERR_CAP_DR 0x0004
  117. #define MPC85XX_PCI_ERR_EN 0x0008
  118. #define MPC85XX_PCI_ERR_ATTRIB 0x000c
  119. #define MPC85XX_PCI_ERR_ADDR 0x0010
  120. #define MPC85XX_PCI_ERR_EXT_ADDR 0x0014
  121. #define MPC85XX_PCI_ERR_DL 0x0018
  122. #define MPC85XX_PCI_ERR_DH 0x001c
  123. #define MPC85XX_PCI_GAS_TIMR 0x0020
  124. #define MPC85XX_PCI_PCIX_TIMR 0x0024
  125. struct mpc85xx_mc_pdata {
  126. char *name;
  127. int edac_idx;
  128. void __iomem *mc_vbase;
  129. int irq;
  130. };
  131. struct mpc85xx_l2_pdata {
  132. char *name;
  133. int edac_idx;
  134. void __iomem *l2_vbase;
  135. int irq;
  136. };
  137. struct mpc85xx_pci_pdata {
  138. char *name;
  139. int edac_idx;
  140. void __iomem *pci_vbase;
  141. int irq;
  142. };
  143. #endif