ucc_geth: fix non-functional fixed phy support

The new Fixed PHY method, fixed-link property, isn't
impl. for ucc_geth which makes fixed PHYs non functional.
Add support for the new method to restore the Fixed PHY
functionality.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
This commit is contained in:
Joakim Tjernlund 2008-04-11 00:54:43 +02:00 committed by Jeff Garzik
parent 9a3c243d7d
commit 3d137fdd16
1 changed files with 30 additions and 23 deletions

View File

@ -3833,6 +3833,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
struct device_node *phy;
int err, ucc_num, max_speed = 0;
const phandle *ph;
const u32 *fixed_link;
const unsigned int *prop;
const char *sprop;
const void *mac_addr;
@ -3923,18 +3924,38 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
ug_info->uf_info.regs = res.start;
ug_info->uf_info.irq = irq_of_parse_and_map(np, 0);
fixed_link = of_get_property(np, "fixed-link", NULL);
if (fixed_link) {
ug_info->mdio_bus = 0;
ug_info->phy_address = fixed_link[0];
phy = NULL;
} else {
ph = of_get_property(np, "phy-handle", NULL);
phy = of_find_node_by_phandle(*ph);
ph = of_get_property(np, "phy-handle", NULL);
phy = of_find_node_by_phandle(*ph);
if (phy == NULL)
return -ENODEV;
if (phy == NULL)
return -ENODEV;
/* set the PHY address */
prop = of_get_property(phy, "reg", NULL);
if (prop == NULL)
return -1;
ug_info->phy_address = *prop;
/* set the PHY address */
prop = of_get_property(phy, "reg", NULL);
if (prop == NULL)
return -1;
ug_info->phy_address = *prop;
/* Set the bus id */
mdio = of_get_parent(phy);
if (mdio == NULL)
return -1;
err = of_address_to_resource(mdio, 0, &res);
of_node_put(mdio);
if (err)
return -1;
ug_info->mdio_bus = res.start;
}
/* get the phy interface type, or default to MII */
prop = of_get_property(np, "phy-connection-type", NULL);
@ -3979,20 +4000,6 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
ug_info->numThreadsRx = UCC_GETH_NUM_OF_THREADS_4;
}
/* Set the bus id */
mdio = of_get_parent(phy);
if (mdio == NULL)
return -1;
err = of_address_to_resource(mdio, 0, &res);
of_node_put(mdio);
if (err)
return -1;
ug_info->mdio_bus = res.start;
if (netif_msg_probe(&debug))
printk(KERN_INFO "ucc_geth: UCC%1d at 0x%8x (irq = %d) \n",
ug_info->uf_info.ucc_num + 1, ug_info->uf_info.regs,