make cadence ethernet drivers build on any architecture
Subsystems (6)
v2 cover make cadence ethernet drivers build on any architecture
This series makes the at91_ether and macb driver build-able on any architecture.
Patch 1 removes the HAVE_NET_MACB from the cadence Kconfig and this allow macb to be built on any architecture. The macb driver requires no other modifications.
Patch 3 moves a bootloader quirk for CSB337 from at91_ether into platform data as a flag. This allow us to remove the last mach include and build this driver on any architecture. It also make it easier to share the address setup between at91_ether and macb.
The next series will make the at91_ether driver use address setting and statistics from macb. There is also a clean up of print outs plus some comment/style fixes.
Joachim Eastwood (3):
net/cadence: get rid of HAVE_NET_MACB net/at91_ether: select MACB in Kconfig net/at91_ether: add pdata flag for reverse Eth addr
arch/arm/mach-at91/Kconfig | 4 ---- arch/arm/mach-at91/board-csb337.c | 2 ++ arch/avr32/Kconfig | 1 - drivers/net/ethernet/cadence/Kconfig | 8 +------- drivers/net/ethernet/cadence/Makefile | 2 +- drivers/net/ethernet/cadence/at91_ether.c | 5 ++--- include/linux/platform_data/macb.h | 1 + 7 files changed, 7 insertions(+), 16 deletions(-)
Signature · 1 line
1.7.12.4
PATCH v2 1/3 net/cadence: get rid of HAVE_NET_MACB
macb is a platform driver and there is nothing that prevents this driver from being built on non-ARM/AVR32 platforms.
--- arch/arm/mach-at91/Kconfig | 4 ---- arch/avr32/Kconfig | 1 - drivers/net/ethernet/cadence/Kconfig | 5 ----- 3 files changed, 10 deletions(-)
arch/arm/mach-at91/Kconfig +0 -4
@@ -45,7 +45,6 @@ config SOC_AT91RM9200 config SOC_AT91SAM9260 bool "AT91SAM9260, AT91SAM9XE or AT91SAM9G20" select HAVE_AT91_DBGU0 - select HAVE_NET_MACB select SOC_AT91SAM9 help Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE
@@ -63,7 +62,6 @@ config SOC_AT91SAM9263 bool "AT91SAM9263" select HAVE_AT91_DBGU1 select HAVE_FB_ATMEL - select HAVE_NET_MACB select SOC_AT91SAM9 config SOC_AT91SAM9RL
@@ -76,7 +74,6 @@ config SOC_AT91SAM9G45 bool "AT91SAM9G45 or AT91SAM9M10 families" select HAVE_AT91_DBGU1 select HAVE_FB_ATMEL - select HAVE_NET_MACB select SOC_AT91SAM9 help Select this if you are using one of Atmel's AT91SAM9G45 family SoC.
@@ -86,7 +83,6 @@ config SOC_AT91SAM9X5 bool "AT91SAM9x5 family" select HAVE_AT91_DBGU0 select HAVE_FB_ATMEL - select HAVE_NET_MACB select SOC_AT91SAM9 help Select this if you are using one of Atmel's AT91SAM9x5 family SoC.
arch/avr32/Kconfig +0 -1
@@ -80,7 +80,6 @@ config PLATFORM_AT32AP select ARCH_REQUIRE_GPIOLIB select GENERIC_ALLOCATOR select HAVE_FB_ATMEL - select HAVE_NET_MACB # # CPU types
drivers/net/ethernet/cadence/Kconfig +0 -5
@@ -2,13 +2,9 @@ # Atmel device configuration # -config HAVE_NET_MACB - bool - config NET_CADENCE bool "Cadence devices" default y - depends on HAVE_NET_MACB || (ARM && ARCH_AT91RM9200) ---help--- If you have a network (Ethernet) card belonging to this class, say Y. Make sure you know the name of your card. Read the Ethernet-HOWTO,
@@ -34,7 +30,6 @@ config ARM_AT91_ETHER config MACB tristate "Cadence MACB/GEM support" - depends on HAVE_NET_MACB select PHYLIB ---help--- The Cadence MACB ethernet interface is found on many Atmel AT32 and
Signature · 1 line
1.7.12.4
PATCH v2 2/3 net/at91_ether: select MACB in Kconfig
In reply to Joachim EastwoodNow that HAVE_NET_MACB is gone let's just select MACB to satisfy the dependecies in at91_ether.
--- drivers/net/ethernet/cadence/Kconfig | 2 +- drivers/net/ethernet/cadence/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/cadence/Kconfig +1 -1
@@ -23,7 +23,7 @@ config ARM_AT91_ETHER tristate "AT91RM9200 Ethernet support" depends on ARM && ARCH_AT91RM9200 select NET_CORE - select PHYLIB + select MACB ---help--- If you wish to compile a kernel for the AT91RM9200 and enable ethernet support, then you should always answer Y to this.
drivers/net/ethernet/cadence/Makefile +1 -1
@@ -2,5 +2,5 @@ # Makefile for the Atmel network device drivers. # -obj-$(CONFIG_ARM_AT91_ETHER) += at91_ether.o macb.o +obj-$(CONFIG_ARM_AT91_ETHER) += at91_ether.o obj-$(CONFIG_MACB) += macb.o
Signature · 1 line
1.7.12.4
PATCH v2 3/3 net/at91_ether: add pdata flag for reverse Eth addr
In reply to Joachim EastwoodThis will allow us to remove the last mach include from at91_ether and also make it easier to share address setup with macb.
--- arch/arm/mach-at91/board-csb337.c | 2 ++ drivers/net/ethernet/cadence/Kconfig | 1 - drivers/net/ethernet/cadence/at91_ether.c | 5 ++--- include/linux/platform_data/macb.h | 1 + 4 files changed, 5 insertions(+), 4 deletions(-)
arch/arm/mach-at91/board-csb337.c +2 -0
@@ -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 = {
drivers/net/ethernet/cadence/Kconfig +0 -1
@@ -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---
drivers/net/ethernet/cadence/at91_ether.c +2 -3
@@ -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"
@@ -61,9 +59,10 @@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 ;
include/linux/platform_data/macb.h +1 -0
@@ -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__ */
Signature · 1 line
1.7.12.4