]> Pileus Git - ~andy/linux/commitdiff
net/at91_ether: add pdata flag for reverse Eth addr
authorJoachim Eastwood <manabian@gmail.com>
Mon, 22 Oct 2012 08:45:34 +0000 (08:45 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 23 Oct 2012 06:40:10 +0000 (02:40 -0400)
This will allow us to remove the last mach include from at91_ether
and also make it easier to share address setup with macb.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/arm/mach-at91/board-csb337.c
drivers/net/ethernet/cadence/Kconfig
drivers/net/ethernet/cadence/at91_ether.c
include/linux/platform_data/macb.h

index 3e37437a7a613222245df1f297e18cde4a02dc97..aa9b320bad5961877f36117111e19b06314cb7c6 100644 (file)
@@ -53,6 +53,8 @@ static void __init csb337_init_early(void)
 static struct macb_platform_data __initdata csb337_eth_data = {
        .phy_irq_pin    = AT91_PIN_PC2,
        .is_rmii        = 0,
+       /* The CSB337 bootloader stores the MAC the wrong-way around */
+       .rev_eth_addr   = 1,
 };
 
 static struct at91_usbh_data __initdata csb337_usbh_data = {
index f6d0956485f1002931e834058803015a81d391ce..40172d1ca605636ce4dc1103937245857fab376b 100644 (file)
@@ -21,7 +21,6 @@ if NET_CADENCE
 
 config ARM_AT91_ETHER
        tristate "AT91RM9200 Ethernet support"
-       depends on ARM && ARCH_AT91RM9200
        select NET_CORE
        select MACB
        ---help---
index 375d272d1a5fcf5921dcb3097de905973767635f..b92815aabc6594b8ef878820e356f2fb4d5f6c23 100644 (file)
@@ -32,8 +32,6 @@
 #include <linux/phy.h>
 #include <linux/io.h>
 
-#include <asm/mach-types.h>
-
 #include "macb.h"
 
 #define DRV_NAME       "at91_ether"
 
 static short __init unpack_mac_address(struct net_device *dev, unsigned int hi, unsigned int lo)
 {
+       struct macb *lp = netdev_priv(dev);
        char addr[6];
 
-       if (machine_is_csb337()) {
+       if (lp->board_data.rev_eth_addr) {
                addr[5] = (lo & 0xff);                  /* The CSB337 bootloader stores the MAC the wrong-way around */
                addr[4] = (lo & 0xff00) >> 8;
                addr[3] = (lo & 0xff0000) >> 16;
index b081c7245ec8a94cd7ed3664c1f91a0e15814897..044a124bfbbc6b313d96f187a598fcb1438b8cc6 100644 (file)
@@ -12,6 +12,7 @@ struct macb_platform_data {
        u32             phy_mask;
        int             phy_irq_pin;    /* PHY IRQ */
        u8              is_rmii;        /* using RMII interface? */
+       u8              rev_eth_addr;   /* reverse Ethernet address byte order */
 };
 
 #endif /* __MACB_PDATA_H__ */