amd8131_edac.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*
  2. * amd8131_edac.h, EDAC defs for AMD8131 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 _AMD8131_EDAC_H_
  24. #define _AMD8131_EDAC_H_
  25. #define DEVFN_PCIX_BRIDGE_NORTH_A 8
  26. #define DEVFN_PCIX_BRIDGE_NORTH_B 16
  27. #define DEVFN_PCIX_BRIDGE_SOUTH_A 24
  28. #define DEVFN_PCIX_BRIDGE_SOUTH_B 32
  29. /************************************************************
  30. * PCI-X Bridge Status and Command Register, DevA:0x04
  31. ************************************************************/
  32. #define REG_STS_CMD 0x04
  33. enum sts_cmd_bits {
  34. STS_CMD_SSE = BIT(30),
  35. STS_CMD_SERREN = BIT(8)
  36. };
  37. /************************************************************
  38. * PCI-X Bridge Interrupt and Bridge Control Register,
  39. ************************************************************/
  40. #define REG_INT_CTLR 0x3c
  41. enum int_ctlr_bits {
  42. INT_CTLR_DTSE = BIT(27),
  43. INT_CTLR_DTS = BIT(26),
  44. INT_CTLR_SERR = BIT(17),
  45. INT_CTLR_PERR = BIT(16)
  46. };
  47. /************************************************************
  48. * PCI-X Bridge Memory Base-Limit Register, DevA:0x1C
  49. ************************************************************/
  50. #define REG_MEM_LIM 0x1c
  51. enum mem_limit_bits {
  52. MEM_LIMIT_DPE = BIT(31),
  53. MEM_LIMIT_RSE = BIT(30),
  54. MEM_LIMIT_RMA = BIT(29),
  55. MEM_LIMIT_RTA = BIT(28),
  56. MEM_LIMIT_STA = BIT(27),
  57. MEM_LIMIT_MDPE = BIT(24),
  58. MEM_LIMIT_MASK = MEM_LIMIT_DPE|MEM_LIMIT_RSE|MEM_LIMIT_RMA|
  59. MEM_LIMIT_RTA|MEM_LIMIT_STA|MEM_LIMIT_MDPE
  60. };
  61. /************************************************************
  62. * Link Configuration And Control Register, side A
  63. ************************************************************/
  64. #define REG_LNK_CTRL_A 0xc4
  65. /************************************************************
  66. * Link Configuration And Control Register, side B
  67. ************************************************************/
  68. #define REG_LNK_CTRL_B 0xc8
  69. enum lnk_ctrl_bits {
  70. LNK_CTRL_CRCERR_A = BIT(9),
  71. LNK_CTRL_CRCERR_B = BIT(8),
  72. LNK_CTRL_CRCFEN = BIT(1)
  73. };
  74. enum pcix_bridge_inst {
  75. NORTH_A = 0,
  76. NORTH_B = 1,
  77. SOUTH_A = 2,
  78. SOUTH_B = 3,
  79. NO_BRIDGE = 4
  80. };
  81. struct amd8131_dev_info {
  82. int devfn;
  83. enum pcix_bridge_inst inst;
  84. struct pci_dev *dev;
  85. int edac_idx; /* pci device index */
  86. char *ctl_name;
  87. struct edac_pci_ctl_info *edac_dev;
  88. };
  89. /*
  90. * AMD8131 chipset has two pairs of PCIX Bridge and related IOAPIC
  91. * Controller, and ATCA-6101 has two AMD8131 chipsets, so there are
  92. * four PCIX Bridges on ATCA-6101 altogether.
  93. *
  94. * These PCIX Bridges share the same PCI Device ID and are all of
  95. * Function Zero, they could be discrimated by their pci_dev->devfn.
  96. * They share the same set of init/check/exit methods, and their
  97. * private structures are collected in the devices[] array.
  98. */
  99. struct amd8131_info {
  100. u16 err_dev; /* PCI Device ID for AMD8131 APIC*/
  101. struct amd8131_dev_info *devices;
  102. void (*init)(struct amd8131_dev_info *dev_info);
  103. void (*exit)(struct amd8131_dev_info *dev_info);
  104. void (*check)(struct edac_pci_ctl_info *edac_dev);
  105. };
  106. #endif /* _AMD8131_EDAC_H_ */