diff options
author | stephen hemminger <shemminger@vyatta.com> | 2009-12-14 03:50:12 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-15 01:07:15 -0500 |
commit | 166a0fd4c788ec7f10ca8194ec6d526afa12db75 (patch) | |
tree | 1e1946b77e56f2907bd197633624fbd1bc45847f /drivers | |
parent | dae3a5112d258764cad9e48439ca7dd05c2edca1 (diff) |
sky2: leave PCI config space writeable
Since power management is done by PCI subsystem as well as driver,
don't toggle the bit that disables PCI register writes.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/sky2.c | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 9431f642beb0..1c01b96c9611 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -644,7 +644,6 @@ static void sky2_phy_power_up(struct sky2_hw *hw, unsigned port) | |||
644 | { | 644 | { |
645 | u32 reg1; | 645 | u32 reg1; |
646 | 646 | ||
647 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON); | ||
648 | reg1 = sky2_pci_read32(hw, PCI_DEV_REG1); | 647 | reg1 = sky2_pci_read32(hw, PCI_DEV_REG1); |
649 | reg1 &= ~phy_power[port]; | 648 | reg1 &= ~phy_power[port]; |
650 | 649 | ||
@@ -652,7 +651,6 @@ static void sky2_phy_power_up(struct sky2_hw *hw, unsigned port) | |||
652 | reg1 |= coma_mode[port]; | 651 | reg1 |= coma_mode[port]; |
653 | 652 | ||
654 | sky2_pci_write32(hw, PCI_DEV_REG1, reg1); | 653 | sky2_pci_write32(hw, PCI_DEV_REG1, reg1); |
655 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF); | ||
656 | sky2_pci_read32(hw, PCI_DEV_REG1); | 654 | sky2_pci_read32(hw, PCI_DEV_REG1); |
657 | 655 | ||
658 | if (hw->chip_id == CHIP_ID_YUKON_FE) | 656 | if (hw->chip_id == CHIP_ID_YUKON_FE) |
@@ -709,11 +707,9 @@ static void sky2_phy_power_down(struct sky2_hw *hw, unsigned port) | |||
709 | gm_phy_write(hw, port, PHY_MARV_CTRL, PHY_CT_PDOWN); | 707 | gm_phy_write(hw, port, PHY_MARV_CTRL, PHY_CT_PDOWN); |
710 | } | 708 | } |
711 | 709 | ||
712 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON); | ||
713 | reg1 = sky2_pci_read32(hw, PCI_DEV_REG1); | 710 | reg1 = sky2_pci_read32(hw, PCI_DEV_REG1); |
714 | reg1 |= phy_power[port]; /* set PHY to PowerDown/COMA Mode */ | 711 | reg1 |= phy_power[port]; /* set PHY to PowerDown/COMA Mode */ |
715 | sky2_pci_write32(hw, PCI_DEV_REG1, reg1); | 712 | sky2_pci_write32(hw, PCI_DEV_REG1, reg1); |
716 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF); | ||
717 | } | 713 | } |
718 | 714 | ||
719 | /* Force a renegotiation */ | 715 | /* Force a renegotiation */ |
@@ -2152,9 +2148,7 @@ static void sky2_qlink_intr(struct sky2_hw *hw) | |||
2152 | 2148 | ||
2153 | /* reset PHY Link Detect */ | 2149 | /* reset PHY Link Detect */ |
2154 | phy = sky2_pci_read16(hw, PSM_CONFIG_REG4); | 2150 | phy = sky2_pci_read16(hw, PSM_CONFIG_REG4); |
2155 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON); | ||
2156 | sky2_pci_write16(hw, PSM_CONFIG_REG4, phy | 1); | 2151 | sky2_pci_write16(hw, PSM_CONFIG_REG4, phy | 1); |
2157 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF); | ||
2158 | 2152 | ||
2159 | sky2_link_up(sky2); | 2153 | sky2_link_up(sky2); |
2160 | } | 2154 | } |
@@ -2645,7 +2639,6 @@ static void sky2_hw_intr(struct sky2_hw *hw) | |||
2645 | if (status & (Y2_IS_MST_ERR | Y2_IS_IRQ_STAT)) { | 2639 | if (status & (Y2_IS_MST_ERR | Y2_IS_IRQ_STAT)) { |
2646 | u16 pci_err; | 2640 | u16 pci_err; |
2647 | 2641 | ||
2648 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON); | ||
2649 | pci_err = sky2_pci_read16(hw, PCI_STATUS); | 2642 | pci_err = sky2_pci_read16(hw, PCI_STATUS); |
2650 | if (net_ratelimit()) | 2643 | if (net_ratelimit()) |
2651 | dev_err(&pdev->dev, "PCI hardware error (0x%x)\n", | 2644 | dev_err(&pdev->dev, "PCI hardware error (0x%x)\n", |
@@ -2653,14 +2646,12 @@ static void sky2_hw_intr(struct sky2_hw *hw) | |||
2653 | 2646 | ||
2654 | sky2_pci_write16(hw, PCI_STATUS, | 2647 | sky2_pci_write16(hw, PCI_STATUS, |
2655 | pci_err | PCI_STATUS_ERROR_BITS); | 2648 | pci_err | PCI_STATUS_ERROR_BITS); |
2656 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF); | ||
2657 | } | 2649 | } |
2658 | 2650 | ||
2659 | if (status & Y2_IS_PCI_EXP) { | 2651 | if (status & Y2_IS_PCI_EXP) { |
2660 | /* PCI-Express uncorrectable Error occurred */ | 2652 | /* PCI-Express uncorrectable Error occurred */ |
2661 | u32 err; | 2653 | u32 err; |
2662 | 2654 | ||
2663 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON); | ||
2664 | err = sky2_read32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS); | 2655 | err = sky2_read32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS); |
2665 | sky2_write32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS, | 2656 | sky2_write32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS, |
2666 | 0xfffffffful); | 2657 | 0xfffffffful); |
@@ -2668,7 +2659,6 @@ static void sky2_hw_intr(struct sky2_hw *hw) | |||
2668 | dev_err(&pdev->dev, "PCI Express error (0x%x)\n", err); | 2659 | dev_err(&pdev->dev, "PCI Express error (0x%x)\n", err); |
2669 | 2660 | ||
2670 | sky2_read32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS); | 2661 | sky2_read32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS); |
2671 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF); | ||
2672 | } | 2662 | } |
2673 | 2663 | ||
2674 | if (status & Y2_HWE_L1_MASK) | 2664 | if (status & Y2_HWE_L1_MASK) |
@@ -3047,7 +3037,6 @@ static void sky2_reset(struct sky2_hw *hw) | |||
3047 | } | 3037 | } |
3048 | 3038 | ||
3049 | sky2_power_on(hw); | 3039 | sky2_power_on(hw); |
3050 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF); | ||
3051 | 3040 | ||
3052 | for (i = 0; i < hw->ports; i++) { | 3041 | for (i = 0; i < hw->ports; i++) { |
3053 | sky2_write8(hw, SK_REG(i, GMAC_LINK_CTRL), GMLC_RST_SET); | 3042 | sky2_write8(hw, SK_REG(i, GMAC_LINK_CTRL), GMLC_RST_SET); |
@@ -3084,7 +3073,6 @@ static void sky2_reset(struct sky2_hw *hw) | |||
3084 | reg <<= PSM_CONFIG_REG4_TIMER_PHY_LINK_DETECT_BASE; | 3073 | reg <<= PSM_CONFIG_REG4_TIMER_PHY_LINK_DETECT_BASE; |
3085 | 3074 | ||
3086 | /* reset PHY Link Detect */ | 3075 | /* reset PHY Link Detect */ |
3087 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON); | ||
3088 | sky2_pci_write16(hw, PSM_CONFIG_REG4, | 3076 | sky2_pci_write16(hw, PSM_CONFIG_REG4, |
3089 | reg | PSM_CONFIG_REG4_RST_PHY_LINK_DETECT); | 3077 | reg | PSM_CONFIG_REG4_RST_PHY_LINK_DETECT); |
3090 | sky2_pci_write16(hw, PSM_CONFIG_REG4, reg); | 3078 | sky2_pci_write16(hw, PSM_CONFIG_REG4, reg); |
@@ -3102,7 +3090,6 @@ static void sky2_reset(struct sky2_hw *hw) | |||
3102 | /* restore the PCIe Link Control register */ | 3090 | /* restore the PCIe Link Control register */ |
3103 | sky2_pci_write16(hw, cap + PCI_EXP_LNKCTL, reg); | 3091 | sky2_pci_write16(hw, cap + PCI_EXP_LNKCTL, reg); |
3104 | } | 3092 | } |
3105 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF); | ||
3106 | 3093 | ||
3107 | /* re-enable PEX PM in PEX PHY debug reg. 8 (clear bit 12) */ | 3094 | /* re-enable PEX PM in PEX PHY debug reg. 8 (clear bit 12) */ |
3108 | sky2_write32(hw, Y2_PEX_PHY_DATA, PEX_DB_ACCESS | (0x08UL << 16)); | 3095 | sky2_write32(hw, Y2_PEX_PHY_DATA, PEX_DB_ACCESS | (0x08UL << 16)); |