From: Olof Johansson <olof@lixom.net>
To: jgarzik@pobox.com
Cc: netdev@vger.kernel.org, linuxppc-dev@ozlabs.org, pasemi-linux@ozlabs.org
Subject: [patch 1/6] pasemi_mac: Move RX/TX section enablement to dma_lib
Date: Wed, 20 Feb 2008 20:57:54 -0600 [thread overview]
Message-ID: <20080221025929.082348000@lixom.net> (raw)
In-Reply-To: 20080221025753.903665000@lixom.net
[-- Attachment #1: in-progress/pasemi_mac-move-rx-tx-enable --]
[-- Type: text/plain, Size: 2989 bytes --]
Also stop both rx and tx sections before changing the configuration of
the dma device during init.
Signed-off-by: Olof Johansson <olof@lixom.net>
Index: k.org/arch/powerpc/platforms/pasemi/dma_lib.c
===================================================================
--- k.org.orig/arch/powerpc/platforms/pasemi/dma_lib.c
+++ k.org/arch/powerpc/platforms/pasemi/dma_lib.c
@@ -478,6 +478,30 @@ int pasemi_dma_init(void)
for (i = 0; i < MAX_RXCH; i++)
__set_bit(i, rxch_free);
+ i = 1000;
+ pasemi_write_dma_reg(PAS_DMA_COM_RXCMD, 0);
+ while ((i > 0) && (pasemi_read_dma_reg(PAS_DMA_COM_RXSTA) & 1))
+ i--;
+ if (i < 0)
+ printk(KERN_INFO "Warning: Could not disable RX section\n");
+
+ i = 1000;
+ pasemi_write_dma_reg(PAS_DMA_COM_TXCMD, 0);
+ while ((i > 0) && (pasemi_read_dma_reg(PAS_DMA_COM_TXSTA) & 1))
+ i--;
+ if (i < 0)
+ printk(KERN_INFO "Warning: Could not disable TX section\n");
+
+ /* setup resource allocations for the different DMA sections */
+ tmp = pasemi_read_dma_reg(PAS_DMA_COM_CFG);
+ pasemi_write_dma_reg(PAS_DMA_COM_CFG, tmp | 0x18000000);
+
+ /* enable tx section */
+ pasemi_write_dma_reg(PAS_DMA_COM_TXCMD, PAS_DMA_COM_TXCMD_EN);
+
+ /* enable rx section */
+ pasemi_write_dma_reg(PAS_DMA_COM_RXCMD, PAS_DMA_COM_RXCMD_EN);
+
printk(KERN_INFO "PA Semi PWRficient DMA library initialized "
"(%d tx, %d rx channels)\n", num_txch, num_rxch);
Index: k.org/drivers/net/pasemi_mac.c
===================================================================
--- k.org.orig/drivers/net/pasemi_mac.c
+++ k.org/drivers/net/pasemi_mac.c
@@ -1043,12 +1043,6 @@ static int pasemi_mac_open(struct net_de
unsigned int flags;
int ret;
- /* enable rx section */
- write_dma_reg(PAS_DMA_COM_RXCMD, PAS_DMA_COM_RXCMD_EN);
-
- /* enable tx section */
- write_dma_reg(PAS_DMA_COM_TXCMD, PAS_DMA_COM_TXCMD_EN);
-
flags = PAS_MAC_CFG_TXP_FCE | PAS_MAC_CFG_TXP_FPC(3) |
PAS_MAC_CFG_TXP_SL(3) | PAS_MAC_CFG_TXP_COB(0xf) |
PAS_MAC_CFG_TXP_TIFT(8) | PAS_MAC_CFG_TXP_TIFG(12);
Index: k.org/include/asm-powerpc/pasemi_dma.h
===================================================================
--- k.org.orig/include/asm-powerpc/pasemi_dma.h
+++ k.org/include/asm-powerpc/pasemi_dma.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 PA Semi, Inc
+ * Copyright (C) 2006-2008 PA Semi, Inc
*
* Hardware register layout and descriptor formats for the on-board
* DMA engine on PA Semi PWRficient. Used by ethernet, function and security
@@ -40,6 +40,11 @@ enum {
PAS_DMA_COM_TXSTA = 0x104, /* Transmit Status Register */
PAS_DMA_COM_RXCMD = 0x108, /* Receive Command Register */
PAS_DMA_COM_RXSTA = 0x10c, /* Receive Status Register */
+ PAS_DMA_COM_CFG = 0x114, /* Common config reg */
+ PAS_DMA_TXF_SFLG0 = 0x140, /* Set flags */
+ PAS_DMA_TXF_SFLG1 = 0x144, /* Set flags */
+ PAS_DMA_TXF_CFLG0 = 0x148, /* Set flags */
+ PAS_DMA_TXF_CFLG1 = 0x14c, /* Set flags */
};
--
next prev parent reply other threads:[~2008-02-21 3:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-21 2:57 [patch 0/6] pasemi_mac updates for 2.6.26 Olof Johansson
2008-02-21 2:57 ` Olof Johansson [this message]
2008-02-26 11:46 ` [patch 1/6] pasemi_mac: Move RX/TX section enablement to dma_lib Michael Ellerman
2008-02-26 14:14 ` Olof Johansson
2008-03-05 18:21 ` [Pasemi-linux] " Olof Johansson
2008-03-06 0:47 ` Michael Ellerman
2008-02-21 2:57 ` [patch 2/6] [POWERPC] pasemi: Add flag management functions " Olof Johansson
2008-02-21 2:57 ` [patch 3/6] [POWERPC] pasemi: Add function engine " Olof Johansson
2008-02-21 2:57 ` [patch 4/6] pasemi_mac: jumbo frame support Olof Johansson
2008-02-21 2:57 ` [patch 5/6] pasemi_mac: Enable GSO by default Olof Johansson
2008-02-21 2:57 ` [patch 6/6] pasemi_mac: basic ethtool support Olof Johansson
2008-02-26 9:49 ` [patch 0/6] pasemi_mac updates for 2.6.26 Paul Mackerras
2008-02-26 14:16 ` Olof Johansson
2008-02-26 18:21 ` Jeff Garzik
2008-02-26 18:33 ` Olof Johansson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080221025929.082348000@lixom.net \
--to=olof@lixom.net \
--cc=jgarzik@pobox.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=netdev@vger.kernel.org \
--cc=pasemi-linux@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).