amd8111_edac.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /*
  2. * amd8111_edac.h, EDAC defs for AMD8111 hypertransport chip
  3. *
  4. * Copyright (c) 2008 Wind River Systems, Inc.
  5. *
  6. * Authors: Cao Qingtao <qingtao.cao@windriver.com>
  7. * Benjamin Walsh <benjamin.walsh@windriver.com>
  8. * Hu Yongqi <yongqi.hu@windriver.com>
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2 as
  12. * published by the Free Software Foundation.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  17. * See the GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  22. */
  23. #ifndef _AMD8111_EDAC_H_
  24. #define _AMD8111_EDAC_H_
  25. /************************************************************
  26. * PCI Bridge Status and Command Register, DevA:0x04
  27. ************************************************************/
  28. #define REG_PCI_STSCMD 0x04
  29. enum pci_stscmd_bits {
  30. PCI_STSCMD_SSE = BIT(30),
  31. PCI_STSCMD_RMA = BIT(29),
  32. PCI_STSCMD_RTA = BIT(28),
  33. PCI_STSCMD_SERREN = BIT(8),
  34. PCI_STSCMD_CLEAR_MASK = (PCI_STSCMD_SSE |
  35. PCI_STSCMD_RMA |
  36. PCI_STSCMD_RTA)
  37. };
  38. /************************************************************
  39. * PCI Bridge Memory Base-Limit Register, DevA:0x1c
  40. ************************************************************/
  41. #define REG_MEM_LIM 0x1c
  42. enum mem_limit_bits {
  43. MEM_LIMIT_DPE = BIT(31),
  44. MEM_LIMIT_RSE = BIT(30),
  45. MEM_LIMIT_RMA = BIT(29),
  46. MEM_LIMIT_RTA = BIT(28),
  47. MEM_LIMIT_STA = BIT(27),
  48. MEM_LIMIT_MDPE = BIT(24),
  49. MEM_LIMIT_CLEAR_MASK = (MEM_LIMIT_DPE |
  50. MEM_LIMIT_RSE |
  51. MEM_LIMIT_RMA |
  52. MEM_LIMIT_RTA |
  53. MEM_LIMIT_STA |
  54. MEM_LIMIT_MDPE)
  55. };
  56. /************************************************************
  57. * HyperTransport Link Control Register, DevA:0xc4
  58. ************************************************************/
  59. #define REG_HT_LINK 0xc4
  60. enum ht_link_bits {
  61. HT_LINK_LKFAIL = BIT(4),
  62. HT_LINK_CRCFEN = BIT(1),
  63. HT_LINK_CLEAR_MASK = (HT_LINK_LKFAIL)
  64. };
  65. /************************************************************
  66. * PCI Bridge Interrupt and Bridge Control, DevA:0x3c
  67. ************************************************************/
  68. #define REG_PCI_INTBRG_CTRL 0x3c
  69. enum pci_intbrg_ctrl_bits {
  70. PCI_INTBRG_CTRL_DTSERREN = BIT(27),
  71. PCI_INTBRG_CTRL_DTSTAT = BIT(26),
  72. PCI_INTBRG_CTRL_MARSP = BIT(21),
  73. PCI_INTBRG_CTRL_SERREN = BIT(17),
  74. PCI_INTBRG_CTRL_PEREN = BIT(16),
  75. PCI_INTBRG_CTRL_CLEAR_MASK = (PCI_INTBRG_CTRL_DTSTAT),
  76. PCI_INTBRG_CTRL_POLL_MASK = (PCI_INTBRG_CTRL_DTSERREN |
  77. PCI_INTBRG_CTRL_MARSP |
  78. PCI_INTBRG_CTRL_SERREN)
  79. };
  80. /************************************************************
  81. * I/O Control 1 Register, DevB:0x40
  82. ************************************************************/
  83. #define REG_IO_CTRL_1 0x40
  84. enum io_ctrl_1_bits {
  85. IO_CTRL_1_NMIONERR = BIT(7),
  86. IO_CTRL_1_LPC_ERR = BIT(6),
  87. IO_CTRL_1_PW2LPC = BIT(1),
  88. IO_CTRL_1_CLEAR_MASK = (IO_CTRL_1_LPC_ERR | IO_CTRL_1_PW2LPC)
  89. };
  90. /************************************************************
  91. * Legacy I/O Space Registers
  92. ************************************************************/
  93. #define REG_AT_COMPAT 0x61
  94. enum at_compat_bits {
  95. AT_COMPAT_SERR = BIT(7),
  96. AT_COMPAT_IOCHK = BIT(6),
  97. AT_COMPAT_CLRIOCHK = BIT(3),
  98. AT_COMPAT_CLRSERR = BIT(2),
  99. };
  100. struct amd8111_dev_info {
  101. u16 err_dev; /* PCI Device ID */
  102. struct pci_dev *dev;
  103. int edac_idx; /* device index */
  104. char *ctl_name;
  105. struct edac_device_ctl_info *edac_dev;
  106. void (*init)(struct amd8111_dev_info *dev_info);
  107. void (*exit)(struct amd8111_dev_info *dev_info);
  108. void (*check)(struct edac_device_ctl_info *edac_dev);
  109. };
  110. struct amd8111_pci_info {
  111. u16 err_dev; /* PCI Device ID */
  112. struct pci_dev *dev;
  113. int edac_idx; /* pci index */
  114. const char *ctl_name;
  115. struct edac_pci_ctl_info *edac_dev;
  116. void (*init)(struct amd8111_pci_info *dev_info);
  117. void (*exit)(struct amd8111_pci_info *dev_info);
  118. void (*check)(struct edac_pci_ctl_info *edac_dev);
  119. };
  120. #endif /* _AMD8111_EDAC_H_ */