Add non-Virtex5 support for LL TEMAC driver
authorJohn Linn <john.linn@xilinx.com>
Tue, 6 Apr 2010 11:43:28 +0000 (11:43 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 7 Apr 2010 02:50:19 +0000 (19:50 -0700)
This patch adds support for using the LL TEMAC Ethernet driver on
non-Virtex 5 platforms by adding support for accessing the Soft DMA
registers as if they were memory mapped instead of solely through the
DCR's (available on the Virtex 5).

The patch also updates the driver so that it runs on the MicroBlaze.
The changes were tested on the PowerPC 440, PowerPC 405, and the
MicroBlaze platforms.

Signed-off-by: John Tyner <jtyner@cs.ucr.edu>
Signed-off-by: John Linn <john.linn@xilinx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/microblaze/include/asm/system.h
drivers/net/Kconfig
drivers/net/ll_temac.h
drivers/net/ll_temac_main.c

index 1579706..88fc92c 100644 (file)
@@ -12,6 +12,7 @@
 #include <asm/registers.h>
 #include <asm/setup.h>
 #include <asm/irqflags.h>
+#include <asm/cache.h>
 
 #include <asm-generic/cmpxchg.h>
 #include <asm-generic/cmpxchg-local.h>
@@ -93,4 +94,14 @@ extern struct dentry *of_debugfs_root;
 
 #define arch_align_stack(x) (x)
 
+/*
+ * MicroBlaze doesn't handle unaligned accesses in hardware.
+ *
+ * Based on this we force the IP header alignment in network drivers.
+ * We also modify NET_SKB_PAD to be a cacheline in size, thus maintaining
+ * cacheline alignment of buffers.
+ */
+#define NET_IP_ALIGN   2
+#define NET_SKB_PAD    L1_CACHE_BYTES
+
 #endif /* _ASM_MICROBLAZE_SYSTEM_H */
index a55bff2..20e2dec 100644 (file)
@@ -2435,8 +2435,8 @@ config MV643XX_ETH
 
 config XILINX_LL_TEMAC
        tristate "Xilinx LL TEMAC (LocalLink Tri-mode Ethernet MAC) driver"
+       depends on PPC || MICROBLAZE
        select PHYLIB
-       depends on PPC_DCR_NATIVE
        help
          This driver supports the Xilinx 10/100/1000 LocalLink TEMAC
          core used in Xilinx Spartan and Virtex FPGAs
Simple merge
Simple merge