Merge branch 'master' of /home/git/u-boot
[oweals/u-boot.git] / board / bf537-stamp / bf537-stamp.c
index 919cef688dbdd5992fb225a42a0f9be8a4b1aa7b..d279817bbab79b90429c020fe6d53c5549010b8d 100644 (file)
 #include <command.h>
 #include <asm/blackfin.h>
 #include <asm/io.h>
+#include <net.h>
 #include "ether_bf537.h"
+#include <asm/mach-common/bits/bootrom.h>
+
+/**
+ * is_valid_ether_addr - Determine if the given Ethernet address is valid
+ * @addr: Pointer to a six-byte array containing the Ethernet address
+ *
+ * Check that the Ethernet address (MAC) is not 00:00:00:00:00:00, is not
+ * a multicast address, and is not FF:FF:FF:FF:FF:FF.
+ *
+ * Return true if the address is valid.
+ */
+static inline int is_valid_ether_addr(const u8 * addr)
+{
+       /* FF:FF:FF:FF:FF:FF is a multicast address so we don't need to
+        * explicitly check for it here. */
+       return !is_multicast_ether_addr(addr) && !is_zero_ether_addr(addr);
+}
+
+DECLARE_GLOBAL_DATA_PTR;
 
 #define POST_WORD_ADDR 0xFF903FFC
 
@@ -98,7 +118,7 @@ int checkboard(void)
 void cf_outb(unsigned char val, volatile unsigned char *addr)
 {
        *(addr) = val;
-       sync();
+       SSYNC();
 }
 
 unsigned char cf_inb(volatile unsigned char *addr)
@@ -106,7 +126,7 @@ unsigned char cf_inb(volatile unsigned char *addr)
        volatile unsigned char c;
 
        c = *(addr);
-       sync();
+       SSYNC();
 
        return c;
 }
@@ -117,7 +137,7 @@ void cf_insw(unsigned short *sect_buf, unsigned short *addr, int words)
 
        for (i = 0; i < words; i++)
                *(sect_buf + i) = *(addr);
-       sync();
+       SSYNC();
 }
 
 void cf_outsw(unsigned short *addr, unsigned short *sect_buf, int words)
@@ -126,13 +146,12 @@ void cf_outsw(unsigned short *addr, unsigned short *sect_buf, int words)
 
        for (i = 0; i < words; i++)
                *(addr) = *(sect_buf + i);
-       sync();
+       SSYNC();
 }
 #endif                         /* CONFIG_BFIN_IDE */
 
 long int initdram(int board_type)
 {
-       DECLARE_GLOBAL_DATA_PTR;
 #ifdef DEBUG
        int brate;
        char *tmp = getenv("baudrate");