]> git.sur5r.net Git - u-boot/blobdiff - drivers/net/macb.c
Merge branch 'next' of git://git.denx.de/u-boot-mpc83xx
[u-boot] / drivers / net / macb.c
index 1f7cc322e0533b87d2da41f574e849244f4f8d73..bf3983a00c67a5ce8b51292955f1a24064691dd9 100644 (file)
@@ -36,6 +36,7 @@
 #include <asm/io.h>
 #include <asm/dma-mapping.h>
 #include <asm/arch/clk.h>
+#include <asm-generic/errno.h>
 
 #include "macb.h"
 
@@ -397,9 +398,14 @@ static int macb_phy_init(struct macb_device *macb)
        }
 
 #ifdef CONFIG_PHYLIB
-       phydev->bus = macb->bus;
-       phydev->dev = netdev;
-       phydev->addr = macb->phy_addr;
+       /* need to consider other phy interface mode */
+       phydev = phy_connect(macb->bus, macb->phy_addr, netdev,
+                            PHY_INTERFACE_MODE_RGMII);
+       if (!phydev) {
+               printf("phy_connect failed\n");
+               return -ENODEV;
+       }
+
        phy_config(phydev);
 #endif