From: Joachim Eastwood <hidden> Date: 2012-10-21 14:23:07
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 CSB337 board setup. 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.
Patch 4-5 removes the now unused HAVE_NET_MACB config symbol from AT91/AVR32 Kconfig.
Note that patch 3 is not tested on a real CSB337 board. I only tested it on an other AT91RM9200 board to verify the logic that reverses the address byte order works.
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 (5):
net/cadence: get rid of HAVE_NET_MACB
net/at91_ether: select MACB in Kconfig
net/at91_ether: move eth addr quirk into csb337 board setup
ARM: AT91: Remove HAVE_NET_MACB
AVR32: Remove HAVE_NET_MACB
arch/arm/mach-at91/Kconfig | 4 ----
arch/arm/mach-at91/board-csb337.c | 35 +++++++++++++++++++++++++++++++
arch/avr32/Kconfig | 1 -
drivers/net/ethernet/cadence/Kconfig | 8 +------
drivers/net/ethernet/cadence/Makefile | 2 +-
drivers/net/ethernet/cadence/at91_ether.c | 26 ++++++-----------------
6 files changed, 43 insertions(+), 33 deletions(-)
--
1.7.12.4
From: Joachim Eastwood <hidden> Date: 2012-10-21 14:23:08
macb is a platform driver and there is nothing that prevents
this driver from being built on non-ARM/AVR32 platforms.
Signed-off-by: Joachim Eastwood <redacted>
---
drivers/net/ethernet/cadence/Kconfig | 5 -----
1 file changed, 5 deletions(-)
From: Joachim Eastwood <hidden> Date: 2012-10-21 14:23:09
Now that HAVE_NET_MACB is gone let's just select MACB to
satisfy the dependecies in at91_ether.
PHYLIB will then by selected by MACB.
Signed-off-by: Joachim Eastwood <redacted>
---
drivers/net/ethernet/cadence/Kconfig | 2 +-
drivers/net/ethernet/cadence/Makefile | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
From: Joachim Eastwood <hidden> Date: 2012-10-21 14:23:10
Move Ethernet address byte order fix for csb337 into it's board
setup.
This will allow us to remove the last mach include from at91_ether
and also to share the address setup with the macb driver.
Signed-off-by: Joachim Eastwood <redacted>
---
arch/arm/mach-at91/board-csb337.c | 35 +++++++++++++++++++++++++++++++
drivers/net/ethernet/cadence/Kconfig | 1 -
drivers/net/ethernet/cadence/at91_ether.c | 26 ++++++-----------------
3 files changed, 41 insertions(+), 21 deletions(-)
@@ -55,30 +53,18 @@*U-BootontheAT91RM9200-DKdonotdothis.**-Likewiseitmuststoretheaddressesinthecorrectbyteorder.-*MicroMonitor(uMon)ontheCSB337doesthisincorrectly(and-*continuestodoso,forbug-compatibility).*/staticshort__initunpack_mac_address(structnet_device*dev,unsignedinthi,unsignedintlo){charaddr[6];-if(machine_is_csb337()){-addr[5]=(lo&0xff);/* The CSB337 bootloader stores the MAC the wrong-way around */-addr[4]=(lo&0xff00)>>8;-addr[3]=(lo&0xff0000)>>16;-addr[2]=(lo&0xff000000)>>24;-addr[1]=(hi&0xff);-addr[0]=(hi&0xff00)>>8;-}-else{-addr[0]=(lo&0xff);-addr[1]=(lo&0xff00)>>8;-addr[2]=(lo&0xff0000)>>16;-addr[3]=(lo&0xff000000)>>24;-addr[4]=(hi&0xff);-addr[5]=(hi&0xff00)>>8;-}+addr[0]=(lo&0xff);+addr[1]=(lo&0xff00)>>8;+addr[2]=(lo&0xff0000)>>16;+addr[3]=(lo&0xff000000)>>24;+addr[4]=(hi&0xff);+addr[5]=(hi&0xff00)>>8;if(is_valid_ether_addr(addr)){memcpy(dev->dev_addr,&addr,6);
From: Joachim Eastwood <hidden> Date: 2012-10-21 14:23:11
HAVE_NET_MACB has already been removed from the driver itself
so removed it from mach Kconfig as well.
Signed-off-by: Joachim Eastwood <redacted>
---
arch/arm/mach-at91/Kconfig | 4 ----
1 file changed, 4 deletions(-)
From: Joachim Eastwood <hidden> Date: 2012-10-21 14:23:12
HAVE_NET_MACB has already been removed from the driver itself
so removed it from arch Kconfig as well.
Signed-off-by: Joachim Eastwood <redacted>
---
arch/avr32/Kconfig | 1 -
1 file changed, 1 deletion(-)
Move Ethernet address byte order fix for csb337 into it's board
setup.
This will allow us to remove the last mach include from at91_ether
and also to share the address setup with the macb driver.
no the at91rm9200 move to DT this is not compatible with it
you need to pass ths in info via platform_data
and do not touch driver code related stuff in boards
Best Regards,
J.
@@ -55,30 +53,18 @@*U-BootontheAT91RM9200-DKdonotdothis.**-Likewiseitmuststoretheaddressesinthecorrectbyteorder.-*MicroMonitor(uMon)ontheCSB337doesthisincorrectly(and-*continuestodoso,forbug-compatibility).*/staticshort__initunpack_mac_address(structnet_device*dev,unsignedinthi,unsignedintlo){charaddr[6];-if(machine_is_csb337()){-addr[5]=(lo&0xff);/* The CSB337 bootloader stores the MAC the wrong-way around */-addr[4]=(lo&0xff00)>>8;-addr[3]=(lo&0xff0000)>>16;-addr[2]=(lo&0xff000000)>>24;-addr[1]=(hi&0xff);-addr[0]=(hi&0xff00)>>8;-}-else{-addr[0]=(lo&0xff);-addr[1]=(lo&0xff00)>>8;-addr[2]=(lo&0xff0000)>>16;-addr[3]=(lo&0xff000000)>>24;-addr[4]=(hi&0xff);-addr[5]=(hi&0xff00)>>8;-}+addr[0]=(lo&0xff);+addr[1]=(lo&0xff00)>>8;+addr[2]=(lo&0xff0000)>>16;+addr[3]=(lo&0xff000000)>>24;+addr[4]=(hi&0xff);+addr[5]=(hi&0xff00)>>8;if(is_valid_ether_addr(addr)){memcpy(dev->dev_addr,&addr,6);
Now that HAVE_NET_MACB is gone let's just select MACB to
satisfy the dependecies in at91_ether.
PHYLIB will then by selected by MACB.
Signed-off-by: Joachim Eastwood <redacted>
---
drivers/net/ethernet/cadence/Kconfig | 2 +-
drivers/net/ethernet/cadence/Makefile | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Move Ethernet address byte order fix for csb337 into it's board
setup.
This will allow us to remove the last mach include from at91_ether
and also to share the address setup with the macb driver.
no the current drivers expect mach/board.h, mach/at91rm9200_emac.h, asm/gpio.h
waht you did will not even compile on non at91 platform
Did you even compile it on non at91?
Best Regards,
J.
@@ -55,30 +53,18 @@*U-BootontheAT91RM9200-DKdonotdothis.**-Likewiseitmuststoretheaddressesinthecorrectbyteorder.-*MicroMonitor(uMon)ontheCSB337doesthisincorrectly(and-*continuestodoso,forbug-compatibility).*/staticshort__initunpack_mac_address(structnet_device*dev,unsignedinthi,unsignedintlo){charaddr[6];-if(machine_is_csb337()){-addr[5]=(lo&0xff);/* The CSB337 bootloader stores the MAC the wrong-way around */-addr[4]=(lo&0xff00)>>8;-addr[3]=(lo&0xff0000)>>16;-addr[2]=(lo&0xff000000)>>24;-addr[1]=(hi&0xff);-addr[0]=(hi&0xff00)>>8;-}-else{-addr[0]=(lo&0xff);-addr[1]=(lo&0xff00)>>8;-addr[2]=(lo&0xff0000)>>16;-addr[3]=(lo&0xff000000)>>24;-addr[4]=(hi&0xff);-addr[5]=(hi&0xff00)>>8;-}+addr[0]=(lo&0xff);+addr[1]=(lo&0xff00)>>8;+addr[2]=(lo&0xff0000)>>16;+addr[3]=(lo&0xff000000)>>24;+addr[4]=(hi&0xff);+addr[5]=(hi&0xff00)>>8;if(is_valid_ether_addr(addr)){memcpy(dev->dev_addr,&addr,6);
From: Joachim Eastwood <hidden> Date: 2012-10-21 20:26:34
On Sun, Oct 21, 2012 at 8:30 PM, Jean-Christophe PLAGNIOL-VILLARD
[off-list ref] wrote:
On 16:23 Sun 21 Oct , Joachim Eastwood wrote:
quoted
macb is a platform driver and there is nothing that prevents
this driver from being built on non-ARM/AVR32 platforms.
if you want to drop the HAVE_NET_MACB you need to drop it everywher in one
patch
Breaking it up in several patches doesn't seem to cause any build
failures and I did this in case the patches were going into different
git trees.
regards
Joachim Eastwood
From: Joachim Eastwood <hidden> Date: 2012-10-21 20:27:41
On Sun, Oct 21, 2012 at 8:31 PM, Jean-Christophe PLAGNIOL-VILLARD
[off-list ref] wrote:
On 16:23 Sun 21 Oct , Joachim Eastwood wrote:
quoted
Now that HAVE_NET_MACB is gone let's just select MACB to
satisfy the dependecies in at91_ether.
PHYLIB will then by selected by MACB.
Signed-off-by: Joachim Eastwood <redacted>
---
drivers/net/ethernet/cadence/Kconfig | 2 +-
drivers/net/ethernet/cadence/Makefile | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
From: Joachim Eastwood <hidden> Date: 2012-10-21 20:30:46
On Sun, Oct 21, 2012 at 8:34 PM, Jean-Christophe PLAGNIOL-VILLARD
[off-list ref] wrote:
On 16:23 Sun 21 Oct , Joachim Eastwood wrote:
quoted
Move Ethernet address byte order fix for csb337 into it's board
setup.
This will allow us to remove the last mach include from at91_ether
and also to share the address setup with the macb driver.
no the current drivers expect mach/board.h, mach/at91rm9200_emac.h, asm/gpio.h
waht you did will not even compile on non at91 platform
Did you even compile it on non at91?
This is the last mach include in the at91_ether driver in net-next.
And, yes, after this patch it complies fine for at least x86_64.
regards
Joachim Eastwood
From: Joachim Eastwood <hidden> Date: 2012-10-21 20:39:48
On Sun, Oct 21, 2012 at 8:25 PM, Jean-Christophe PLAGNIOL-VILLARD
[off-list ref] wrote:
On 16:23 Sun 21 Oct , Joachim Eastwood wrote:
quoted
Move Ethernet address byte order fix for csb337 into it's board
setup.
This will allow us to remove the last mach include from at91_ether
and also to share the address setup with the macb driver.
no the at91rm9200 move to DT this is not compatible with it
you need to pass ths in info via platform_data
and do not touch driver code related stuff in boards
I know the board code is a bit nasty.
If it's unacceptable I'll cook up a flag and pass it by platform_data,
something like "reverse_eth_addr". Still it will only ever be used on
the csb337 board.
regards
Joachim Eastwood
You do know that this is going to generate warnings on 64-bit
platforms?
I was hoping you would have noticed and corrected this before
enabling the driver everywhere, I guess my expectations were
way too high :-/
From: Joachim Eastwood <hidden> Date: 2012-10-22 06:59:17
On Mon, Oct 22, 2012 at 1:27 AM, David Miller [off-list ref] wrote:
You do know that this is going to generate warnings on 64-bit
platforms?
I was hoping you would have noticed and corrected this before
enabling the driver everywhere, I guess my expectations were
way too high :-/
ah, sorry.
Yes, macb seem to generate some integer overflows on ~0UL on 64-bit. I
have a patch that turns ~0UL into -1.
I can repost the series with fix included. Do you want me to do that?
regards
Joachim Eastwood
From: Joachim Eastwood <redacted>
Date: Mon, 22 Oct 2012 08:59:17 +0200
On Mon, Oct 22, 2012 at 1:27 AM, David Miller [off-list ref] wrote:
quoted
You do know that this is going to generate warnings on 64-bit
platforms?
I was hoping you would have noticed and corrected this before
enabling the driver everywhere, I guess my expectations were
way too high :-/
ah, sorry.
Yes, macb seem to generate some integer overflows on ~0UL on 64-bit. I
have a patch that turns ~0UL into -1.
I can repost the series with fix included. Do you want me to do that?