Skip to content

Commit

Permalink
[PATCH] New PowerPC 4xx on-chip ethernet controller driver
Browse files Browse the repository at this point in the history
This patch replaces current PowerPC 4xx EMAC driver with
new, re-written from the scratch version. This patch is quite big
(~234K) because there is virtualy 0% of common code between old and
new version.

New driver uses NAPI, it solves stability problems under heavy packet
load and low memory, corrects chip register access and fixes numerous
small bugs I don't even remember now.

This patch has been tested on all supported in 2.6 PPC 4xx boards.
It's been used in production for almost a year now on custom
4xx hardware. PPC32 specific parts are already upstream.

Patch was acked by the current EMAC driver maintainer (Matt Porter). I
will be maintaining this new version.

Signed-off-by: Eugene Surovegin <ebs@ebshome.net>
--

 Kconfig                   |   72
 ibm_emac/Makefile         |   13
 ibm_emac/ibm_emac.h       |  418 +++--
 ibm_emac/ibm_emac_core.c  | 3414 ++++++++++++++++++++++++----------------------
 ibm_emac/ibm_emac_core.h  |  313 ++--
 ibm_emac/ibm_emac_debug.c |  377 ++---
 ibm_emac/ibm_emac_debug.h |   63
 ibm_emac/ibm_emac_mal.c   |  674 +++++----
 ibm_emac/ibm_emac_mal.h   |  336 +++-
 ibm_emac/ibm_emac_phy.c   |  335 ++--
 ibm_emac/ibm_emac_phy.h   |  105 -
 ibm_emac/ibm_emac_rgmii.c |  201 ++
 ibm_emac/ibm_emac_rgmii.h |   68
 ibm_emac/ibm_emac_tah.c   |  111 +
 ibm_emac/ibm_emac_tah.h   |   96 -
 ibm_emac/ibm_emac_zmii.c  |  255 +++
 ibm_emac/ibm_emac_zmii.h  |  114 -
 17 files changed, 4114 insertions(+), 2851 deletions(-)
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
  • Loading branch information
Eugene Surovegin authored and Jeff Garzik committed Oct 28, 2005
1 parent b71b95e commit 37448f7
Show file tree
Hide file tree
Showing 17 changed files with 4,085 additions and 2,822 deletions.
72 changes: 54 additions & 18 deletions drivers/net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1163,38 +1163,74 @@ config IBMVETH
be called ibmveth.

config IBM_EMAC
bool "IBM PPC4xx EMAC driver support"
tristate "PowerPC 4xx on-chip Ethernet support"
depends on 4xx
select CRC32
---help---
This driver supports the IBM PPC4xx EMAC family of on-chip
Ethernet controllers.

config IBM_EMAC_ERRMSG
bool "Verbose error messages"
depends on IBM_EMAC && BROKEN
help
This driver supports the PowerPC 4xx EMAC family of on-chip
Ethernet controllers.

config IBM_EMAC_RXB
int "Number of receive buffers"
depends on IBM_EMAC
default "128" if IBM_EMAC4
default "64"
default "128"

config IBM_EMAC_TXB
int "Number of transmit buffers"
depends on IBM_EMAC
default "128" if IBM_EMAC4
default "8"
default "64"

config IBM_EMAC_POLL_WEIGHT
int "MAL NAPI polling weight"
depends on IBM_EMAC
default "32"

config IBM_EMAC_FGAP
int "Frame gap"
config IBM_EMAC_RX_COPY_THRESHOLD
int "RX skb copy threshold (bytes)"
depends on IBM_EMAC
default "8"
default "256"

config IBM_EMAC_SKBRES
int "Skb reserve amount"
config IBM_EMAC_RX_SKB_HEADROOM
int "Additional RX skb headroom (bytes)"
depends on IBM_EMAC
default "0"
help
Additional receive skb headroom. Note, that driver
will always reserve at least 2 bytes to make IP header
aligned, so usualy there is no need to add any additional
headroom.

If unsure, set to 0.

config IBM_EMAC_PHY_RX_CLK_FIX
bool "PHY Rx clock workaround"
depends on IBM_EMAC && (405EP || 440GX || 440EP)
help
Enable this if EMAC attached to a PHY which doesn't generate
RX clock if there is no link, if this is the case, you will
see "TX disable timeout" or "RX disable timeout" in the system
log.

If unsure, say N.

config IBM_EMAC_DEBUG
bool "Debugging"
depends on IBM_EMAC
default n

config IBM_EMAC_ZMII
bool
depends on IBM_EMAC && (NP405H || NP405L || 44x)
default y

config IBM_EMAC_RGMII
bool
depends on IBM_EMAC && 440GX
default y

config IBM_EMAC_TAH
bool
depends on IBM_EMAC && 440GX
default y

config NET_PCI
bool "EISA, VLB, PCI and on board controllers"
Expand Down
13 changes: 6 additions & 7 deletions drivers/net/ibm_emac/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#
# Makefile for the IBM PPC4xx EMAC controllers
# Makefile for the PowerPC 4xx on-chip ethernet driver
#

obj-$(CONFIG_IBM_EMAC) += ibm_emac.o

ibm_emac-objs := ibm_emac_mal.o ibm_emac_core.o ibm_emac_phy.o

# Only need this if you want to see additional debug messages
ifeq ($(CONFIG_IBM_EMAC_ERRMSG), y)
ibm_emac-objs += ibm_emac_debug.o
endif
ibm_emac-objs := ibm_emac_mal.o ibm_emac_core.o ibm_emac_phy.o
ibm_emac-$(CONFIG_IBM_EMAC_ZMII) += ibm_emac_zmii.o
ibm_emac-$(CONFIG_IBM_EMAC_RGMII) += ibm_emac_rgmii.o
ibm_emac-$(CONFIG_IBM_EMAC_TAH) += ibm_emac_tah.o
ibm_emac-$(CONFIG_IBM_EMAC_DEBUG) += ibm_emac_debug.o
Loading

0 comments on commit 37448f7

Please sign in to comment.