summaryrefslogtreecommitdiff
path: root/common/miiphyutil.c
diff options
context:
space:
mode:
authorMinkyu Kang <mk7.kang@samsung.com>2010-03-15 10:51:36 +0900
committerMinkyu Kang <mk7.kang@samsung.com>2010-03-15 10:51:36 +0900
commit995a4b1d83a08223c82c1e15778b02e85e5bba51 (patch)
tree0acb85278216df76d8fb7284b32d6dd95a1fc978 /common/miiphyutil.c
parenta8d25fc26f681a9c4dfb062ebb4b00b9509a7966 (diff)
parent44de3e8ff7ed48bf96ec6c5e2173187d9c1c61e6 (diff)
downloadu-boot-imx-995a4b1d83a08223c82c1e15778b02e85e5bba51.zip
u-boot-imx-995a4b1d83a08223c82c1e15778b02e85e5bba51.tar.gz
u-boot-imx-995a4b1d83a08223c82c1e15778b02e85e5bba51.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-arm
Conflicts: board/davinci/da830evm/da830evm.c board/edb93xx/sdram_cfg.c board/esd/otc570/otc570.c board/netstar/eeprom.c board/netstar/eeprom_start.S cpu/arm920t/ep93xx/timer.c include/configs/netstar.h include/configs/otc570.h Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Diffstat (limited to 'common/miiphyutil.c')
-rw-r--r--common/miiphyutil.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/common/miiphyutil.c b/common/miiphyutil.c
index 196ef4a..856fbc7 100644
--- a/common/miiphyutil.c
+++ b/common/miiphyutil.c
@@ -293,7 +293,7 @@ int miiphy_info (char *devname, unsigned char addr, unsigned int *oui,
int miiphy_reset (char *devname, unsigned char addr)
{
unsigned short reg;
- int loop_cnt;
+ int timeout = 500;
if (miiphy_read (devname, addr, PHY_BMCR, &reg) != 0) {
debug ("PHY status read failed\n");
@@ -311,13 +311,13 @@ int miiphy_reset (char *devname, unsigned char addr)
* auto-clearing). This should happen within 0.5 seconds per the
* IEEE spec.
*/
- loop_cnt = 0;
reg = 0x8000;
- while (((reg & 0x8000) != 0) && (loop_cnt++ < 1000000)) {
- if (miiphy_read (devname, addr, PHY_BMCR, &reg) != 0) {
- debug ("PHY status read failed\n");
- return (-1);
+ while (((reg & 0x8000) != 0) && timeout--) {
+ if (miiphy_read(devname, addr, PHY_BMCR, &reg) != 0) {
+ debug("PHY status read failed\n");
+ return -1;
}
+ udelay(1000);
}
if ((reg & 0x8000) == 0) {
return (0);