From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from ns.lynxeye.de ([87.118.118.114] helo=lynxeye.de) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YM1W9-0008Lr-Ql for barebox@lists.infradead.org; Thu, 12 Feb 2015 21:41:52 +0000 Received: from tellur.intern.lynxeye.de (p57B5FBCA.dip0.t-ipconnect.de [87.181.251.202]) by lynxeye.de (Postfix) with ESMTPA id 34DE726C200C for ; Thu, 12 Feb 2015 22:40:11 +0100 (CET) From: Lucas Stach Date: Thu, 12 Feb 2015 22:39:47 +0100 Message-Id: <1423777200-22965-12-git-send-email-dev@lynxeye.de> In-Reply-To: <1423777200-22965-1-git-send-email-dev@lynxeye.de> References: <1423777200-22965-1-git-send-email-dev@lynxeye.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH RFT 11/24] net: cpsw: convert to streaming DMA ops To: barebox@lists.infradead.org Signed-off-by: Lucas Stach --- drivers/net/cpsw.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c index 799fac8..5c28aa4 100644 --- a/drivers/net/cpsw.c +++ b/drivers/net/cpsw.c @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -32,7 +33,6 @@ #include #include #include -#include #include #include @@ -871,9 +871,9 @@ static int cpsw_send(struct eth_device *edev, void *packet, int length) dev_dbg(&slave->dev, "%s: %i bytes @ 0x%p\n", __func__, length, packet); - dma_flush_range((ulong) packet, (ulong)packet + length); - + dma_sync_single_for_device((unsigned long)packet, length, DMA_TO_DEVICE); ret = cpdma_submit(priv, &priv->tx_chan, packet, length); + dma_sync_single_for_cpu((unsigned long)packet, length, DMA_TO_DEVICE); return ret; } @@ -886,8 +886,11 @@ static int cpsw_recv(struct eth_device *edev) int len; while (cpdma_process(priv, &priv->rx_chan, &buffer, &len) >= 0) { - dma_inv_range((ulong)buffer, (ulong)buffer + len); + dma_sync_single_for_cpu((unsigned long)buffer, len, + DMA_FROM_DEVICE); net_receive(edev, buffer, len); + dma_sync_single_for_device((unsigned long)buffer, len, + DMA_FROM_DEVICE); cpdma_submit(priv, &priv->rx_chan, buffer, PKTSIZE); } -- 2.1.0 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox