net/4xx: Install interrupt handler after driver registration
authorStefan Roese <sr@denx.de>
Tue, 12 Jul 2011 11:26:47 +0000 (13:26 +0200)
committerStefan Roese <sr@denx.de>
Thu, 28 Jul 2011 17:16:16 +0000 (19:16 +0200)
Only install der 4xx-EMAC interrupt handlers *after* the core
network driver is registered.

This problem was noticed on the APM Taishan 440GX board, where
the board hung upon bootup after displaying "Net:".

Signed-off-by: Stefan Roese <sr@denx.de>
drivers/net/4xx_enet.c

index b1763b18bbe6d1e8541f83d2980ccd5f930de8f7..f328574fe4b3cf86dbcdc691b14e83397437e9b2 100644 (file)
@@ -2035,6 +2035,13 @@ int ppc_4xx_eth_initialize (bd_t * bis)
                dev->send = ppc_4xx_eth_send;
                dev->recv = ppc_4xx_eth_rx;
 
+               eth_register(dev);
+
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
+               miiphy_register(dev->name,
+                               emac4xx_miiphy_read, emac4xx_miiphy_write);
+#endif
+
                if (0 == virgin) {
                        /* set the MAL IER ??? names may change with new spec ??? */
 #if defined(CONFIG_440SPE) || \
@@ -2072,13 +2079,6 @@ int ppc_4xx_eth_initialize (bd_t * bis)
                                             dev);
                        virgin = 1;
                }
-
-               eth_register (dev);
-
-#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
-               miiphy_register (dev->name,
-                                emac4xx_miiphy_read, emac4xx_miiphy_write);
-#endif
        }                       /* end for each supported device */
 
        return 0;