summaryrefslogtreecommitdiff
path: root/drivers/net/fec_mxc.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/fec_mxc.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/fec_mxc.c')
-rw-r--r--drivers/net/fec_mxc.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 0d0f392..c438962 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -163,20 +163,20 @@ static int miiphy_restart_aneg(struct eth_device *dev)
* Reset PHY, then delay 300ns
*/
#ifdef CONFIG_MX27
- miiphy_write(dev->name, CONFIG_FEC_MXC_PHYADDR, PHY_MIPGSR, 0x00FF);
+ miiphy_write(dev->name, CONFIG_FEC_MXC_PHYADDR, MII_DCOUNTER, 0x00FF);
#endif
- miiphy_write(dev->name, CONFIG_FEC_MXC_PHYADDR, PHY_BMCR,
- PHY_BMCR_RESET);
+ miiphy_write(dev->name, CONFIG_FEC_MXC_PHYADDR, MII_BMCR,
+ BMCR_RESET);
udelay(1000);
/*
* Set the auto-negotiation advertisement register bits
*/
- miiphy_write(dev->name, CONFIG_FEC_MXC_PHYADDR, PHY_ANAR,
- PHY_ANLPAR_TXFD | PHY_ANLPAR_TX | PHY_ANLPAR_10FD |
- PHY_ANLPAR_10 | PHY_ANLPAR_PSB_802_3);
- miiphy_write(dev->name, CONFIG_FEC_MXC_PHYADDR, PHY_BMCR,
- PHY_BMCR_AUTON | PHY_BMCR_RST_NEG);
+ miiphy_write(dev->name, CONFIG_FEC_MXC_PHYADDR, MII_ADVERTISE,
+ LPA_100FULL | LPA_100HALF | LPA_10FULL |
+ LPA_10HALF | PHY_ANLPAR_PSB_802_3);
+ miiphy_write(dev->name, CONFIG_FEC_MXC_PHYADDR, MII_BMCR,
+ BMCR_ANENABLE | BMCR_ANRESTART);
return 0;
}
@@ -197,12 +197,12 @@ static int miiphy_wait_aneg(struct eth_device *dev)
}
if (miiphy_read(dev->name, CONFIG_FEC_MXC_PHYADDR,
- PHY_BMSR, &status)) {
+ MII_BMSR, &status)) {
printf("%s: Autonegotiation failed. status: 0x%04x\n",
dev->name, status);
return -1;
}
- } while (!(status & PHY_BMSR_LS));
+ } while (!(status & BMSR_LSTATUS));
return 0;
}