diff options
author | Huang, Xiong <xiong@qca.qualcomm.com> | 2012-04-18 18:01:25 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-19 20:14:20 -0400 |
commit | 95f9aea76943af35b4720c61d27fa09c30f237dd (patch) | |
tree | 8aa157031829ab400edf756bdb6b591afbf7ea59 | |
parent | 9c277d848d0fc21936e615b9ba4463604f684e5d (diff) |
atl1c: clear PCIE error status in atl1c_reset_pcie
clear PCIE error status (error log is write-1-clear).
REG_PCIE_UC_SEVERITY is removed as it's a standard pcie register,
and using kernle API to access it.
Signed-off-by: xiong <xiong@qca.qualcomm.com>
Tested-by: Liu David <dwliu@qca.qualcomm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/atheros/atl1c/atl1c_hw.h | 13 | ||||
-rw-r--r-- | drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 15 |
2 files changed, 11 insertions, 17 deletions
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_hw.h b/drivers/net/ethernet/atheros/atl1c/atl1c_hw.h index c9c678213107..6d73ac92db94 100644 --- a/drivers/net/ethernet/atheros/atl1c/atl1c_hw.h +++ b/drivers/net/ethernet/atheros/atl1c/atl1c_hw.h | |||
@@ -61,19 +61,6 @@ int atl1c_phy_power_saving(struct atl1c_hw *hw); | |||
61 | #define LINK_CTRL_L1_EN 0x02 | 61 | #define LINK_CTRL_L1_EN 0x02 |
62 | #define LINK_CTRL_EXT_SYNC 0x80 | 62 | #define LINK_CTRL_EXT_SYNC 0x80 |
63 | 63 | ||
64 | #define REG_PCIE_UC_SEVERITY 0x10C | ||
65 | #define PCIE_UC_SERVRITY_TRN 0x00000001 | ||
66 | #define PCIE_UC_SERVRITY_DLP 0x00000010 | ||
67 | #define PCIE_UC_SERVRITY_PSN_TLP 0x00001000 | ||
68 | #define PCIE_UC_SERVRITY_FCP 0x00002000 | ||
69 | #define PCIE_UC_SERVRITY_CPL_TO 0x00004000 | ||
70 | #define PCIE_UC_SERVRITY_CA 0x00008000 | ||
71 | #define PCIE_UC_SERVRITY_UC 0x00010000 | ||
72 | #define PCIE_UC_SERVRITY_ROV 0x00020000 | ||
73 | #define PCIE_UC_SERVRITY_MLFP 0x00040000 | ||
74 | #define PCIE_UC_SERVRITY_ECRC 0x00080000 | ||
75 | #define PCIE_UC_SERVRITY_UR 0x00100000 | ||
76 | |||
77 | #define REG_DEV_SERIALNUM_CTRL 0x200 | 64 | #define REG_DEV_SERIALNUM_CTRL 0x200 |
78 | #define REG_DEV_MAC_SEL_MASK 0x0 /* 0:EUI; 1:MAC */ | 65 | #define REG_DEV_MAC_SEL_MASK 0x0 /* 0:EUI; 1:MAC */ |
79 | #define REG_DEV_MAC_SEL_SHIFT 0 | 66 | #define REG_DEV_MAC_SEL_SHIFT 0 |
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c index 12b47258960b..729381ac8d1e 100644 --- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c +++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c | |||
@@ -108,6 +108,7 @@ static void atl1c_reset_pcie(struct atl1c_hw *hw, u32 flag) | |||
108 | u32 data; | 108 | u32 data; |
109 | u32 pci_cmd; | 109 | u32 pci_cmd; |
110 | struct pci_dev *pdev = hw->adapter->pdev; | 110 | struct pci_dev *pdev = hw->adapter->pdev; |
111 | int pos; | ||
111 | 112 | ||
112 | AT_READ_REG(hw, PCI_COMMAND, &pci_cmd); | 113 | AT_READ_REG(hw, PCI_COMMAND, &pci_cmd); |
113 | pci_cmd &= ~PCI_COMMAND_INTX_DISABLE; | 114 | pci_cmd &= ~PCI_COMMAND_INTX_DISABLE; |
@@ -124,10 +125,16 @@ static void atl1c_reset_pcie(struct atl1c_hw *hw, u32 flag) | |||
124 | /* | 125 | /* |
125 | * Mask some pcie error bits | 126 | * Mask some pcie error bits |
126 | */ | 127 | */ |
127 | AT_READ_REG(hw, REG_PCIE_UC_SEVERITY, &data); | 128 | pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_ERR); |
128 | data &= ~PCIE_UC_SERVRITY_DLP; | 129 | pci_read_config_dword(pdev, pos + PCI_ERR_UNCOR_SEVER, &data); |
129 | data &= ~PCIE_UC_SERVRITY_FCP; | 130 | data &= ~(PCI_ERR_UNC_DLP | PCI_ERR_UNC_FCP); |
130 | AT_WRITE_REG(hw, REG_PCIE_UC_SEVERITY, data); | 131 | pci_write_config_dword(pdev, pos + PCI_ERR_UNCOR_SEVER, data); |
132 | /* clear error status */ | ||
133 | pci_write_config_word(pdev, pci_pcie_cap(pdev) + PCI_EXP_DEVSTA, | ||
134 | PCI_EXP_DEVSTA_NFED | | ||
135 | PCI_EXP_DEVSTA_FED | | ||
136 | PCI_EXP_DEVSTA_CED | | ||
137 | PCI_EXP_DEVSTA_URD); | ||
131 | 138 | ||
132 | AT_READ_REG(hw, REG_LTSSM_ID_CTRL, &data); | 139 | AT_READ_REG(hw, REG_LTSSM_ID_CTRL, &data); |
133 | data &= ~LTSSM_ID_EN_WRO; | 140 | data &= ~LTSSM_ID_EN_WRO; |