diff options
author | Mike Frysinger <vapier@gentoo.org> | 2010-12-23 15:40:12 -0500 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2011-01-09 18:06:50 +0100 |
commit | 8ef583a0351590a91394499eb5ca2ab8a703d959 (patch) | |
tree | 36dafbd4bdd7e46130aec04bbc0dbfe26e896d9f /arch/arm/cpu/ixp | |
parent | 4ffeab2cc00b61bc4616d9e3c25d33937b0feb34 (diff) | |
download | u-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 'arch/arm/cpu/ixp')
-rw-r--r-- | arch/arm/cpu/ixp/npe/miiphy.c | 16 | ||||
-rw-r--r-- | arch/arm/cpu/ixp/npe/npe.c | 8 |
2 files changed, 12 insertions, 12 deletions
diff --git a/arch/arm/cpu/ixp/npe/miiphy.c b/arch/arm/cpu/ixp/npe/miiphy.c index 4b0201a..a04779a 100644 --- a/arch/arm/cpu/ixp/npe/miiphy.c +++ b/arch/arm/cpu/ixp/npe/miiphy.c @@ -85,16 +85,16 @@ int phy_setup_aneg (char *devname, unsigned char addr) unsigned short ctl, adv; /* Setup standard advertise */ - miiphy_read (devname, addr, PHY_ANAR, &adv); - adv |= (PHY_ANLPAR_ACK | PHY_ANLPAR_RF | PHY_ANLPAR_T4 | - PHY_ANLPAR_TXFD | PHY_ANLPAR_TX | PHY_ANLPAR_10FD | - PHY_ANLPAR_10); - miiphy_write (devname, addr, PHY_ANAR, adv); + miiphy_read (devname, addr, MII_ADVERTISE, &adv); + adv |= (LPA_LPACK | LPA_RFAULT | LPA_100BASE4 | + LPA_100FULL | LPA_100HALF | LPA_10FULL | + LPA_10HALF); + miiphy_write (devname, addr, MII_ADVERTISE, adv); /* Start/Restart aneg */ - miiphy_read (devname, addr, PHY_BMCR, &ctl); - ctl |= (PHY_BMCR_AUTON | PHY_BMCR_RST_NEG); - miiphy_write (devname, addr, PHY_BMCR, ctl); + miiphy_read (devname, addr, MII_BMCR, &ctl); + ctl |= (BMCR_ANENABLE | BMCR_ANRESTART); + miiphy_write (devname, addr, MII_BMCR, ctl); return 0; } diff --git a/arch/arm/cpu/ixp/npe/npe.c b/arch/arm/cpu/ixp/npe/npe.c index 2e68689..857bcad 100644 --- a/arch/arm/cpu/ixp/npe/npe.c +++ b/arch/arm/cpu/ixp/npe/npe.c @@ -359,15 +359,15 @@ static int npe_init(struct eth_device *dev, bd_t * bis) debug("%s: 1\n", __FUNCTION__); - miiphy_read (dev->name, p_npe->phy_no, PHY_BMSR, ®_short); + miiphy_read (dev->name, p_npe->phy_no, MII_BMSR, ®_short); /* * Wait if PHY is capable of autonegotiation and autonegotiation is not complete */ - if ((reg_short & PHY_BMSR_AUTN_ABLE) && !(reg_short & PHY_BMSR_AUTN_COMP)) { + if ((reg_short & BMSR_ANEGCAPABLE) && !(reg_short & BMSR_ANEGCOMPLETE)) { puts ("Waiting for PHY auto negotiation to complete"); i = 0; - while (!(reg_short & PHY_BMSR_AUTN_COMP)) { + while (!(reg_short & BMSR_ANEGCOMPLETE)) { /* * Timeout reached ? */ @@ -378,7 +378,7 @@ static int npe_init(struct eth_device *dev, bd_t * bis) if ((i++ % 1000) == 0) { putc ('.'); - miiphy_read (dev->name, p_npe->phy_no, PHY_BMSR, ®_short); + miiphy_read (dev->name, p_npe->phy_no, MII_BMSR, ®_short); } udelay (1000); /* 1 ms */ } |