aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/gianfar.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/gianfar.c')
-rw-r--r--drivers/net/gianfar.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 43d813ed9f45..e212f2c5448b 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -264,15 +264,6 @@ static int gfar_of_init(struct net_device *dev)
264 priv->device_flags |= FSL_GIANFAR_DEV_HAS_MAGIC_PACKET; 264 priv->device_flags |= FSL_GIANFAR_DEV_HAS_MAGIC_PACKET;
265 265
266 priv->phy_node = of_parse_phandle(np, "phy-handle", 0); 266 priv->phy_node = of_parse_phandle(np, "phy-handle", 0);
267 if (!priv->phy_node) {
268 u32 *fixed_link;
269
270 fixed_link = (u32 *)of_get_property(np, "fixed-link", NULL);
271 if (!fixed_link) {
272 err = -ENODEV;
273 goto err_out;
274 }
275 }
276 267
277 /* Find the TBI PHY. If it's not there, we don't support SGMII */ 268 /* Find the TBI PHY. If it's not there, we don't support SGMII */
278 priv->tbi_node = of_parse_phandle(np, "tbi-handle", 0); 269 priv->tbi_node = of_parse_phandle(np, "tbi-handle", 0);
@@ -659,13 +650,14 @@ static int init_phy(struct net_device *dev)
659 650
660 interface = gfar_get_interface(dev); 651 interface = gfar_get_interface(dev);
661 652
662 if (priv->phy_node) { 653 priv->phydev = of_phy_connect(dev, priv->phy_node, &adjust_link, 0,
663 priv->phydev = of_phy_connect(dev, priv->phy_node, &adjust_link, 654 interface);
664 0, interface); 655 if (!priv->phydev)
665 if (!priv->phydev) { 656 priv->phydev = of_phy_connect_fixed_link(dev, &adjust_link,
666 dev_err(&dev->dev, "error: Could not attach to PHY\n"); 657 interface);
667 return -ENODEV; 658 if (!priv->phydev) {
668 } 659 dev_err(&dev->dev, "could not attach to PHY\n");
660 return -ENODEV;
669 } 661 }
670 662
671 if (interface == PHY_INTERFACE_MODE_SGMII) 663 if (interface == PHY_INTERFACE_MODE_SGMII)
@@ -944,6 +936,7 @@ int startup_gfar(struct net_device *dev)
944 struct gfar __iomem *regs = priv->regs; 936 struct gfar __iomem *regs = priv->regs;
945 int err = 0; 937 int err = 0;
946 u32 rctrl = 0; 938 u32 rctrl = 0;
939 u32 tctrl = 0;
947 u32 attrs = 0; 940 u32 attrs = 0;
948 941
949 gfar_write(&regs->imask, IMASK_INIT_CLEAR); 942 gfar_write(&regs->imask, IMASK_INIT_CLEAR);
@@ -1119,11 +1112,19 @@ int startup_gfar(struct net_device *dev)
1119 rctrl |= RCTRL_PADDING(priv->padding); 1112 rctrl |= RCTRL_PADDING(priv->padding);
1120 } 1113 }
1121 1114
1115 /* keep vlan related bits if it's enabled */
1116 if (priv->vlgrp) {
1117 rctrl |= RCTRL_VLEX | RCTRL_PRSDEP_INIT;
1118 tctrl |= TCTRL_VLINS;
1119 }
1120
1122 /* Init rctrl based on our settings */ 1121 /* Init rctrl based on our settings */
1123 gfar_write(&priv->regs->rctrl, rctrl); 1122 gfar_write(&priv->regs->rctrl, rctrl);
1124 1123
1125 if (dev->features & NETIF_F_IP_CSUM) 1124 if (dev->features & NETIF_F_IP_CSUM)
1126 gfar_write(&priv->regs->tctrl, TCTRL_INIT_CSUM); 1125 tctrl |= TCTRL_INIT_CSUM;
1126
1127 gfar_write(&priv->regs->tctrl, tctrl);
1127 1128
1128 /* Set the extraction length and index */ 1129 /* Set the extraction length and index */
1129 attrs = ATTRELI_EL(priv->rx_stash_size) | 1130 attrs = ATTRELI_EL(priv->rx_stash_size) |
@@ -1458,7 +1459,6 @@ static void gfar_vlan_rx_register(struct net_device *dev,
1458 1459
1459 /* Enable VLAN tag extraction */ 1460 /* Enable VLAN tag extraction */
1460 tempval = gfar_read(&priv->regs->rctrl); 1461 tempval = gfar_read(&priv->regs->rctrl);
1461 tempval |= RCTRL_VLEX;
1462 tempval |= (RCTRL_VLEX | RCTRL_PRSDEP_INIT); 1462 tempval |= (RCTRL_VLEX | RCTRL_PRSDEP_INIT);
1463 gfar_write(&priv->regs->rctrl, tempval); 1463 gfar_write(&priv->regs->rctrl, tempval);
1464 } else { 1464 } else {