]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/miiphyutil.c
Preserve PHY_BMCR during a soft reset.
[karo-tx-uboot.git] / common / miiphyutil.c
index 2b0dcf4f2ce1af67d7f02f7100757dad921c85d4..13b9c65dc8771668add77b8d88c7317ae4ad1443 100644 (file)
@@ -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