From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from 3.mo2.mail-out.ovh.net ([46.105.58.226] helo=mo2.mail-out.ovh.net) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1S4cN4-0007KN-QC for barebox@lists.infradead.org; Mon, 05 Mar 2012 18:10:55 +0000 Received: from mail621.ha.ovh.net (b6.ovh.net [213.186.33.56]) by mo2.mail-out.ovh.net (Postfix) with SMTP id 8AC8ADC54F9 for ; Mon, 5 Mar 2012 19:13:53 +0100 (CET) From: Jean-Christophe PLAGNIOL-VILLARD Date: Mon, 5 Mar 2012 19:00:35 +0100 Message-Id: <1330970435-2681-2-git-send-email-plagnioj@jcrosoft.com> In-Reply-To: <1330970435-2681-1-git-send-email-plagnioj@jcrosoft.com> References: <1330970435-2681-1-git-send-email-plagnioj@jcrosoft.com> 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-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 2/2] macb: fix mmu support To: barebox@lists.infradead.org Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- drivers/net/macb.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/macb.c b/drivers/net/macb.c index ea8ae82..feffea5 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c @@ -50,6 +50,7 @@ #include #include #include +#include #include "macb.h" @@ -118,6 +119,7 @@ static int macb_send(struct eth_device *edev, void *packet, macb->tx_ring[0].ctrl = ctrl; macb->tx_ring[0].addr = (ulong)packet; barrier(); + dma_flush_range((ulong) packet, (ulong)packet + length); writel(MACB_BIT(TE) | MACB_BIT(RE) | MACB_BIT(TSTART), macb->regs + MACB_NCR); wait_on_timeout(100 * MSECOND, @@ -435,9 +437,9 @@ static int macb_probe(struct device_d *dev) macb->miidev.parent = dev; macb->flags = pdata->flags; - macb->rx_buffer = xmalloc(CFG_MACB_RX_BUFFER_SIZE); - macb->rx_ring = xmalloc(CFG_MACB_RX_RING_SIZE * sizeof(struct macb_dma_desc)); - macb->tx_ring = xmalloc(sizeof(struct macb_dma_desc)); + macb->rx_buffer = dma_alloc_coherent(CFG_MACB_RX_BUFFER_SIZE); + macb->rx_ring = dma_alloc_coherent(CFG_MACB_RX_RING_SIZE * sizeof(struct macb_dma_desc)); + macb->tx_ring = dma_alloc_coherent(sizeof(struct macb_dma_desc)); macb->regs = dev_request_mem_region(dev, 0); -- 1.7.7 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox