aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-10-09 17:40:38 -0400
committerJeff Garzik <jeff@garzik.org>2006-10-11 04:07:45 -0400
commit7bd656d12119708b37414bf909ab2995473da818 (patch)
treeef32cd6d47d0f3eef843fd239be6f660c0cc0af6 /drivers/net
parent370de6cdc2ed27c41b313c031e4258ffa32272bc (diff)
[PATCH] sky2: revert pci express extensions
The pci express error handling extensions don't work unless PCI access is via mmconfig. Otherwise, all accesses to pci config registers greater than 256 fail. Since the sky2 driver has other ways of getting to PCI config space, it works around this short coming, but the pci_find_ext_capablity doesn't work. This backs out commit 91aeb3edbcf4e6ed72d138ac8c22fd68e6d717c3 Go back to hardcoding, since we know where the error registers are anyway. Fixes http://bugzilla.kernel.org/show_bug.cgi?id=7222 Signed-off-by: Stephen Hemminger <shemmminger@osdl.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/sky2.c30
-rw-r--r--drivers/net/sky2.h45
2 files changed, 51 insertions, 24 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 5a5289b7a885..1f91f30f4c6d 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -2220,8 +2220,7 @@ static void sky2_hw_intr(struct sky2_hw *hw)
2220 /* PCI-Express uncorrectable Error occurred */ 2220 /* PCI-Express uncorrectable Error occurred */
2221 u32 pex_err; 2221 u32 pex_err;
2222 2222
2223 pex_err = sky2_pci_read32(hw, 2223 pex_err = sky2_pci_read32(hw, PEX_UNC_ERR_STAT);
2224 hw->err_cap + PCI_ERR_UNCOR_STATUS);
2225 2224
2226 if (net_ratelimit()) 2225 if (net_ratelimit())
2227 printk(KERN_ERR PFX "%s: pci express error (0x%x)\n", 2226 printk(KERN_ERR PFX "%s: pci express error (0x%x)\n",
@@ -2229,20 +2228,15 @@ static void sky2_hw_intr(struct sky2_hw *hw)
2229 2228
2230 /* clear the interrupt */ 2229 /* clear the interrupt */
2231 sky2_write32(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON); 2230 sky2_write32(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
2232 sky2_pci_write32(hw, 2231 sky2_pci_write32(hw, PEX_UNC_ERR_STAT,
2233 hw->err_cap + PCI_ERR_UNCOR_STATUS, 2232 0xffffffffUL);
2234 0xffffffffUL);
2235 sky2_write32(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF); 2233 sky2_write32(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
2236 2234
2237 2235 if (pex_err & PEX_FATAL_ERRORS) {
2238 /* In case of fatal error mask off to keep from getting stuck */
2239 if (pex_err & (PCI_ERR_UNC_POISON_TLP | PCI_ERR_UNC_FCP
2240 | PCI_ERR_UNC_DLP)) {
2241 u32 hwmsk = sky2_read32(hw, B0_HWE_IMSK); 2236 u32 hwmsk = sky2_read32(hw, B0_HWE_IMSK);
2242 hwmsk &= ~Y2_IS_PCI_EXP; 2237 hwmsk &= ~Y2_IS_PCI_EXP;
2243 sky2_write32(hw, B0_HWE_IMSK, hwmsk); 2238 sky2_write32(hw, B0_HWE_IMSK, hwmsk);
2244 } 2239 }
2245
2246 } 2240 }
2247 2241
2248 if (status & Y2_HWE_L1_MASK) 2242 if (status & Y2_HWE_L1_MASK)
@@ -2423,7 +2417,6 @@ static int sky2_reset(struct sky2_hw *hw)
2423 u16 status; 2417 u16 status;
2424 u8 t8; 2418 u8 t8;
2425 int i; 2419 int i;
2426 u32 msk;
2427 2420
2428 sky2_write8(hw, B0_CTST, CS_RST_CLR); 2421 sky2_write8(hw, B0_CTST, CS_RST_CLR);
2429 2422
@@ -2464,13 +2457,9 @@ static int sky2_reset(struct sky2_hw *hw)
2464 sky2_write8(hw, B0_CTST, CS_MRST_CLR); 2457 sky2_write8(hw, B0_CTST, CS_MRST_CLR);
2465 2458
2466 /* clear any PEX errors */ 2459 /* clear any PEX errors */
2467 if (pci_find_capability(hw->pdev, PCI_CAP_ID_EXP)) { 2460 if (pci_find_capability(hw->pdev, PCI_CAP_ID_EXP))
2468 hw->err_cap = pci_find_ext_capability(hw->pdev, PCI_EXT_CAP_ID_ERR); 2461 sky2_pci_write32(hw, PEX_UNC_ERR_STAT, 0xffffffffUL);
2469 if (hw->err_cap) 2462
2470 sky2_pci_write32(hw,
2471 hw->err_cap + PCI_ERR_UNCOR_STATUS,
2472 0xffffffffUL);
2473 }
2474 2463
2475 hw->pmd_type = sky2_read8(hw, B2_PMD_TYP); 2464 hw->pmd_type = sky2_read8(hw, B2_PMD_TYP);
2476 hw->ports = 1; 2465 hw->ports = 1;
@@ -2527,10 +2516,7 @@ static int sky2_reset(struct sky2_hw *hw)
2527 sky2_write8(hw, RAM_BUFFER(i, B3_RI_RTO_XS2), SK_RI_TO_53); 2516 sky2_write8(hw, RAM_BUFFER(i, B3_RI_RTO_XS2), SK_RI_TO_53);
2528 } 2517 }
2529 2518
2530 msk = Y2_HWE_ALL_MASK; 2519 sky2_write32(hw, B0_HWE_IMSK, Y2_HWE_ALL_MASK);
2531 if (!hw->err_cap)
2532 msk &= ~Y2_IS_PCI_EXP;
2533 sky2_write32(hw, B0_HWE_IMSK, msk);
2534 2520
2535 for (i = 0; i < hw->ports; i++) 2521 for (i = 0; i < hw->ports; i++)
2536 sky2_gmac_reset(hw, i); 2522 sky2_gmac_reset(hw, i);
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h
index f66109a96d95..43d2accf60e1 100644
--- a/drivers/net/sky2.h
+++ b/drivers/net/sky2.h
@@ -6,15 +6,24 @@
6 6
7#define ETH_JUMBO_MTU 9000 /* Maximum MTU supported */ 7#define ETH_JUMBO_MTU 9000 /* Maximum MTU supported */
8 8
9/* PCI device specific config registers */ 9/* PCI config registers */
10enum { 10enum {
11 PCI_DEV_REG1 = 0x40, 11 PCI_DEV_REG1 = 0x40,
12 PCI_DEV_REG2 = 0x44, 12 PCI_DEV_REG2 = 0x44,
13 PCI_DEV_STATUS = 0x7c,
13 PCI_DEV_REG3 = 0x80, 14 PCI_DEV_REG3 = 0x80,
14 PCI_DEV_REG4 = 0x84, 15 PCI_DEV_REG4 = 0x84,
15 PCI_DEV_REG5 = 0x88, 16 PCI_DEV_REG5 = 0x88,
16}; 17};
17 18
19enum {
20 PEX_DEV_CAP = 0xe4,
21 PEX_DEV_CTRL = 0xe8,
22 PEX_DEV_STA = 0xea,
23 PEX_LNK_STAT = 0xf2,
24 PEX_UNC_ERR_STAT= 0x104,
25};
26
18/* Yukon-2 */ 27/* Yukon-2 */
19enum pci_dev_reg_1 { 28enum pci_dev_reg_1 {
20 PCI_Y2_PIG_ENA = 1<<31, /* Enable Plug-in-Go (YUKON-2) */ 29 PCI_Y2_PIG_ENA = 1<<31, /* Enable Plug-in-Go (YUKON-2) */
@@ -63,6 +72,39 @@ enum pci_dev_reg_4 {
63 PCI_STATUS_REC_MASTER_ABORT | \ 72 PCI_STATUS_REC_MASTER_ABORT | \
64 PCI_STATUS_REC_TARGET_ABORT | \ 73 PCI_STATUS_REC_TARGET_ABORT | \
65 PCI_STATUS_PARITY) 74 PCI_STATUS_PARITY)
75
76enum pex_dev_ctrl {
77 PEX_DC_MAX_RRS_MSK = 7<<12, /* Bit 14..12: Max. Read Request Size */
78 PEX_DC_EN_NO_SNOOP = 1<<11,/* Enable No Snoop */
79 PEX_DC_EN_AUX_POW = 1<<10,/* Enable AUX Power */
80 PEX_DC_EN_PHANTOM = 1<<9, /* Enable Phantom Functions */
81 PEX_DC_EN_EXT_TAG = 1<<8, /* Enable Extended Tag Field */
82 PEX_DC_MAX_PLS_MSK = 7<<5, /* Bit 7.. 5: Max. Payload Size Mask */
83 PEX_DC_EN_REL_ORD = 1<<4, /* Enable Relaxed Ordering */
84 PEX_DC_EN_UNS_RQ_RP = 1<<3, /* Enable Unsupported Request Reporting */
85 PEX_DC_EN_FAT_ER_RP = 1<<2, /* Enable Fatal Error Reporting */
86 PEX_DC_EN_NFA_ER_RP = 1<<1, /* Enable Non-Fatal Error Reporting */
87 PEX_DC_EN_COR_ER_RP = 1<<0, /* Enable Correctable Error Reporting */
88};
89#define PEX_DC_MAX_RD_RQ_SIZE(x) (((x)<<12) & PEX_DC_MAX_RRS_MSK)
90
91/* PEX_UNC_ERR_STAT PEX Uncorrectable Errors Status Register (Yukon-2) */
92enum pex_err {
93 PEX_UNSUP_REQ = 1<<20, /* Unsupported Request Error */
94
95 PEX_MALFOR_TLP = 1<<18, /* Malformed TLP */
96
97 PEX_UNEXP_COMP = 1<<16, /* Unexpected Completion */
98
99 PEX_COMP_TO = 1<<14, /* Completion Timeout */
100 PEX_FLOW_CTRL_P = 1<<13, /* Flow Control Protocol Error */
101 PEX_POIS_TLP = 1<<12, /* Poisoned TLP */
102
103 PEX_DATA_LINK_P = 1<<4, /* Data Link Protocol Error */
104 PEX_FATAL_ERRORS= (PEX_MALFOR_TLP | PEX_FLOW_CTRL_P | PEX_DATA_LINK_P),
105};
106
107
66enum csr_regs { 108enum csr_regs {
67 B0_RAP = 0x0000, 109 B0_RAP = 0x0000,
68 B0_CTST = 0x0004, 110 B0_CTST = 0x0004,
@@ -1836,7 +1878,6 @@ struct sky2_hw {
1836 struct net_device *dev[2]; 1878 struct net_device *dev[2];
1837 1879
1838 int pm_cap; 1880 int pm_cap;
1839 int err_cap;
1840 u8 chip_id; 1881 u8 chip_id;
1841 u8 chip_rev; 1882 u8 chip_rev;
1842 u8 pmd_type; 1883 u8 pmd_type;