/*1* amd8131_edac.h, EDAC defs for AMD8131 hypertransport chip2*3* Copyright (c) 2008 Wind River Systems, Inc.4*5* Authors: Cao Qingtao <[email protected]>6* Benjamin Walsh <[email protected]>7* Hu Yongqi <[email protected]>8*9* This program is free software; you can redistribute it and/or modify10* it under the terms of the GNU General Public License version 2 as11* published by the Free Software Foundation.12*13* This program is distributed in the hope that it will be useful,14* but WITHOUT ANY WARRANTY; without even the implied warranty of15* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.16* See the GNU General Public License for more details.17*18* You should have received a copy of the GNU General Public License19* along with this program; if not, write to the Free Software20* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA21*/2223#ifndef _AMD8131_EDAC_H_24#define _AMD8131_EDAC_H_2526#define DEVFN_PCIX_BRIDGE_NORTH_A 827#define DEVFN_PCIX_BRIDGE_NORTH_B 1628#define DEVFN_PCIX_BRIDGE_SOUTH_A 2429#define DEVFN_PCIX_BRIDGE_SOUTH_B 323031/************************************************************32* PCI-X Bridge Status and Command Register, DevA:0x0433************************************************************/34#define REG_STS_CMD 0x0435enum sts_cmd_bits {36STS_CMD_SSE = BIT(30),37STS_CMD_SERREN = BIT(8)38};3940/************************************************************41* PCI-X Bridge Interrupt and Bridge Control Register,42************************************************************/43#define REG_INT_CTLR 0x3c44enum int_ctlr_bits {45INT_CTLR_DTSE = BIT(27),46INT_CTLR_DTS = BIT(26),47INT_CTLR_SERR = BIT(17),48INT_CTLR_PERR = BIT(16)49};5051/************************************************************52* PCI-X Bridge Memory Base-Limit Register, DevA:0x1C53************************************************************/54#define REG_MEM_LIM 0x1c55enum mem_limit_bits {56MEM_LIMIT_DPE = BIT(31),57MEM_LIMIT_RSE = BIT(30),58MEM_LIMIT_RMA = BIT(29),59MEM_LIMIT_RTA = BIT(28),60MEM_LIMIT_STA = BIT(27),61MEM_LIMIT_MDPE = BIT(24),62MEM_LIMIT_MASK = MEM_LIMIT_DPE|MEM_LIMIT_RSE|MEM_LIMIT_RMA|63MEM_LIMIT_RTA|MEM_LIMIT_STA|MEM_LIMIT_MDPE64};6566/************************************************************67* Link Configuration And Control Register, side A68************************************************************/69#define REG_LNK_CTRL_A 0xc47071/************************************************************72* Link Configuration And Control Register, side B73************************************************************/74#define REG_LNK_CTRL_B 0xc87576enum lnk_ctrl_bits {77LNK_CTRL_CRCERR_A = BIT(9),78LNK_CTRL_CRCERR_B = BIT(8),79LNK_CTRL_CRCFEN = BIT(1)80};8182enum pcix_bridge_inst {83NORTH_A = 0,84NORTH_B = 1,85SOUTH_A = 2,86SOUTH_B = 3,87NO_BRIDGE = 488};8990struct amd8131_dev_info {91int devfn;92enum pcix_bridge_inst inst;93struct pci_dev *dev;94int edac_idx; /* pci device index */95char *ctl_name;96struct edac_pci_ctl_info *edac_dev;97};9899/*100* AMD8131 chipset has two pairs of PCIX Bridge and related IOAPIC101* Controller, and ATCA-6101 has two AMD8131 chipsets, so there are102* four PCIX Bridges on ATCA-6101 altogether.103*104* These PCIX Bridges share the same PCI Device ID and are all of105* Function Zero, they could be discrimated by their pci_dev->devfn.106* They share the same set of init/check/exit methods, and their107* private structures are collected in the devices[] array.108*/109struct amd8131_info {110u16 err_dev; /* PCI Device ID for AMD8131 APIC*/111struct amd8131_dev_info *devices;112void (*init)(struct amd8131_dev_info *dev_info);113void (*exit)(struct amd8131_dev_info *dev_info);114void (*check)(struct edac_pci_ctl_info *edac_dev);115};116117#endif /* _AMD8131_EDAC_H_ */118119120121