X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fnet%2Fmacb.c;h=8bacbda71966942c12944d148a7acce0d176c59b;hb=58d9ff936f106d8319a4be8a253a66adc2772736;hp=72ea1fc11d6ac04d2f6108060b3aba9c9eaafa88;hpb=0ea91423f47461bf7eaed2d4aff198076dd07fd5;p=u-boot diff --git a/drivers/net/macb.c b/drivers/net/macb.c index 72ea1fc11d..8bacbda719 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c @@ -51,8 +51,6 @@ #include "macb.h" -#define barrier() asm volatile("" ::: "memory") - #define CONFIG_SYS_MACB_RX_BUFFER_SIZE 4096 #define CONFIG_SYS_MACB_RX_RING_SIZE (CONFIG_SYS_MACB_RX_BUFFER_SIZE / 128) #define CONFIG_SYS_MACB_TX_RING_SIZE 16 @@ -197,8 +195,7 @@ int macb_miiphy_write(const char *devname, u8 phy_adr, u8 reg, u16 value) #if defined(CONFIG_CMD_NET) -static int macb_send(struct eth_device *netdev, volatile void *packet, - int length) +static int macb_send(struct eth_device *netdev, void *packet, int length) { struct macb_device *macb = to_macb(netdev); unsigned long paddr, ctrl; @@ -365,7 +362,7 @@ static int macb_phy_find(struct macb_device *macb) } /* PHY isn't up to snuff */ - printf("%s: PHY not found", macb->netdev.name); + printf("%s: PHY not found\n", macb->netdev.name); return 0; } @@ -472,7 +469,7 @@ static int macb_init(struct eth_device *netdev, bd_t *bd) #if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \ defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91SAM9G20) || \ defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \ - defined(CONFIG_AT91SAM9XE) + defined(CONFIG_AT91SAM9XE) || defined(CONFIG_AT91SAM9X5) macb_writel(macb, USRIO, MACB_BIT(RMII) | MACB_BIT(CLKEN)); #else macb_writel(macb, USRIO, 0); @@ -481,7 +478,7 @@ static int macb_init(struct eth_device *netdev, bd_t *bd) #if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \ defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91SAM9G20) || \ defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \ - defined(CONFIG_AT91SAM9XE) + defined(CONFIG_AT91SAM9XE) || defined(CONFIG_AT91SAM9X5) macb_writel(macb, USRIO, MACB_BIT(CLKEN)); #else macb_writel(macb, USRIO, MACB_BIT(MII)); @@ -522,9 +519,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; }