if (miiphy_read (addr, PHY_PHYIDR2, &tmp) != 0) {
#ifdef DEBUG
- printf ("PHY ID register 2 read failed\n");
+ puts ("PHY ID register 2 read failed\n");
#endif
return (-1);
}
if (miiphy_read (addr, PHY_PHYIDR1, &tmp) != 0) {
#ifdef DEBUG
- printf ("PHY ID register 1 read failed\n");
+ puts ("PHY ID register 1 read failed\n");
#endif
return (-1);
}
if (miiphy_write (addr, PHY_BMCR, 0x8000) != 0) {
#ifdef DEBUG
- printf ("PHY reset failed\n");
+ puts ("PHY reset failed\n");
#endif
return (-1);
}
-
+#ifdef CONFIG_PHY_RESET_DELAY
+ udelay (CONFIG_PHY_RESET_DELAY); /* Intel LXT971A needs this */
+#endif
/*
* Poll the control register for the reset bit to go to 0 (it is
* auto-clearing). This should happen within 0.5 seconds per the
while (((reg & 0x8000) != 0) && (loop_cnt++ < 1000000)) {
if (miiphy_read (addr, PHY_BMCR, ®) != 0) {
# ifdef DEBUG
- printf ("PHY status read failed\n");
+ puts ("PHY status read failed\n");
# endif
return (-1);
}
if ((reg & 0x8000) == 0) {
return (0);
} else {
- printf ("PHY reset timed out\n");
+ puts ("PHY reset timed out\n");
return (-1);
}
return (0);
{
unsigned short reg;
+ if (miiphy_read (addr, PHY_1000BTSR, ®)) {
+ printf ("PHY 1000BT Status read failed\n");
+ } else {
+ if (reg != 0xFFFF) {
+ if ((reg & (PHY_1000BTSR_1000FD | PHY_1000BTSR_1000HD)) !=0) {
+ return (_1000BASET);
+ }
+ }
+ }
+
if (miiphy_read (addr, PHY_ANLPAR, ®)) {
- printf ("PHY speed1 read failed, assuming 10bT\n");
+ puts ("PHY speed1 read failed, assuming 10bT\n");
return (_10BASET);
}
-
if ((reg & PHY_ANLPAR_100) != 0) {
return (_100BASET);
} else {
{
unsigned short reg;
+
+ if (miiphy_read (addr, PHY_1000BTSR, ®)) {
+ printf ("PHY 1000BT Status read failed\n");
+ } else {
+ if ( (reg != 0xFFFF) &&
+ (reg & (PHY_1000BTSR_1000FD | PHY_1000BTSR_1000HD)) ) {
+ if ((reg & PHY_1000BTSR_1000FD) !=0) {
+ return (FULL);
+ } else {
+ return (HALF);
+ }
+ }
+ }
+
if (miiphy_read (addr, PHY_ANLPAR, ®)) {
- printf ("PHY duplex read failed, assuming half duplex\n");
+ puts ("PHY duplex read failed, assuming half duplex\n");
return (HALF);
}
unsigned short reg;
if (miiphy_read (addr, PHY_BMSR, ®)) {
- printf ("PHY_BMSR read failed, assuming no link\n");
+ puts ("PHY_BMSR read failed, assuming no link\n");
return (0);
}