aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ucc_geth.c
diff options
context:
space:
mode:
authorAnton Vorontsov <avorontsov@ru.mvista.com>2009-07-16 17:31:47 -0400
committerDavid S. Miller <davem@davemloft.net>2009-07-22 12:27:24 -0400
commit3104a6ff67e484e4dc84822b4ed0396e85bb9fb9 (patch)
treef4576bc8b5ee355e1deeec3b2a9877ffa6278ffd /drivers/net/ucc_geth.c
parent1db780f8c7d361fe1b7d29b9dc849b97955ae944 (diff)
ucc_geth: Revive fixed link support
Since commit 0b9da337dca972e7a4144e298ec3adb8f244d4a4 ("Rework ucc_geth driver to use of_mdio infrastructure") the fixed-link support is broken. This patch fixes the support by removing !ug_info->phy_node check, and adds a call to of_phy_connect_fixed_link() if a phy is not attached to the MAC. Also, remove an old fixed-link code that we don't use any longer. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ucc_geth.c')
-rw-r--r--drivers/net/ucc_geth.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 40c6eba775ce..3b957e6412ee 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -1590,13 +1590,13 @@ static int init_phy(struct net_device *dev)
1590 priv->oldspeed = 0; 1590 priv->oldspeed = 0;
1591 priv->oldduplex = -1; 1591 priv->oldduplex = -1;
1592 1592
1593 if (!ug_info->phy_node)
1594 return 0;
1595
1596 phydev = of_phy_connect(dev, ug_info->phy_node, &adjust_link, 0, 1593 phydev = of_phy_connect(dev, ug_info->phy_node, &adjust_link, 0,
1597 priv->phy_interface); 1594 priv->phy_interface);
1595 if (!phydev)
1596 phydev = of_phy_connect_fixed_link(dev, &adjust_link,
1597 priv->phy_interface);
1598 if (!phydev) { 1598 if (!phydev) {
1599 printk("%s: Could not attach to PHY\n", dev->name); 1599 dev_err(&dev->dev, "Could not attach to PHY\n");
1600 return -ENODEV; 1600 return -ENODEV;
1601 } 1601 }
1602 1602
@@ -3608,9 +3608,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
3608 struct ucc_geth_private *ugeth = NULL; 3608 struct ucc_geth_private *ugeth = NULL;
3609 struct ucc_geth_info *ug_info; 3609 struct ucc_geth_info *ug_info;
3610 struct resource res; 3610 struct resource res;
3611 struct device_node *phy;
3612 int err, ucc_num, max_speed = 0; 3611 int err, ucc_num, max_speed = 0;
3613 const u32 *fixed_link;
3614 const unsigned int *prop; 3612 const unsigned int *prop;
3615 const char *sprop; 3613 const char *sprop;
3616 const void *mac_addr; 3614 const void *mac_addr;
@@ -3708,15 +3706,8 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
3708 3706
3709 ug_info->uf_info.regs = res.start; 3707 ug_info->uf_info.regs = res.start;
3710 ug_info->uf_info.irq = irq_of_parse_and_map(np, 0); 3708 ug_info->uf_info.irq = irq_of_parse_and_map(np, 0);
3711 fixed_link = of_get_property(np, "fixed-link", NULL); 3709
3712 if (fixed_link) { 3710 ug_info->phy_node = of_parse_phandle(np, "phy-handle", 0);
3713 phy = NULL;
3714 } else {
3715 phy = of_parse_phandle(np, "phy-handle", 0);
3716 if (phy == NULL)
3717 return -ENODEV;
3718 }
3719 ug_info->phy_node = phy;
3720 3711
3721 /* Find the TBI PHY node. If it's not there, we don't support SGMII */ 3712 /* Find the TBI PHY node. If it's not there, we don't support SGMII */
3722 ug_info->tbi_node = of_parse_phandle(np, "tbi-handle", 0); 3713 ug_info->tbi_node = of_parse_phandle(np, "tbi-handle", 0);
@@ -3725,7 +3716,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
3725 prop = of_get_property(np, "phy-connection-type", NULL); 3716 prop = of_get_property(np, "phy-connection-type", NULL);
3726 if (!prop) { 3717 if (!prop) {
3727 /* handle interface property present in old trees */ 3718 /* handle interface property present in old trees */
3728 prop = of_get_property(phy, "interface", NULL); 3719 prop = of_get_property(ug_info->phy_node, "interface", NULL);
3729 if (prop != NULL) { 3720 if (prop != NULL) {
3730 phy_interface = enet_to_phy_interface[*prop]; 3721 phy_interface = enet_to_phy_interface[*prop];
3731 max_speed = enet_to_speed[*prop]; 3722 max_speed = enet_to_speed[*prop];