summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorWolfgang Denk <wd@pollux.denx.de>2005-08-12 23:15:53 +0200
committerWolfgang Denk <wd@pollux.denx.de>2005-08-12 23:15:53 +0200
commitf89920c3e4be1528ceb5b645d8aaf19968275609 (patch)
tree10382c924087f6cf212868c5c23269b477087bc3 /common
parente5445288318de74e1fb63920e7ed7bf48088c3c2 (diff)
downloadu-boot-imx-f89920c3e4be1528ceb5b645d8aaf19968275609.zip
u-boot-imx-f89920c3e4be1528ceb5b645d8aaf19968275609.tar.gz
u-boot-imx-f89920c3e4be1528ceb5b645d8aaf19968275609.tar.bz2
Preserve PHY_BMCR during a soft reset.
Patch by Carl Riechers, 24 Jun 2005
Diffstat (limited to 'common')
-rw-r--r--common/miiphyutil.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/common/miiphyutil.c b/common/miiphyutil.c
index 2b0dcf4..13b9c65 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, &reg) != 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