Browse Source

Preserve PHY_BMCR during a soft reset.
Patch by Carl Riechers, 24 Jun 2005

Wolfgang Denk 20 years ago
parent
commit
f89920c3e4
2 changed files with 10 additions and 1 deletions
  1. 3 0
      CHANGELOG
  2. 7 1
      common/miiphyutil.c

+ 3 - 0
CHANGELOG

@@ -2,6 +2,9 @@
 Changes for U-Boot 1.1.3:
 Changes for U-Boot 1.1.3:
 ======================================================================
 ======================================================================
 
 
+* Preserve PHY_BMCR during a soft reset.
+  Patch by Carl Riechers, 24 Jun 2005
+
 * VoiceBlue update: eeprom tool can also store firmware version now.
 * VoiceBlue update: eeprom tool can also store firmware version now.
   eeprom.bin is runable by jumping at load address.
   eeprom.bin is runable by jumping at load address.
   Patch by Ladislav Michl, 23 May 2005
   Patch by Ladislav Michl, 23 May 2005

+ 7 - 1
common/miiphyutil.c

@@ -93,7 +93,13 @@ int miiphy_reset (unsigned char addr)
 	unsigned short reg;
 	unsigned short reg;
 	int loop_cnt;
 	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
 #ifdef DEBUG
 		puts ("PHY reset failed\n");
 		puts ("PHY reset failed\n");
 #endif
 #endif