Merge branch 'agust@denx.de' of git://git.denx.de/u-boot-staging
[oweals/u-boot.git] / drivers / net / macb.c
index acb8d20b136090b37bfca69d5c4e234cada00652..c63eea966af5c7f473e03c71c9950913ceb535d6 100644 (file)
@@ -469,17 +469,19 @@ static int macb_init(struct eth_device *netdev, bd_t *bd)
 
        /* choose RMII or MII mode. This depends on the board */
 #ifdef CONFIG_RMII
-#if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \
-    defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91SAM9G20) || \
-       defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45)
+#if    defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \
+       defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91SAM9G20) || \
+       defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \
+       defined(CONFIG_AT91SAM9XE)
        macb_writel(macb, USRIO, MACB_BIT(RMII) | MACB_BIT(CLKEN));
 #else
        macb_writel(macb, USRIO, 0);
 #endif
 #else
-#if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \
-    defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91SAM9G20) || \
-       defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45)
+#if    defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \
+       defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91SAM9G20) || \
+       defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \
+       defined(CONFIG_AT91SAM9XE)
        macb_writel(macb, USRIO, MACB_BIT(CLKEN));
 #else
        macb_writel(macb, USRIO, MACB_BIT(MII));
@@ -520,9 +522,10 @@ static int macb_write_hwaddr(struct eth_device *dev)
        u16 hwaddr_top;
 
        /* set hardware address */
-       hwaddr_bottom = cpu_to_le32(*((u32 *)dev->enetaddr));
+       hwaddr_bottom = dev->enetaddr[0] | dev->enetaddr[1] << 8 |
+                       dev->enetaddr[2] << 16 | dev->enetaddr[3] << 24;
        macb_writel(macb, SA1B, hwaddr_bottom);
-       hwaddr_top = cpu_to_le16(*((u16 *)(dev->enetaddr + 4)));
+       hwaddr_top = dev->enetaddr[4] | dev->enetaddr[5] << 8;
        macb_writel(macb, SA1T, hwaddr_top);
        return 0;
 }