Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 183711
b: refs/heads/master
c: 81abb43
h: refs/heads/master
i:
  183709: e3e78c1
  183707: 278c627
  183703: 5cad756
  183695: 3a2d654
  183679: 1670cc7
v: v3
  • Loading branch information
Liu Yu-B13201 authored and David S. Miller committed Jan 21, 2010
1 parent 06df9a9 commit ea0c693
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c1fb8340d7a39346c08ec4b1db4fb432f02acd4c
refs/heads/master: 81abb43a243b6d74b6f7201a7a22aa5355cd3a8a
23 changes: 15 additions & 8 deletions trunk/drivers/net/ucc_geth.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <asm/qe.h>
#include <asm/ucc.h>
#include <asm/ucc_fast.h>
#include <asm/machdep.h>

#include "ucc_geth.h"
#include "fsl_pq_mdio.h"
Expand Down Expand Up @@ -1334,7 +1335,7 @@ static int adjust_enet_interface(struct ucc_geth_private *ugeth)
struct ucc_geth __iomem *ug_regs;
struct ucc_fast __iomem *uf_regs;
int ret_val;
u32 upsmr, maccfg2, tbiBaseAddress;
u32 upsmr, maccfg2;
u16 value;

ugeth_vdbg("%s: IN", __func__);
Expand Down Expand Up @@ -1389,14 +1390,20 @@ static int adjust_enet_interface(struct ucc_geth_private *ugeth)
/* Note that this depends on proper setting in utbipar register. */
if ((ugeth->phy_interface == PHY_INTERFACE_MODE_TBI) ||
(ugeth->phy_interface == PHY_INTERFACE_MODE_RTBI)) {
tbiBaseAddress = in_be32(&ug_regs->utbipar);
tbiBaseAddress &= UTBIPAR_PHY_ADDRESS_MASK;
tbiBaseAddress >>= UTBIPAR_PHY_ADDRESS_SHIFT;
value = ugeth->phydev->bus->read(ugeth->phydev->bus,
(u8) tbiBaseAddress, ENET_TBI_MII_CR);
struct ucc_geth_info *ug_info = ugeth->ug_info;
struct phy_device *tbiphy;

if (!ug_info->tbi_node)
ugeth_warn("TBI mode requires that the device "
"tree specify a tbi-handle\n");

tbiphy = of_phy_find_device(ug_info->tbi_node);
if (!tbiphy)
ugeth_warn("Could not get TBI device\n");

value = phy_read(tbiphy, ENET_TBI_MII_CR);
value &= ~0x1000; /* Turn off autonegotiation */
ugeth->phydev->bus->write(ugeth->phydev->bus,
(u8) tbiBaseAddress, ENET_TBI_MII_CR, value);
phy_write(tbiphy, ENET_TBI_MII_CR, value);
}

init_check_frame_length_mode(ug_info->lengthCheckRx, &ug_regs->maccfg2);
Expand Down

0 comments on commit ea0c693

Please sign in to comment.