diff options
author | Marian Balakowicz <m8@semihalf.com> | 2005-10-28 22:30:33 +0200 |
---|---|---|
committer | Marian Balakowicz <m8@semihalf.com> | 2005-10-28 22:30:33 +0200 |
commit | 63ff004c4fcad9f690bf44dbd15d568bb47aac2d (patch) | |
tree | 7b64074a85da8118b6c862f14de1171b36ade0f7 /cpu/ppc4xx/miiphy.c | |
parent | fe93483a0ab9dcbf7794ffbf0b029ba138380e81 (diff) | |
download | u-boot-imx-63ff004c4fcad9f690bf44dbd15d568bb47aac2d.zip u-boot-imx-63ff004c4fcad9f690bf44dbd15d568bb47aac2d.tar.gz u-boot-imx-63ff004c4fcad9f690bf44dbd15d568bb47aac2d.tar.bz2 |
Add support for multiple PHYs.
Diffstat (limited to 'cpu/ppc4xx/miiphy.c')
-rw-r--r-- | cpu/ppc4xx/miiphy.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/cpu/ppc4xx/miiphy.c b/cpu/ppc4xx/miiphy.c index 24f9154..f319eb8 100644 --- a/cpu/ppc4xx/miiphy.c +++ b/cpu/ppc4xx/miiphy.c @@ -55,14 +55,14 @@ /* Dump out to the screen PHY regs */ /***********************************************************/ -void miiphy_dump (unsigned char addr) +void miiphy_dump (char *devname, unsigned char addr) { unsigned long i; unsigned short data; for (i = 0; i < 0x1A; i++) { - if (miiphy_read (addr, i, &data)) { + if (miiphy_read (devname, addr, i, &data)) { printf ("read error for reg %lx\n", i); return; } @@ -79,21 +79,21 @@ void miiphy_dump (unsigned char addr) /***********************************************************/ /* (Re)start autonegotiation */ /***********************************************************/ -int phy_setup_aneg (unsigned char addr) +int phy_setup_aneg (char *devname, unsigned char addr) { unsigned short ctl, adv; /* Setup standard advertise */ - miiphy_read (addr, PHY_ANAR, &adv); + 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 (addr, PHY_ANAR, adv); + miiphy_write (devname, addr, PHY_ANAR, adv); /* Start/Restart aneg */ - miiphy_read (addr, PHY_BMCR, &ctl); + miiphy_read (devname, addr, PHY_BMCR, &ctl); ctl |= (PHY_BMCR_AUTON | PHY_BMCR_RST_NEG); - miiphy_write (addr, PHY_BMCR, ctl); + miiphy_write (devname, addr, PHY_BMCR, ctl); return 0; } @@ -142,7 +142,8 @@ unsigned int miiphy_getemac_offset (void) } -int miiphy_read (unsigned char addr, unsigned char reg, unsigned short *value) +int emac4xx_miiphy_read (char *devname, unsigned char addr, + unsigned char reg, unsigned short *value) { unsigned long sta_reg; /* STA scratch area */ unsigned long i; @@ -207,7 +208,8 @@ int miiphy_read (unsigned char addr, unsigned char reg, unsigned short *value) /* write a phy reg and return the value with a rc */ /***********************************************************/ -int miiphy_write (unsigned char addr, unsigned char reg, unsigned short value) +int emac4xx_miiphy_write (char *devname, unsigned char addr, + unsigned char reg, unsigned short value) { unsigned long sta_reg; /* STA scratch area */ unsigned long i; |