summaryrefslogtreecommitdiff
path: root/drivers/net/davinci_emac.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-12-23 15:40:12 -0500
committerWolfgang Denk <wd@denx.de>2011-01-09 18:06:50 +0100
commit8ef583a0351590a91394499eb5ca2ab8a703d959 (patch)
tree36dafbd4bdd7e46130aec04bbc0dbfe26e896d9f /drivers/net/davinci_emac.c
parent4ffeab2cc00b61bc4616d9e3c25d33937b0feb34 (diff)
downloadu-boot-imx-8ef583a0351590a91394499eb5ca2ab8a703d959.zip
u-boot-imx-8ef583a0351590a91394499eb5ca2ab8a703d959.tar.gz
u-boot-imx-8ef583a0351590a91394499eb5ca2ab8a703d959.tar.bz2
miiphy: convert to linux/mii.h
The include/miiphy.h header duplicates a lot of things from linux/mii.h. So punt all the things that overlap to keep the API simple and to make merging between U-Boot and Linux simpler. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'drivers/net/davinci_emac.c')
-rw-r--r--drivers/net/davinci_emac.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index 43a3d79..56cd2aa 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -236,7 +236,7 @@ static int gen_is_phy_connected(int phy_addr)
{
u_int16_t dummy;
- return(davinci_eth_phy_read(phy_addr, PHY_PHYIDR1, &dummy));
+ return(davinci_eth_phy_read(phy_addr, MII_PHYSID1, &dummy));
}
static int gen_get_link_speed(int phy_addr)
@@ -280,19 +280,19 @@ static int gen_auto_negotiate(int phy_addr)
{
u_int16_t tmp;
- if (!davinci_eth_phy_read(phy_addr, PHY_BMCR, &tmp))
+ if (!davinci_eth_phy_read(phy_addr, MII_BMCR, &tmp))
return(0);
/* Restart Auto_negotiation */
- tmp |= PHY_BMCR_AUTON;
- davinci_eth_phy_write(phy_addr, PHY_BMCR, tmp);
+ tmp |= BMCR_ANENABLE;
+ davinci_eth_phy_write(phy_addr, MII_BMCR, tmp);
/*check AutoNegotiate complete */
udelay (10000);
- if (!davinci_eth_phy_read(phy_addr, PHY_BMSR, &tmp))
+ if (!davinci_eth_phy_read(phy_addr, MII_BMSR, &tmp))
return(0);
- if (!(tmp & PHY_BMSR_AUTN_COMP))
+ if (!(tmp & BMSR_ANEGCOMPLETE))
return(0);
return(gen_get_link_speed(phy_addr));
@@ -694,14 +694,14 @@ int davinci_emac_initialize(void)
return(0);
/* Get PHY ID and initialize phy_ops for a detected PHY */
- if (!davinci_eth_phy_read(active_phy_addr, PHY_PHYIDR1, &tmp)) {
+ if (!davinci_eth_phy_read(active_phy_addr, MII_PHYSID1, &tmp)) {
active_phy_addr = 0xff;
return(0);
}
phy_id = (tmp << 16) & 0xffff0000;
- if (!davinci_eth_phy_read(active_phy_addr, PHY_PHYIDR2, &tmp)) {
+ if (!davinci_eth_phy_read(active_phy_addr, MII_PHYSID2, &tmp)) {
active_phy_addr = 0xff;
return(0);
}