diff options
author | Liu Yu-B13201 <Yu.Liu@freescale.com> | 2010-01-13 17:13:18 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-01-21 04:17:55 -0500 |
commit | 81abb43a243b6d74b6f7201a7a22aa5355cd3a8a (patch) | |
tree | 980ef1ac03dc68bdb33b214631b837ca7e5e53e9 /drivers/net/ucc_geth.c | |
parent | c1fb8340d7a39346c08ec4b1db4fb432f02acd4c (diff) |
ucc_geth: update the tbi-phy setting
Old method only set tbi-phy for eth0.
Signed-off-by: Liu Yu <yu.liu@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ucc_geth.c')
-rw-r--r-- | drivers/net/ucc_geth.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index 96bdc0b43889..6750de10a087 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <asm/qe.h> | 37 | #include <asm/qe.h> |
38 | #include <asm/ucc.h> | 38 | #include <asm/ucc.h> |
39 | #include <asm/ucc_fast.h> | 39 | #include <asm/ucc_fast.h> |
40 | #include <asm/machdep.h> | ||
40 | 41 | ||
41 | #include "ucc_geth.h" | 42 | #include "ucc_geth.h" |
42 | #include "fsl_pq_mdio.h" | 43 | #include "fsl_pq_mdio.h" |
@@ -1334,7 +1335,7 @@ static int adjust_enet_interface(struct ucc_geth_private *ugeth) | |||
1334 | struct ucc_geth __iomem *ug_regs; | 1335 | struct ucc_geth __iomem *ug_regs; |
1335 | struct ucc_fast __iomem *uf_regs; | 1336 | struct ucc_fast __iomem *uf_regs; |
1336 | int ret_val; | 1337 | int ret_val; |
1337 | u32 upsmr, maccfg2, tbiBaseAddress; | 1338 | u32 upsmr, maccfg2; |
1338 | u16 value; | 1339 | u16 value; |
1339 | 1340 | ||
1340 | ugeth_vdbg("%s: IN", __func__); | 1341 | ugeth_vdbg("%s: IN", __func__); |
@@ -1389,14 +1390,20 @@ static int adjust_enet_interface(struct ucc_geth_private *ugeth) | |||
1389 | /* Note that this depends on proper setting in utbipar register. */ | 1390 | /* Note that this depends on proper setting in utbipar register. */ |
1390 | if ((ugeth->phy_interface == PHY_INTERFACE_MODE_TBI) || | 1391 | if ((ugeth->phy_interface == PHY_INTERFACE_MODE_TBI) || |
1391 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RTBI)) { | 1392 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RTBI)) { |
1392 | tbiBaseAddress = in_be32(&ug_regs->utbipar); | 1393 | struct ucc_geth_info *ug_info = ugeth->ug_info; |
1393 | tbiBaseAddress &= UTBIPAR_PHY_ADDRESS_MASK; | 1394 | struct phy_device *tbiphy; |
1394 | tbiBaseAddress >>= UTBIPAR_PHY_ADDRESS_SHIFT; | 1395 | |
1395 | value = ugeth->phydev->bus->read(ugeth->phydev->bus, | 1396 | if (!ug_info->tbi_node) |
1396 | (u8) tbiBaseAddress, ENET_TBI_MII_CR); | 1397 | ugeth_warn("TBI mode requires that the device " |
1398 | "tree specify a tbi-handle\n"); | ||
1399 | |||
1400 | tbiphy = of_phy_find_device(ug_info->tbi_node); | ||
1401 | if (!tbiphy) | ||
1402 | ugeth_warn("Could not get TBI device\n"); | ||
1403 | |||
1404 | value = phy_read(tbiphy, ENET_TBI_MII_CR); | ||
1397 | value &= ~0x1000; /* Turn off autonegotiation */ | 1405 | value &= ~0x1000; /* Turn off autonegotiation */ |
1398 | ugeth->phydev->bus->write(ugeth->phydev->bus, | 1406 | phy_write(tbiphy, ENET_TBI_MII_CR, value); |
1399 | (u8) tbiBaseAddress, ENET_TBI_MII_CR, value); | ||
1400 | } | 1407 | } |
1401 | 1408 | ||
1402 | init_check_frame_length_mode(ug_info->lengthCheckRx, &ug_regs->maccfg2); | 1409 | init_check_frame_length_mode(ug_info->lengthCheckRx, &ug_regs->maccfg2); |