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-0008Lq-Qk for barebox@lists.infradead.org; Thu, 12 Feb 2015 21:41:54 +0000 Received: from tellur.intern.lynxeye.de (p57B5FBCA.dip0.t-ipconnect.de [87.181.251.202]) by lynxeye.de (Postfix) with ESMTPA id 2CB8326C2006 for ; Thu, 12 Feb 2015 22:40:12 +0100 (CET) From: Lucas Stach Date: Thu, 12 Feb 2015 22:39:49 +0100 Message-Id: <1423777200-22965-14-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 13/24] net: davinci_emac: convert to streaming DMA ops To: barebox@lists.infradead.org Signed-off-by: Lucas Stach --- drivers/net/davinci_emac.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c index ce367a3..056ffe2 100644 --- a/drivers/net/davinci_emac.c +++ b/drivers/net/davinci_emac.c @@ -40,12 +40,12 @@ */ #include +#include #include #include #include #include #include -#include #include #include #include @@ -411,7 +411,7 @@ static int davinci_emac_send(struct eth_device *edev, void *packet, int length) EMAC_CPPI_OWNERSHIP_BIT | EMAC_CPPI_EOP_BIT), priv->emac_tx_desc + EMAC_DESC_PKT_FLAG_LEN); - dma_flush_range((ulong) packet, (ulong)packet + length); + dma_sync_single_for_device((unsigned long)packet, length, DMA_TO_DEVICE); /* Send the packet */ writel(BD_TO_HW(priv->emac_tx_desc), priv->adap_emac + EMAC_TX0HDP); @@ -429,6 +429,7 @@ static int davinci_emac_send(struct eth_device *edev, void *packet, int length) break; } } + dma_sync_single_for_cpu((unsigned long)packet, length, DMA_TO_DEVICE); dev_dbg(priv->dev, "- emac_send (ret_status %i)\n", ret_status); return ret_status; @@ -460,9 +461,9 @@ static int davinci_emac_recv(struct eth_device *edev) pkt = (unsigned char *)readl(rx_curr_desc + EMAC_DESC_BUFFER); len = readl(rx_curr_desc + EMAC_DESC_BUFF_OFF_LEN) & 0xffff; dev_dbg(priv->dev, "| emac_recv got packet (length %i)\n", len); - dma_inv_range((ulong)pkt, - (ulong)readl(rx_curr_desc + EMAC_DESC_BUFFER) + len); + dma_sync_single_for_cpu((unsigned long)pkt, len, DMA_FROM_DEVICE); net_receive(edev, pkt, len); + dma_sync_single_for_device((unsigned long)pkt, len, DMA_FROM_DEVICE); ret = len; } -- 2.1.0 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox