2013-07-28 20:12:45 +00:00
|
|
|
/*
|
2013-09-17 09:24:06 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0 IBM-pibs
|
2013-07-28 20:12:45 +00:00
|
|
|
*/
|
2002-08-17 09:36:01 +00:00
|
|
|
/*-----------------------------------------------------------------------------+
|
|
|
|
|
|
2005-08-16 16:18:00 +00:00
|
|
|
| File Name: miiphy.c
|
2002-08-17 09:36:01 +00:00
|
|
|
|
|
2005-08-16 16:18:00 +00:00
|
|
|
| Function: This module has utilities for accessing the MII PHY through
|
2002-08-17 09:36:01 +00:00
|
|
|
| the EMAC3 macro.
|
|
|
|
|
|
2005-08-16 16:18:00 +00:00
|
|
|
| Author: Mark Wisner
|
2002-08-17 09:36:01 +00:00
|
|
|
|
|
|
|
|
+-----------------------------------------------------------------------------*/
|
|
|
|
|
2008-02-19 20:58:25 +00:00
|
|
|
/* define DEBUG for debugging output (obviously ;-)) */
|
|
|
|
#if 0
|
|
|
|
#define DEBUG
|
|
|
|
#endif
|
|
|
|
|
2002-08-17 09:36:01 +00:00
|
|
|
#include <common.h>
|
|
|
|
#include <asm/processor.h>
|
2007-10-23 12:03:17 +00:00
|
|
|
#include <asm/io.h>
|
2002-08-17 09:36:01 +00:00
|
|
|
#include <ppc_asm.tmpl>
|
|
|
|
#include <commproc.h>
|
2010-09-09 17:18:00 +00:00
|
|
|
#include <asm/ppc4xx-emac.h>
|
|
|
|
#include <asm/ppc4xx-mal.h>
|
2002-08-17 09:36:01 +00:00
|
|
|
#include <miiphy.h>
|
|
|
|
|
2008-02-19 20:58:25 +00:00
|
|
|
#if !defined(CONFIG_PHY_CLK_FREQ)
|
|
|
|
#define CONFIG_PHY_CLK_FREQ 0
|
|
|
|
#endif
|
|
|
|
|
2002-08-17 09:36:01 +00:00
|
|
|
/***********************************************************/
|
2005-08-16 16:18:00 +00:00
|
|
|
/* Dump out to the screen PHY regs */
|
2002-08-17 09:36:01 +00:00
|
|
|
/***********************************************************/
|
|
|
|
|
2005-10-28 20:30:33 +00:00
|
|
|
void miiphy_dump (char *devname, unsigned char addr)
|
2002-08-17 09:36:01 +00:00
|
|
|
{
|
|
|
|
unsigned long i;
|
|
|
|
unsigned short data;
|
|
|
|
|
|
|
|
for (i = 0; i < 0x1A; i++) {
|
2005-10-28 20:30:33 +00:00
|
|
|
if (miiphy_read (devname, addr, i, &data)) {
|
2002-08-17 09:36:01 +00:00
|
|
|
printf ("read error for reg %lx\n", i);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
printf ("Phy reg %lx ==> %4x\n", i, data);
|
|
|
|
|
|
|
|
/* jump to the next set of regs */
|
|
|
|
if (i == 0x07)
|
|
|
|
i = 0x0f;
|
|
|
|
|
2005-08-16 16:18:00 +00:00
|
|
|
} /* end for loop */
|
|
|
|
} /* end dump */
|
2002-08-17 09:36:01 +00:00
|
|
|
|
|
|
|
/***********************************************************/
|
2005-08-16 16:18:00 +00:00
|
|
|
/* (Re)start autonegotiation */
|
2002-08-17 09:36:01 +00:00
|
|
|
/***********************************************************/
|
2005-10-28 20:30:33 +00:00
|
|
|
int phy_setup_aneg (char *devname, unsigned char addr)
|
2005-08-16 16:18:00 +00:00
|
|
|
{
|
2007-12-27 15:50:55 +00:00
|
|
|
u16 bmcr;
|
|
|
|
|
|
|
|
#if defined(CONFIG_PHY_DYNAMIC_ANEG)
|
|
|
|
/*
|
|
|
|
* Set up advertisement based on capablilities reported by the PHY.
|
|
|
|
* This should work for both copper and fiber.
|
|
|
|
*/
|
|
|
|
u16 bmsr;
|
|
|
|
#if defined(CONFIG_PHY_GIGE)
|
|
|
|
u16 exsr = 0x0000;
|
|
|
|
#endif
|
|
|
|
|
2010-12-23 20:40:12 +00:00
|
|
|
miiphy_read (devname, addr, MII_BMSR, &bmsr);
|
2007-12-27 15:50:55 +00:00
|
|
|
|
|
|
|
#if defined(CONFIG_PHY_GIGE)
|
2010-12-23 20:40:12 +00:00
|
|
|
if (bmsr & BMSR_ESTATEN)
|
|
|
|
miiphy_read (devname, addr, MII_ESTATUS, &exsr);
|
2007-12-27 15:50:55 +00:00
|
|
|
|
2010-12-23 20:40:12 +00:00
|
|
|
if (exsr & (ESTATUS_1000XF | ESTATUS_1000XH)) {
|
2007-12-27 15:50:55 +00:00
|
|
|
/* 1000BASE-X */
|
|
|
|
u16 anar = 0x0000;
|
|
|
|
|
2010-12-23 20:40:12 +00:00
|
|
|
if (exsr & ESTATUS_1000XF)
|
2011-01-10 11:56:13 +00:00
|
|
|
anar |= ADVERTISE_1000XFULL;
|
2007-12-27 15:50:55 +00:00
|
|
|
|
2010-12-23 20:40:12 +00:00
|
|
|
if (exsr & ESTATUS_1000XH)
|
|
|
|
anar |= ADVERTISE_1000XHALF;
|
2007-12-27 15:50:55 +00:00
|
|
|
|
2010-12-23 20:40:12 +00:00
|
|
|
miiphy_write (devname, addr, MII_ADVERTISE, anar);
|
2007-12-27 15:50:55 +00:00
|
|
|
} else
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
u16 anar, btcr;
|
|
|
|
|
2010-12-23 20:40:12 +00:00
|
|
|
miiphy_read (devname, addr, MII_ADVERTISE, &anar);
|
|
|
|
anar &= ~(0x5000 | LPA_100BASE4 | LPA_100FULL |
|
|
|
|
LPA_100HALF | LPA_10FULL | LPA_10HALF);
|
2007-12-27 15:50:55 +00:00
|
|
|
|
2010-12-23 20:40:12 +00:00
|
|
|
miiphy_read (devname, addr, MII_CTRL1000, &btcr);
|
2007-12-27 15:50:55 +00:00
|
|
|
btcr &= ~(0x00FF | PHY_1000BTCR_1000FD | PHY_1000BTCR_1000HD);
|
|
|
|
|
2010-12-23 20:40:12 +00:00
|
|
|
if (bmsr & BMSR_100BASE4)
|
|
|
|
anar |= LPA_100BASE4;
|
2007-12-27 15:50:55 +00:00
|
|
|
|
2010-12-23 20:40:12 +00:00
|
|
|
if (bmsr & BMSR_100FULL)
|
|
|
|
anar |= LPA_100FULL;
|
2007-12-27 15:50:55 +00:00
|
|
|
|
2010-12-23 20:40:12 +00:00
|
|
|
if (bmsr & BMSR_100HALF)
|
|
|
|
anar |= LPA_100HALF;
|
2007-12-27 15:50:55 +00:00
|
|
|
|
2010-12-23 20:40:12 +00:00
|
|
|
if (bmsr & BMSR_10FULL)
|
|
|
|
anar |= LPA_10FULL;
|
2007-12-27 15:50:55 +00:00
|
|
|
|
2010-12-23 20:40:12 +00:00
|
|
|
if (bmsr & BMSR_10HALF)
|
|
|
|
anar |= LPA_10HALF;
|
2007-12-27 15:50:55 +00:00
|
|
|
|
2010-12-23 20:40:12 +00:00
|
|
|
miiphy_write (devname, addr, MII_ADVERTISE, anar);
|
2007-12-27 15:50:55 +00:00
|
|
|
|
|
|
|
#if defined(CONFIG_PHY_GIGE)
|
2010-12-23 20:40:12 +00:00
|
|
|
if (exsr & ESTATUS_1000_TFULL)
|
2007-12-27 15:50:55 +00:00
|
|
|
btcr |= PHY_1000BTCR_1000FD;
|
|
|
|
|
2010-12-23 20:40:12 +00:00
|
|
|
if (exsr & ESTATUS_1000_THALF)
|
2007-12-27 15:50:55 +00:00
|
|
|
btcr |= PHY_1000BTCR_1000HD;
|
|
|
|
|
2010-12-23 20:40:12 +00:00
|
|
|
miiphy_write (devname, addr, MII_CTRL1000, btcr);
|
2007-12-27 15:50:55 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
#else /* defined(CONFIG_PHY_DYNAMIC_ANEG) */
|
|
|
|
/*
|
|
|
|
* Set up standard advertisement
|
|
|
|
*/
|
|
|
|
u16 adv;
|
2005-08-16 16:18:00 +00:00
|
|
|
|
2010-12-23 20:40:12 +00:00
|
|
|
miiphy_read (devname, addr, MII_ADVERTISE, &adv);
|
|
|
|
adv |= (LPA_LPACK | LPA_100FULL | LPA_100HALF |
|
|
|
|
LPA_10FULL | LPA_10HALF);
|
|
|
|
miiphy_write (devname, addr, MII_ADVERTISE, adv);
|
2002-08-17 09:36:01 +00:00
|
|
|
|
2010-12-23 20:40:12 +00:00
|
|
|
miiphy_read (devname, addr, MII_CTRL1000, &adv);
|
2006-06-30 14:30:46 +00:00
|
|
|
adv |= (0x0300);
|
2010-12-23 20:40:12 +00:00
|
|
|
miiphy_write (devname, addr, MII_CTRL1000, adv);
|
2006-06-30 14:30:46 +00:00
|
|
|
|
2007-12-27 15:50:55 +00:00
|
|
|
#endif /* defined(CONFIG_PHY_DYNAMIC_ANEG) */
|
|
|
|
|
2005-08-16 16:18:00 +00:00
|
|
|
/* Start/Restart aneg */
|
2010-12-23 20:40:12 +00:00
|
|
|
miiphy_read (devname, addr, MII_BMCR, &bmcr);
|
|
|
|
bmcr |= (BMCR_ANENABLE | BMCR_ANRESTART);
|
|
|
|
miiphy_write (devname, addr, MII_BMCR, bmcr);
|
2005-08-16 16:18:00 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************/
|
|
|
|
/* read a phy reg and return the value with a rc */
|
|
|
|
/***********************************************************/
|
2008-02-19 20:58:25 +00:00
|
|
|
/* AMCC_TODO:
|
|
|
|
* Find out of the choice for the emac for MDIO is from the bridges,
|
|
|
|
* i.e. ZMII or RGMII as approporiate. If the bridges are not used
|
|
|
|
* to determine the emac for MDIO, then is the SDR0_ETH_CFG[MDIO_SEL]
|
|
|
|
* used? If so, then this routine below does not apply to the 460EX/GT.
|
|
|
|
*
|
|
|
|
* sr: Currently on 460EX only EMAC0 works with MDIO, so we always
|
|
|
|
* return EMAC0 offset here
|
2008-09-05 06:49:36 +00:00
|
|
|
* vg: For 460EX/460GT if internal GPCS PHY address is specified
|
|
|
|
* return appropriate EMAC offset
|
2008-02-19 20:58:25 +00:00
|
|
|
*/
|
2008-09-05 06:49:36 +00:00
|
|
|
unsigned int miiphy_getemac_offset(u8 addr)
|
2002-08-17 09:36:01 +00:00
|
|
|
{
|
2011-10-02 10:01:27 +00:00
|
|
|
#if defined(CONFIG_440) && \
|
2008-02-19 20:58:25 +00:00
|
|
|
!defined(CONFIG_440SP) && !defined(CONFIG_440SPE) && \
|
2011-10-02 10:01:27 +00:00
|
|
|
!defined(CONFIG_460EX) && !defined(CONFIG_460GT)
|
2005-08-16 16:18:00 +00:00
|
|
|
unsigned long zmii;
|
|
|
|
unsigned long eoffset;
|
|
|
|
|
|
|
|
/* Need to find out which mdi port we're using */
|
2009-10-04 18:04:20 +00:00
|
|
|
zmii = in_be32((void *)ZMII0_FER);
|
2005-08-16 16:18:00 +00:00
|
|
|
|
2007-12-27 15:50:55 +00:00
|
|
|
if (zmii & (ZMII_FER_MDI << ZMII_FER_V (0)))
|
2005-08-16 16:18:00 +00:00
|
|
|
/* using port 0 */
|
|
|
|
eoffset = 0;
|
2007-12-27 15:50:55 +00:00
|
|
|
|
|
|
|
else if (zmii & (ZMII_FER_MDI << ZMII_FER_V (1)))
|
2005-08-16 16:18:00 +00:00
|
|
|
/* using port 1 */
|
|
|
|
eoffset = 0x100;
|
2007-12-27 15:50:55 +00:00
|
|
|
|
|
|
|
else if (zmii & (ZMII_FER_MDI << ZMII_FER_V (2)))
|
2005-08-16 16:18:00 +00:00
|
|
|
/* using port 2 */
|
|
|
|
eoffset = 0x400;
|
2007-12-27 15:50:55 +00:00
|
|
|
|
|
|
|
else if (zmii & (ZMII_FER_MDI << ZMII_FER_V (3)))
|
2005-08-16 16:18:00 +00:00
|
|
|
/* using port 3 */
|
|
|
|
eoffset = 0x600;
|
2007-12-27 15:50:55 +00:00
|
|
|
|
|
|
|
else {
|
2005-08-16 16:18:00 +00:00
|
|
|
/* None of the mdi ports are enabled! */
|
|
|
|
/* enable port 0 */
|
|
|
|
zmii |= ZMII_FER_MDI << ZMII_FER_V (0);
|
2009-10-04 18:04:20 +00:00
|
|
|
out_be32((void *)ZMII0_FER, zmii);
|
2005-08-16 16:18:00 +00:00
|
|
|
eoffset = 0;
|
|
|
|
/* need to soft reset port 0 */
|
2009-10-04 18:04:20 +00:00
|
|
|
zmii = in_be32((void *)EMAC0_MR0);
|
|
|
|
zmii |= EMAC_MR0_SRST;
|
|
|
|
out_be32((void *)EMAC0_MR0, zmii);
|
2005-08-16 16:18:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return (eoffset);
|
|
|
|
#else
|
2007-10-05 15:10:59 +00:00
|
|
|
|
2011-10-02 10:01:27 +00:00
|
|
|
#if defined(CONFIG_405EX)
|
2007-10-05 15:10:59 +00:00
|
|
|
unsigned long rgmii;
|
|
|
|
int devnum = 1;
|
|
|
|
|
2007-10-23 12:03:17 +00:00
|
|
|
rgmii = in_be32((void *)RGMII_FER);
|
2007-10-05 15:10:59 +00:00
|
|
|
if (rgmii & (1 << (19 - devnum)))
|
|
|
|
return 0x100;
|
|
|
|
#endif
|
|
|
|
|
2008-09-05 06:49:36 +00:00
|
|
|
#if defined(CONFIG_460EX) || defined(CONFIG_460GT)
|
|
|
|
u32 eoffset = 0;
|
|
|
|
|
|
|
|
switch (addr) {
|
|
|
|
#if defined(CONFIG_HAS_ETH1) && defined(CONFIG_GPCS_PHY1_ADDR)
|
|
|
|
case CONFIG_GPCS_PHY1_ADDR:
|
2009-10-04 18:04:20 +00:00
|
|
|
if (addr == EMAC_MR1_IPPA_GET(in_be32((void *)EMAC0_MR1 + 0x100)))
|
2008-09-05 06:49:36 +00:00
|
|
|
eoffset = 0x100;
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
#if defined(CONFIG_HAS_ETH2) && defined(CONFIG_GPCS_PHY2_ADDR)
|
|
|
|
case CONFIG_GPCS_PHY2_ADDR:
|
2009-10-04 18:04:20 +00:00
|
|
|
if (addr == EMAC_MR1_IPPA_GET(in_be32((void *)EMAC0_MR1 + 0x300)))
|
2008-09-05 06:49:36 +00:00
|
|
|
eoffset = 0x300;
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
#if defined(CONFIG_HAS_ETH3) && defined(CONFIG_GPCS_PHY3_ADDR)
|
|
|
|
case CONFIG_GPCS_PHY3_ADDR:
|
2009-10-04 18:04:20 +00:00
|
|
|
if (addr == EMAC_MR1_IPPA_GET(in_be32((void *)EMAC0_MR1 + 0x400)))
|
2008-09-05 06:49:36 +00:00
|
|
|
eoffset = 0x400;
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
default:
|
|
|
|
eoffset = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return eoffset;
|
|
|
|
#endif
|
|
|
|
|
2005-08-16 16:18:00 +00:00
|
|
|
return 0;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2008-02-19 20:58:25 +00:00
|
|
|
static int emac_miiphy_wait(u32 emac_reg)
|
2005-08-16 16:18:00 +00:00
|
|
|
{
|
2008-02-19 20:58:25 +00:00
|
|
|
u32 sta_reg;
|
|
|
|
int i;
|
2005-08-16 16:18:00 +00:00
|
|
|
|
2008-02-19 20:58:25 +00:00
|
|
|
/* wait for completion */
|
2002-08-17 09:36:01 +00:00
|
|
|
i = 0;
|
2008-02-19 20:58:25 +00:00
|
|
|
do {
|
2009-10-04 18:04:20 +00:00
|
|
|
sta_reg = in_be32((void *)EMAC0_STACR + emac_reg);
|
2008-02-19 20:58:25 +00:00
|
|
|
if (i++ > 5) {
|
2009-10-04 18:04:20 +00:00
|
|
|
debug("%s [%d]: Timeout! EMAC0_STACR=0x%0x\n", __func__,
|
2008-02-19 20:58:25 +00:00
|
|
|
__LINE__, sta_reg);
|
2002-08-17 09:36:01 +00:00
|
|
|
return -1;
|
|
|
|
}
|
2008-02-19 20:58:25 +00:00
|
|
|
udelay(10);
|
|
|
|
} while ((sta_reg & EMAC_STACR_OC) == EMAC_STACR_OC_MASK);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int emac_miiphy_command(u8 addr, u8 reg, int cmd, u16 value)
|
|
|
|
{
|
|
|
|
u32 emac_reg;
|
|
|
|
u32 sta_reg;
|
|
|
|
|
2008-09-05 06:49:36 +00:00
|
|
|
emac_reg = miiphy_getemac_offset(addr);
|
2008-02-19 20:58:25 +00:00
|
|
|
|
|
|
|
/* wait for completion */
|
|
|
|
if (emac_miiphy_wait(emac_reg) != 0)
|
|
|
|
return -1;
|
|
|
|
|
2005-08-16 16:18:00 +00:00
|
|
|
sta_reg = reg; /* reg address */
|
2008-02-19 20:58:25 +00:00
|
|
|
|
2008-10-19 00:35:50 +00:00
|
|
|
/* set clock (50MHz) and read flags */
|
2006-09-07 09:51:23 +00:00
|
|
|
#if defined(CONFIG_440GX) || defined(CONFIG_440SPE) || \
|
2007-10-05 15:10:59 +00:00
|
|
|
defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
|
2008-02-19 20:58:25 +00:00
|
|
|
defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
|
2007-10-05 15:10:59 +00:00
|
|
|
defined(CONFIG_405EX)
|
2007-12-27 15:50:55 +00:00
|
|
|
#if defined(CONFIG_IBM_EMAC4_V4) /* EMAC4 V4 changed bit setting */
|
2008-02-19 20:58:25 +00:00
|
|
|
sta_reg = (sta_reg & ~EMAC_STACR_OP_MASK) | cmd;
|
2006-06-30 14:30:46 +00:00
|
|
|
#else
|
2008-02-19 20:58:25 +00:00
|
|
|
sta_reg |= cmd;
|
2006-06-30 14:30:46 +00:00
|
|
|
#endif
|
2005-08-16 16:18:00 +00:00
|
|
|
#else
|
2008-02-19 20:58:25 +00:00
|
|
|
sta_reg = (sta_reg | cmd) & ~EMAC_STACR_CLK_100MHZ;
|
2005-08-16 16:18:00 +00:00
|
|
|
#endif
|
|
|
|
|
2008-02-19 20:58:25 +00:00
|
|
|
/* Some boards (mainly 405EP based) define the PHY clock freqency fixed */
|
2003-09-02 22:48:03 +00:00
|
|
|
sta_reg = sta_reg | CONFIG_PHY_CLK_FREQ;
|
2008-02-19 20:58:25 +00:00
|
|
|
sta_reg = sta_reg | ((u32)addr << 5); /* Phy address */
|
2006-06-30 14:30:46 +00:00
|
|
|
sta_reg = sta_reg | EMAC_STACR_OC_MASK; /* new IBM emac v4 */
|
2008-02-19 20:58:25 +00:00
|
|
|
if (cmd == EMAC_STACR_WRITE)
|
|
|
|
memcpy(&sta_reg, &value, 2); /* put in data */
|
|
|
|
|
2009-10-04 18:04:20 +00:00
|
|
|
out_be32((void *)EMAC0_STACR + emac_reg, sta_reg);
|
2008-02-19 20:58:25 +00:00
|
|
|
debug("%s [%d]: sta_reg=%08x\n", __func__, __LINE__, sta_reg);
|
2002-08-17 09:36:01 +00:00
|
|
|
|
2008-02-19 20:58:25 +00:00
|
|
|
/* wait for completion */
|
|
|
|
if (emac_miiphy_wait(emac_reg) != 0)
|
|
|
|
return -1;
|
2007-12-27 15:50:55 +00:00
|
|
|
|
2008-02-19 20:58:25 +00:00
|
|
|
debug("%s [%d]: sta_reg=%08x\n", __func__, __LINE__, sta_reg);
|
2007-12-27 15:50:55 +00:00
|
|
|
if ((sta_reg & EMAC_STACR_PHYE) != 0)
|
2002-08-17 09:36:01 +00:00
|
|
|
return -1;
|
|
|
|
|
|
|
|
return 0;
|
2008-02-19 20:58:25 +00:00
|
|
|
}
|
2002-08-17 09:36:01 +00:00
|
|
|
|
2010-07-27 22:35:08 +00:00
|
|
|
int emac4xx_miiphy_read (const char *devname, unsigned char addr, unsigned char reg,
|
2008-02-19 20:58:25 +00:00
|
|
|
unsigned short *value)
|
2002-08-17 09:36:01 +00:00
|
|
|
{
|
2008-02-19 20:58:25 +00:00
|
|
|
unsigned long sta_reg;
|
2005-08-16 16:18:00 +00:00
|
|
|
unsigned long emac_reg;
|
2002-08-17 09:36:01 +00:00
|
|
|
|
2008-09-05 06:49:36 +00:00
|
|
|
emac_reg = miiphy_getemac_offset(addr);
|
2002-08-17 09:36:01 +00:00
|
|
|
|
2008-02-19 20:58:25 +00:00
|
|
|
if (emac_miiphy_command(addr, reg, EMAC_STACR_READ, 0) != 0)
|
|
|
|
return -1;
|
2002-08-17 09:36:01 +00:00
|
|
|
|
2009-10-04 18:04:20 +00:00
|
|
|
sta_reg = in_be32((void *)EMAC0_STACR + emac_reg);
|
2009-09-07 08:52:24 +00:00
|
|
|
*value = sta_reg >> 16;
|
2007-12-27 15:50:55 +00:00
|
|
|
|
2002-08-17 09:36:01 +00:00
|
|
|
return 0;
|
2008-02-19 20:58:25 +00:00
|
|
|
}
|
2002-08-17 09:36:01 +00:00
|
|
|
|
2008-02-19 20:58:25 +00:00
|
|
|
/***********************************************************/
|
|
|
|
/* write a phy reg and return the value with a rc */
|
|
|
|
/***********************************************************/
|
|
|
|
|
2010-07-27 22:35:08 +00:00
|
|
|
int emac4xx_miiphy_write (const char *devname, unsigned char addr, unsigned char reg,
|
2008-02-19 20:58:25 +00:00
|
|
|
unsigned short value)
|
|
|
|
{
|
|
|
|
return emac_miiphy_command(addr, reg, EMAC_STACR_WRITE, value);
|
|
|
|
}
|