]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Fix problem in ppc4xx eth-driver without ethaddr (only without
authorStefan Roese <sr@denx.de>
Mon, 10 Oct 2005 15:43:58 +0000 (17:43 +0200)
committerStefan Roese <sr@denx.de>
Mon, 10 Oct 2005 15:43:58 +0000 (17:43 +0200)
CONFIG_NET_MULTI set)
Patch by Stefan Roese, 10 Oct 2005

CHANGELOG
cpu/ppc4xx/4xx_enet.c

index 3c0ff3fb9e511c0f0bf4122380ba9f8cf0750235..c5b9d3fa60d7bcff59f53b3d8cc517d05fb57da1 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,10 @@
 Changes for U-Boot 1.1.4:
 ======================================================================
 
+* Fix problem in ppc4xx eth-driver without ethaddr (only without
+  CONFIG_NET_MULTI set)
+  Patch by Stefan Roese, 10 Oct 2005
+
 * Fix gzip bmp support (test if malloc fails, warning when truncated).
   Increase CFG_VIDEO_LOGO_MAX_SIZE on HH405 board.
   Patch by Stefan Roese, 07 Oct 2005
index 34f6e973f47fdc86575bb82f7e4d2d204935cd99..d3f1de4359ba1a1166dd043eb87b29f4e418ecd9 100644 (file)
 static uint32_t mal_ier;
 
 #if !defined(CONFIG_NET_MULTI)
-struct eth_device *emac0_dev;
+struct eth_device *emac0_dev = NULL;
 #endif
 
 
@@ -306,8 +306,10 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
 
        /* before doing anything, figure out if we have a MAC address */
        /* if not, bail */
-       if (memcmp (dev->enetaddr, "\0\0\0\0\0\0", 6) == 0)
+       if (memcmp (dev->enetaddr, "\0\0\0\0\0\0", 6) == 0) {
+               printf("ERROR: ethaddr not set!\n");
                return -1;
+       }
 
 #if defined(CONFIG_440GX)
        /* Need to get the OPB frequency so we can access the PHY */
@@ -1486,12 +1488,16 @@ void eth_halt (void) {
 int eth_init (bd_t *bis)
 {
        ppc_4xx_eth_initialize(bis);
-       return(ppc_4xx_eth_init(emac0_dev, bis));
+       if (emac0_dev) {
+               return ppc_4xx_eth_init(emac0_dev, bis);
+       } else {
+               printf("ERROR: ethaddr not set!\n");
+               return -1;
+       }
 }
 
 int eth_send(volatile void *packet, int length)
 {
-
        return (ppc_4xx_eth_send(emac0_dev, packet, length));
 }