aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/fsl_pq_mdio.c
diff options
context:
space:
mode:
authorHaiying Wang <Haiying.Wang@freescale.com>2009-06-02 00:04:14 -0400
committerDavid S. Miller <davem@davemloft.net>2009-06-03 05:52:46 -0400
commitfbcc0e2ce5a4fde63c7f33153bd7e3a4791e01c8 (patch)
tree4d73a04e7265788a47a9bbf7981ceeadc25e761b /drivers/net/fsl_pq_mdio.c
parent32d0c1e1bee16781e94c7ea8c75499696bce0a33 (diff)
fsl_pq_mido: Set the first UCC as the mii management interface master
Current code makes the UCC whose register range includes the current mdio register to be the MII managemnt interface master of the QE. If there is more than one mdio bus for QE, the UCC of the last mdio bus will be the MII management interface master which will make the primary mdio bus working unproperly, e.g. can not get the right clock. Normally the primary mdio bus is the first UEC's mdio bus. This patch allows the first UCC to be the MII management interface master of the multiple UCC mdio buses. Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/fsl_pq_mdio.c')
-rw-r--r--drivers/net/fsl_pq_mdio.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/fsl_pq_mdio.c b/drivers/net/fsl_pq_mdio.c
index d12e0e0336f4..3af581303ca2 100644
--- a/drivers/net/fsl_pq_mdio.c
+++ b/drivers/net/fsl_pq_mdio.c
@@ -301,13 +301,17 @@ static int fsl_pq_mdio_probe(struct of_device *ofdev,
301 of_device_is_compatible(np, "ucc_geth_phy")) { 301 of_device_is_compatible(np, "ucc_geth_phy")) {
302#ifdef CONFIG_UCC_GETH 302#ifdef CONFIG_UCC_GETH
303 u32 id; 303 u32 id;
304 static u32 mii_mng_master;
304 305
305 tbipa = &regs->utbipar; 306 tbipa = &regs->utbipar;
306 307
307 if ((err = get_ucc_id_for_range(addr, addr + size, &id))) 308 if ((err = get_ucc_id_for_range(addr, addr + size, &id)))
308 goto err_free_irqs; 309 goto err_free_irqs;
309 310
310 ucc_set_qe_mux_mii_mng(id - 1); 311 if (!mii_mng_master) {
312 mii_mng_master = id;
313 ucc_set_qe_mux_mii_mng(id - 1);
314 }
311#else 315#else
312 err = -ENODEV; 316 err = -ENODEV;
313 goto err_free_irqs; 317 goto err_free_irqs;