/*1* amd8111_edac.h, EDAC defs for AMD8111 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 _AMD8111_EDAC_H_24#define _AMD8111_EDAC_H_2526/************************************************************27* PCI Bridge Status and Command Register, DevA:0x0428************************************************************/29#define REG_PCI_STSCMD 0x0430enum pci_stscmd_bits {31PCI_STSCMD_SSE = BIT(30),32PCI_STSCMD_RMA = BIT(29),33PCI_STSCMD_RTA = BIT(28),34PCI_STSCMD_SERREN = BIT(8),35PCI_STSCMD_CLEAR_MASK = (PCI_STSCMD_SSE |36PCI_STSCMD_RMA |37PCI_STSCMD_RTA)38};3940/************************************************************41* PCI Bridge Memory Base-Limit Register, DevA:0x1c42************************************************************/43#define REG_MEM_LIM 0x1c44enum mem_limit_bits {45MEM_LIMIT_DPE = BIT(31),46MEM_LIMIT_RSE = BIT(30),47MEM_LIMIT_RMA = BIT(29),48MEM_LIMIT_RTA = BIT(28),49MEM_LIMIT_STA = BIT(27),50MEM_LIMIT_MDPE = BIT(24),51MEM_LIMIT_CLEAR_MASK = (MEM_LIMIT_DPE |52MEM_LIMIT_RSE |53MEM_LIMIT_RMA |54MEM_LIMIT_RTA |55MEM_LIMIT_STA |56MEM_LIMIT_MDPE)57};5859/************************************************************60* HyperTransport Link Control Register, DevA:0xc461************************************************************/62#define REG_HT_LINK 0xc463enum ht_link_bits {64HT_LINK_LKFAIL = BIT(4),65HT_LINK_CRCFEN = BIT(1),66HT_LINK_CLEAR_MASK = (HT_LINK_LKFAIL)67};6869/************************************************************70* PCI Bridge Interrupt and Bridge Control, DevA:0x3c71************************************************************/72#define REG_PCI_INTBRG_CTRL 0x3c73enum pci_intbrg_ctrl_bits {74PCI_INTBRG_CTRL_DTSERREN = BIT(27),75PCI_INTBRG_CTRL_DTSTAT = BIT(26),76PCI_INTBRG_CTRL_MARSP = BIT(21),77PCI_INTBRG_CTRL_SERREN = BIT(17),78PCI_INTBRG_CTRL_PEREN = BIT(16),79PCI_INTBRG_CTRL_CLEAR_MASK = (PCI_INTBRG_CTRL_DTSTAT),80PCI_INTBRG_CTRL_POLL_MASK = (PCI_INTBRG_CTRL_DTSERREN |81PCI_INTBRG_CTRL_MARSP |82PCI_INTBRG_CTRL_SERREN)83};8485/************************************************************86* I/O Control 1 Register, DevB:0x4087************************************************************/88#define REG_IO_CTRL_1 0x4089enum io_ctrl_1_bits {90IO_CTRL_1_NMIONERR = BIT(7),91IO_CTRL_1_LPC_ERR = BIT(6),92IO_CTRL_1_PW2LPC = BIT(1),93IO_CTRL_1_CLEAR_MASK = (IO_CTRL_1_LPC_ERR | IO_CTRL_1_PW2LPC)94};9596/************************************************************97* Legacy I/O Space Registers98************************************************************/99#define REG_AT_COMPAT 0x61100enum at_compat_bits {101AT_COMPAT_SERR = BIT(7),102AT_COMPAT_IOCHK = BIT(6),103AT_COMPAT_CLRIOCHK = BIT(3),104AT_COMPAT_CLRSERR = BIT(2),105};106107struct amd8111_dev_info {108u16 err_dev; /* PCI Device ID */109struct pci_dev *dev;110int edac_idx; /* device index */111char *ctl_name;112struct edac_device_ctl_info *edac_dev;113void (*init)(struct amd8111_dev_info *dev_info);114void (*exit)(struct amd8111_dev_info *dev_info);115void (*check)(struct edac_device_ctl_info *edac_dev);116};117118struct amd8111_pci_info {119u16 err_dev; /* PCI Device ID */120struct pci_dev *dev;121int edac_idx; /* pci index */122const char *ctl_name;123struct edac_pci_ctl_info *edac_dev;124void (*init)(struct amd8111_pci_info *dev_info);125void (*exit)(struct amd8111_pci_info *dev_info);126void (*check)(struct edac_pci_ctl_info *edac_dev);127};128129#endif /* _AMD8111_EDAC_H_ */130131132