diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2005-09-23 12:08:30 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-09-23 19:07:12 -0400 |
commit | c8868611389aa28e0e5e0d63f468727781eac68c (patch) | |
tree | da07d9bb09f99cdcb058bed5117dcac998e0b8ae /drivers/net/skge.c | |
parent | 9389d79fbf9a0167ff2de87e8796c6bb803219bf (diff) |
[PATCH] skge: fix Yukon-Lite A0 workaround
This is one of those workarounds sucked over from sk98lin driver.
The skge driver needs to detect the Yukon-Lite A0 chip properly,
and turn of Rx FIFO Flush.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/skge.c')
-rw-r--r-- | drivers/net/skge.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/net/skge.c b/drivers/net/skge.c index ae1996a3bc5c..fd398da4993b 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c | |||
@@ -1643,6 +1643,22 @@ static void yukon_reset(struct skge_hw *hw, int port) | |||
1643 | | GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA); | 1643 | | GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA); |
1644 | } | 1644 | } |
1645 | 1645 | ||
1646 | /* Apparently, early versions of Yukon-Lite had wrong chip_id? */ | ||
1647 | static int is_yukon_lite_a0(struct skge_hw *hw) | ||
1648 | { | ||
1649 | u32 reg; | ||
1650 | int ret; | ||
1651 | |||
1652 | if (hw->chip_id != CHIP_ID_YUKON) | ||
1653 | return 0; | ||
1654 | |||
1655 | reg = skge_read32(hw, B2_FAR); | ||
1656 | skge_write8(hw, B2_FAR + 3, 0xff); | ||
1657 | ret = (skge_read8(hw, B2_FAR + 3) != 0); | ||
1658 | skge_write32(hw, B2_FAR, reg); | ||
1659 | return ret; | ||
1660 | } | ||
1661 | |||
1646 | static void yukon_mac_init(struct skge_hw *hw, int port) | 1662 | static void yukon_mac_init(struct skge_hw *hw, int port) |
1647 | { | 1663 | { |
1648 | struct skge_port *skge = netdev_priv(hw->dev[port]); | 1664 | struct skge_port *skge = netdev_priv(hw->dev[port]); |
@@ -1758,9 +1774,11 @@ static void yukon_mac_init(struct skge_hw *hw, int port) | |||
1758 | /* Configure Rx MAC FIFO */ | 1774 | /* Configure Rx MAC FIFO */ |
1759 | skge_write16(hw, SK_REG(port, RX_GMF_FL_MSK), RX_FF_FL_DEF_MSK); | 1775 | skge_write16(hw, SK_REG(port, RX_GMF_FL_MSK), RX_FF_FL_DEF_MSK); |
1760 | reg = GMF_OPER_ON | GMF_RX_F_FL_ON; | 1776 | reg = GMF_OPER_ON | GMF_RX_F_FL_ON; |
1761 | if (hw->chip_id == CHIP_ID_YUKON_LITE && | 1777 | |
1762 | hw->chip_rev >= CHIP_REV_YU_LITE_A3) | 1778 | /* disable Rx GMAC FIFO Flush for YUKON-Lite Rev. A0 only */ |
1779 | if (is_yukon_lite_a0(hw)) | ||
1763 | reg &= ~GMF_RX_F_FL_ON; | 1780 | reg &= ~GMF_RX_F_FL_ON; |
1781 | |||
1764 | skge_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_CLR); | 1782 | skge_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_CLR); |
1765 | skge_write16(hw, SK_REG(port, RX_GMF_CTRL_T), reg); | 1783 | skge_write16(hw, SK_REG(port, RX_GMF_CTRL_T), reg); |
1766 | /* | 1784 | /* |