aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sky2.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2008-01-10 19:14:14 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:08:01 -0500
commited4d41616baa404cf29576ff452ea1db12b9e03b (patch)
treef80ac168d167764fbb1eaa17cf5349ec8e26149c /drivers/net/sky2.c
parent804d8541d217f73a6543baac937cf65b8b4de850 (diff)
sky2: support for Yukon Supreme
Add support from sk98lin vendor driver 10.50.1.3 for 88E8055 and 88E8075 chips. I don't have this hardware to test, so this changes are untested. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/sky2.c')
-rw-r--r--drivers/net/sky2.c54
1 files changed, 39 insertions, 15 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index c177e87182f4..1e7418f6645a 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -134,6 +134,8 @@ static const struct pci_device_id sky2_id_table[] = {
134 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436A) }, /* 88E8058 */ 134 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436A) }, /* 88E8058 */
135 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436B) }, /* 88E8071 */ 135 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436B) }, /* 88E8071 */
136 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436C) }, /* 88E8072 */ 136 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436C) }, /* 88E8072 */
137 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436D) }, /* 88E8055 */
138 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4370) }, /* 88E8075 */
137 { 0 } 139 { 0 }
138}; 140};
139 141
@@ -547,6 +549,7 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
547 549
548 case CHIP_ID_YUKON_EC_U: 550 case CHIP_ID_YUKON_EC_U:
549 case CHIP_ID_YUKON_EX: 551 case CHIP_ID_YUKON_EX:
552 case CHIP_ID_YUKON_SUPR:
550 pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR); 553 pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR);
551 554
552 /* select page 3 to access LED control register */ 555 /* select page 3 to access LED control register */
@@ -713,23 +716,33 @@ static void sky2_set_tx_stfwd(struct sky2_hw *hw, unsigned port)
713{ 716{
714 struct net_device *dev = hw->dev[port]; 717 struct net_device *dev = hw->dev[port];
715 718
716 if (dev->mtu <= ETH_DATA_LEN) 719 if ( (hw->chip_id == CHIP_ID_YUKON_EX &&
717 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), 720 hw->chip_rev != CHIP_REV_YU_EX_A0) ||
718 TX_JUMBO_DIS | TX_STFW_ENA); 721 hw->chip_id == CHIP_ID_YUKON_FE_P ||
722 hw->chip_id == CHIP_ID_YUKON_SUPR) {
723 /* Yukon-Extreme B0 and further Extreme devices */
724 /* enable Store & Forward mode for TX */
719 725
720 else if (hw->chip_id != CHIP_ID_YUKON_EC_U) 726 if (dev->mtu <= ETH_DATA_LEN)
721 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), 727 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T),
722 TX_STFW_ENA | TX_JUMBO_ENA); 728 TX_JUMBO_DIS | TX_STFW_ENA);
723 else {
724 /* set Tx GMAC FIFO Almost Empty Threshold */
725 sky2_write32(hw, SK_REG(port, TX_GMF_AE_THR),
726 (ECU_JUMBO_WM << 16) | ECU_AE_THR);
727 729
728 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), 730 else
729 TX_JUMBO_ENA | TX_STFW_DIS); 731 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T),
732 TX_JUMBO_ENA| TX_STFW_ENA);
733 } else {
734 if (dev->mtu <= ETH_DATA_LEN)
735 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_STFW_ENA);
736 else {
737 /* set Tx GMAC FIFO Almost Empty Threshold */
738 sky2_write32(hw, SK_REG(port, TX_GMF_AE_THR),
739 (ECU_JUMBO_WM << 16) | ECU_AE_THR);
730 740
731 /* Can't do offload because of lack of store/forward */ 741 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_STFW_DIS);
732 dev->features &= ~(NETIF_F_TSO | NETIF_F_SG | NETIF_F_ALL_CSUM); 742
743 /* Can't do offload because of lack of store/forward */
744 dev->features &= ~(NETIF_F_TSO | NETIF_F_SG | NETIF_F_ALL_CSUM);
745 }
733 } 746 }
734} 747}
735 748
@@ -2660,6 +2673,7 @@ static u32 sky2_mhz(const struct sky2_hw *hw)
2660 case CHIP_ID_YUKON_EC: 2673 case CHIP_ID_YUKON_EC:
2661 case CHIP_ID_YUKON_EC_U: 2674 case CHIP_ID_YUKON_EC_U:
2662 case CHIP_ID_YUKON_EX: 2675 case CHIP_ID_YUKON_EX:
2676 case CHIP_ID_YUKON_SUPR:
2663 return 125; 2677 return 125;
2664 2678
2665 case CHIP_ID_YUKON_FE: 2679 case CHIP_ID_YUKON_FE:
@@ -2743,6 +2757,15 @@ static int __devinit sky2_init(struct sky2_hw *hw)
2743 | SKY2_HW_AUTO_TX_SUM 2757 | SKY2_HW_AUTO_TX_SUM
2744 | SKY2_HW_ADV_POWER_CTL; 2758 | SKY2_HW_ADV_POWER_CTL;
2745 break; 2759 break;
2760
2761 case CHIP_ID_YUKON_SUPR:
2762 hw->flags = SKY2_HW_GIGABIT
2763 | SKY2_HW_NEWER_PHY
2764 | SKY2_HW_NEW_LE
2765 | SKY2_HW_AUTO_TX_SUM
2766 | SKY2_HW_ADV_POWER_CTL;
2767 break;
2768
2746 default: 2769 default:
2747 dev_err(&hw->pdev->dev, "unsupported chip type 0x%x\n", 2770 dev_err(&hw->pdev->dev, "unsupported chip type 0x%x\n",
2748 hw->chip_id); 2771 hw->chip_id);
@@ -2813,7 +2836,8 @@ static void sky2_reset(struct sky2_hw *hw)
2813 sky2_write8(hw, SK_REG(i, GMAC_LINK_CTRL), GMLC_RST_SET); 2836 sky2_write8(hw, SK_REG(i, GMAC_LINK_CTRL), GMLC_RST_SET);
2814 sky2_write8(hw, SK_REG(i, GMAC_LINK_CTRL), GMLC_RST_CLR); 2837 sky2_write8(hw, SK_REG(i, GMAC_LINK_CTRL), GMLC_RST_CLR);
2815 2838
2816 if (hw->chip_id == CHIP_ID_YUKON_EX) 2839 if (hw->chip_id == CHIP_ID_YUKON_EX ||
2840 hw->chip_id == CHIP_ID_YUKON_SUPR)
2817 sky2_write16(hw, SK_REG(i, GMAC_CTRL), 2841 sky2_write16(hw, SK_REG(i, GMAC_CTRL),
2818 GMC_BYP_MACSECRX_ON | GMC_BYP_MACSECTX_ON 2842 GMC_BYP_MACSECRX_ON | GMC_BYP_MACSECTX_ON
2819 | GMC_BYP_RETR_ON); 2843 | GMC_BYP_RETR_ON);