Merge branch 'master' of git://git.denx.de/u-boot-usb
[platform/kernel/u-boot.git] / drivers / net / enc28j60.c
index 98303ac..3238a50 100644 (file)
@@ -17,7 +17,6 @@
 
 #include <config.h>
 #include <common.h>
-#ifdef CONFIG_ENC28J60
 #include <net.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/spi.h>
@@ -331,6 +330,7 @@ static int rxResetCounter = 0;
 int eth_init (bd_t * bis)
 {
        unsigned char estatVal;
+       uchar enetaddr[6];
 
        /* configure GPIO */
        (*((volatile unsigned long *) IO1DIR)) |= ENC_SPI_SLAVE_CS;
@@ -352,7 +352,8 @@ int eth_init (bd_t * bis)
 
        /* initialize controller */
        encReset ();
-       encInit (bis->bi_enetaddr);
+       eth_getenv_enetaddr("ethaddr", enetaddr);
+       encInit (enetaddr);
 
        m_nic_bfs (CTL_REG_ECON1, ENC_ECON1_RXEN);      /* enable receive */
 
@@ -979,5 +980,3 @@ static void phyWrite(unsigned char addr, unsigned short data)
                }
        }
 }
-
-#endif /* CONFIG_ENC28J60 */