diff options
author | Lucas Stach <dev@lynxeye.de> | 2015-03-05 22:49:55 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-03-06 07:51:47 +0100 |
commit | e05f9586b302d0dba5e9c98d849596cad1716a6f (patch) | |
tree | e4f8aa0b3e0dd5c3899d09e6d46746a37baf4635 /drivers/net/macb.c | |
parent | 6c583d0e327deecaea026cf47576fbe42274bd8c (diff) | |
download | barebox-e05f9586b302d0dba5e9c98d849596cad1716a6f.tar.gz barebox-e05f9586b302d0dba5e9c98d849596cad1716a6f.tar.xz |
ARM: change dma_alloc/free_coherent to match other architectures
As a lot drivers currently rely on the 1:1 virt->phys mapping on ARM
we define DMA_ADDRESS_BROKEN to mark them. In order to use them on
other architectures with a different mapping they need proper fixing.
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/net/macb.c')
-rw-r--r-- | drivers/net/macb.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/macb.c b/drivers/net/macb.c index 8e67aecc84..9cdb7d8539 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c @@ -597,7 +597,8 @@ static void macb_init_rx_buffer_size(struct macb_device *bp, size_t size) bp->rx_buffer_size = roundup(bp->rx_buffer_size, RX_BUFFER_MULTIPLE); } - bp->rx_buffer = dma_alloc_coherent(bp->rx_buffer_size * bp->rx_ring_size); + bp->rx_buffer = dma_alloc_coherent(bp->rx_buffer_size * bp->rx_ring_size, + DMA_ADDRESS_BROKEN); } dev_dbg(bp->dev, "[%d] rx_buffer_size [%d]\n", @@ -667,9 +668,10 @@ static int macb_probe(struct device_d *dev) edev->recv = macb_recv; macb_init_rx_buffer_size(macb, PKTSIZE); - macb->rx_buffer = dma_alloc_coherent(macb->rx_buffer_size * macb->rx_ring_size); - macb->rx_ring = dma_alloc_coherent(RX_RING_BYTES(macb)); - macb->tx_ring = dma_alloc_coherent(TX_RING_BYTES); + macb->rx_buffer = dma_alloc_coherent(macb->rx_buffer_size * macb->rx_ring_size, + DMA_ADDRESS_BROKEN); + macb->rx_ring = dma_alloc_coherent(RX_RING_BYTES(macb), DMA_ADDRESS_BROKEN); + macb->tx_ring = dma_alloc_coherent(TX_RING_BYTES, DMA_ADDRESS_BROKEN); macb_reset_hw(macb); ncfgr = macb_mdc_clk_div(macb); |