From f89920c3e4be1528ceb5b645d8aaf19968275609 Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Fri, 12 Aug 2005 23:15:53 +0200 Subject: Preserve PHY_BMCR during a soft reset. Patch by Carl Riechers, 24 Jun 2005 --- common/miiphyutil.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'common/miiphyutil.c') diff --git a/common/miiphyutil.c b/common/miiphyutil.c index 2b0dcf4f2c..13b9c65dc8 100644 --- a/common/miiphyutil.c +++ b/common/miiphyutil.c @@ -93,7 +93,13 @@ int miiphy_reset (unsigned char addr) unsigned short reg; int loop_cnt; - if (miiphy_write (addr, PHY_BMCR, 0x8000) != 0) { + if (miiphy_read (addr, PHY_BMCR, ®) != 0) { +#ifdef DEBUG + printf ("PHY status read failed\n"); +#endif + return (-1); + } + if (miiphy_write (addr, PHY_BMCR, reg | 0x8000) != 0) { #ifdef DEBUG puts ("PHY reset failed\n"); #endif -- cgit v1.2.1