
Hello
The following patch fixes a problem when reading the MII status register. Due to the internal design of many PHYs you have to read the register twice.
The problem is more apparent in 10Mbit mode.
Regards
Pantelis
miiphyutil.c | 2 ++ 1 files changed, 2 insertions(+)
diff -ruNb u-boot-original/common/miiphyutil.c u-boot-miifix/common/miiphyutil.c --- u-boot-original/common/miiphyutil.c 2004-03-30 14:37:28.670930264 +0300 +++ u-boot-miifix/common/miiphyutil.c 2004-03-30 15:40:31.779810296 +0300 @@ -203,6 +203,8 @@ { unsigned short reg;
+ /* dummy read; needed to latch some phys */ + (void)miiphy_read(addr, PHY_BMSR, ®); if (miiphy_read (addr, PHY_BMSR, ®)) { puts ("PHY_BMSR read failed, assuming no link\n"); return (0);