Skip to contentSkip to conversation

cirrus ep93xx ethernet driver

RFC In review Lennert Buytenhek 1 participant 2 messages Jun 26, 2006 – Jun 28, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 cirrus ep93xx ethernet driver

The cirrus ep93xx is an ARM SoC that includes an ethernet MAC -- this patch adds a driver for that ethernet MAC.

(This is, unfortunately, probably too late for 2.6.18, so I'm sending it just for feedback.)

drivers/net/arm/Kconfig +7 -0
Index: linux-2.6.17-git5/drivers/net/arm/Kconfig
===================================================================
@@ -39,3 +39,10 @@ config ARM_AT91_ETHER
 	help
 	  If you wish to compile a kernel for the AT91RM9200 and enable
 	  ethernet support, then you should always answer Y to this.
+
+config EP93XX_ETH
+	tristate "EP93xx Ethernet support"
+	depends on NET_ETHERNET && ARM && ARCH_EP93XX
+	help
+	  This is a driver for the ethernet hardware included in EP93xx CPUs.
+	  Say Y if you are building a kernel for EP93xx based devices.
drivers/net/arm/Makefile +1 -0
Index: linux-2.6.17-git5/drivers/net/arm/Makefile
===================================================================
@@ -8,3 +8,4 @@ obj-$(CONFIG_ARM_ETHERH)	+= etherh.o
 obj-$(CONFIG_ARM_ETHER3)	+= ether3.o
 obj-$(CONFIG_ARM_ETHER1)	+= ether1.o
 obj-$(CONFIG_ARM_AT91_ETHER)	+= at91_ether.o
+obj-$(CONFIG_EP93XX_ETH)	+= ep93xx_eth.o
drivers/net/arm/ep93xx_eth.c new file +672 -0

672 lines not on this page · raw message

drivers/net/arm/ep93xx_eth.h new file +75 -0

75 lines not on this page · raw message

include/asm-arm/arch-ep93xx/ep93xx-regs.h +1 -0
Index: linux-2.6.17-git5/include/asm-arm/arch-ep93xx/ep93xx-regs.h
===================================================================
@@ -27,6 +27,7 @@
 #define EP93XX_DMA_BASE			(EP93XX_AHB_VIRT_BASE + 0x00000000)
 
 #define EP93XX_ETHERNET_BASE		(EP93XX_AHB_VIRT_BASE + 0x00010000)
+#define EP93XX_ETHERNET_PHYS_BASE	(EP93XX_AHB_PHYS_BASE + 0x00010000)
 
 #define EP93XX_USB_BASE			(EP93XX_AHB_VIRT_BASE + 0x00020000)
 #define EP93XX_USB_PHYS_BASE		(EP93XX_AHB_PHYS_BASE + 0x00020000)
include/asm-arm/arch-ep93xx/platform.h +5 -0
Index: linux-2.6.17-git5/include/asm-arm/arch-ep93xx/platform.h
===================================================================
@@ -16,5 +16,10 @@ struct ep93xx_i2c_pins {
 	unsigned long scl_pin;
 };
 
+struct ep93xx_eth_data
+{
+	unsigned char	dev_addr[6];
+};
+
 
 #endif
#1 lore raw
Quoted 2 lines · Lennert Buytenhek

The cirrus ep93xx is an ARM SoC that includes an ethernet MAC -- this patch adds a driver for that ethernet MAC.

Attached is a new version that optimises interrupt handling somewhat. Since we clear RX status as the first thing we do in the poll handler, we might as well read the read-to-clear version of the interrupt status register in the interrupt handler and avoid the explicit clear in the poll handler. This shaves close to a second off a 128M sendfile() test.

At ~40 seconds for a 128M sendfile (~3.2MB/sec), the network performance of this CPU isn't impressive by any means, but given that the CPU only runs at 200MHz and that the MAC doesn't do checksum offloading and insists on 4-byte buffer alignment, we can't really do a whole lot better. The performance with this driver is still a good deal better than with the vendor driver, though -- for this particular test (128M sendfile), the vendor driver needs 1m21s.

Apart from that it still uses numeric chip register addresses, I'm quite happy with the driver as it is, it survives heavy beating and is pretty stable.

drivers/net/arm/Kconfig +7 -0
Index: linux-2.6.17-git10/drivers/net/arm/Kconfig
===================================================================
@@ -39,3 +39,10 @@ config ARM_AT91_ETHER
 	help
 	  If you wish to compile a kernel for the AT91RM9200 and enable
 	  ethernet support, then you should always answer Y to this.
+
+config EP93XX_ETH
+	tristate "EP93xx Ethernet support"
+	depends on NET_ETHERNET && ARM && ARCH_EP93XX
+	help
+	  This is a driver for the ethernet hardware included in EP93xx CPUs.
+	  Say Y if you are building a kernel for EP93xx based devices.
drivers/net/arm/Makefile +1 -0
Index: linux-2.6.17-git10/drivers/net/arm/Makefile
===================================================================
@@ -8,3 +8,4 @@ obj-$(CONFIG_ARM_ETHERH)	+= etherh.o
 obj-$(CONFIG_ARM_ETHER3)	+= ether3.o
 obj-$(CONFIG_ARM_ETHER1)	+= ether1.o
 obj-$(CONFIG_ARM_AT91_ETHER)	+= at91_ether.o
+obj-$(CONFIG_EP93XX_ETH)	+= ep93xx_eth.o
drivers/net/arm/ep93xx_eth.c new file +668 -0

668 lines not on this page · raw message

drivers/net/arm/ep93xx_eth.h new file +75 -0

75 lines not on this page · raw message

include/asm-arm/arch-ep93xx/ep93xx-regs.h +1 -0
Index: linux-2.6.17-git10/include/asm-arm/arch-ep93xx/ep93xx-regs.h
===================================================================
@@ -27,6 +27,7 @@
 #define EP93XX_DMA_BASE			(EP93XX_AHB_VIRT_BASE + 0x00000000)
 
 #define EP93XX_ETHERNET_BASE		(EP93XX_AHB_VIRT_BASE + 0x00010000)
+#define EP93XX_ETHERNET_PHYS_BASE	(EP93XX_AHB_PHYS_BASE + 0x00010000)
 
 #define EP93XX_USB_BASE			(EP93XX_AHB_VIRT_BASE + 0x00020000)
 #define EP93XX_USB_PHYS_BASE		(EP93XX_AHB_PHYS_BASE + 0x00020000)
include/asm-arm/arch-ep93xx/platform.h +5 -0
Index: linux-2.6.17-git10/include/asm-arm/arch-ep93xx/platform.h
===================================================================
@@ -11,5 +11,10 @@ void ep93xx_init_devices(void);
 void ep93xx_clock_init(void);
 extern struct sys_timer ep93xx_timer;
 
+struct ep93xx_eth_data
+{
+	unsigned char	dev_addr[6];
+};
+
 
 #endif