From: Joachim Eastwood <hidden> Date: 2012-10-22 18:45:30
This series makes the at91_ether and macb driver build-able on any architecture.
Patch 1 fixes a integer truncated warning in macb, which will show up when compiling for 64-bit, before enabling macb driver for other architectures.
Patch 2 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 4 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.
Patch log:
v3 - Include integer truncated warning fix for macb
v2 - Use macb platform data to support reversed ethernet address and squash HAVE_NET_MACB removal patches.
Joachim Eastwood (4):
net/macb: fix truncate warnings
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 ++---
drivers/net/ethernet/cadence/macb.c | 8 ++++----
include/linux/platform_data/macb.h | 1 +
8 files changed, 11 insertions(+), 20 deletions(-)
--
1.7.12.4
From: Joachim Eastwood <hidden> Date: 2012-10-22 18:45:31
When building macb on x86_64 the following warnings show up:
drivers/net/ethernet/cadence/macb.c: In function macb_interrupt:
drivers/net/ethernet/cadence/macb.c:556:4: warning: large integer implicitly truncated to unsigned type [-Woverflow]
drivers/net/ethernet/cadence/macb.c: In function macb_reset_hw:
drivers/net/ethernet/cadence/macb.c:792:2: warning: large integer implicitly truncated to unsigned type [-Woverflow]
drivers/net/ethernet/cadence/macb.c:793:2: warning: large integer implicitly truncated to unsigned type [-Woverflow]
drivers/net/ethernet/cadence/macb.c:796:2: warning: large integer implicitly truncated to unsigned type [-Woverflow]
Use -1 insted of ~0UL, as done in other places in the driver,
to silence these warnings.
Signed-off-by: Joachim Eastwood <redacted>
---
drivers/net/ethernet/cadence/macb.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
From: Joachim Eastwood <hidden> Date: 2012-10-22 18:45:32
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>
---
arch/arm/mach-at91/Kconfig | 4 ----
arch/avr32/Kconfig | 1 -
drivers/net/ethernet/cadence/Kconfig | 5 -----
3 files changed, 10 deletions(-)
From: Joachim Eastwood <hidden> Date: 2012-10-22 18:45:33
Now that HAVE_NET_MACB is gone let's just select MACB to
satisfy the dependecies in at91_ether.
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-22 18:45:34
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 <redacted>
---
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(-)
@@ -53,6 +53,8 @@ static void __init csb337_init_early(void)staticstructmacb_platform_data__initdatacsb337_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,};staticstructat91_usbh_data__initdatacsb337_usbh_data={
@@ -61,9 +59,10 @@staticshort__initunpack_mac_address(structnet_device*dev,unsignedinthi,unsignedintlo){+structmacb*lp=netdev_priv(dev);charaddr[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;
From: Joachim Eastwood <redacted>
Date: Mon, 22 Oct 2012 20:45:30 +0200
Joachim Eastwood (4):
net/macb: fix truncate warnings
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
From: David Laight <hidden> Date: 2012-10-23 08:21:11
When building macb on x86_64 the following warnings show up:
drivers/net/ethernet/cadence/macb.c: In function macb_interrupt:
drivers/net/ethernet/cadence/macb.c:556:4: warning: large integer implicitly truncated to unsigned type [-Woverflow]
When building macb on x86_64 the following warnings show up:
drivers/net/ethernet/cadence/macb.c: In function macb_interrupt:
drivers/net/ethernet/cadence/macb.c:556:4: warning: large integer implicitly truncated to unsigned type [-Woverflow]
When building macb on x86_64 the following warnings show up:
drivers/net/ethernet/cadence/macb.c: In function macb_interrupt:
drivers/net/ethernet/cadence/macb.c:556:4: warning: large integer implicitly truncated to unsigned type [-Woverflow]
When building macb on x86_64 the following warnings show up:
drivers/net/ethernet/cadence/macb.c: In function macb_interrupt:
drivers/net/ethernet/cadence/macb.c:556:4: warning: large integer implicitly truncated to unsigned type [-Woverflow]
Seems wrong to fix an error with an unsigned value
by using -1.
-1 is equally an unsigned value of all 1's and completely legitimate.
The correction being made here is one of size not signedness.
You could use '~0' (without the 'UL').
The reason for choosing '-1', as noted in patch description, is that
it already appears in a couple of other places in the driver. So I
though it would nice to be consistent.
regards
Joachim Eastwood