diff options
author | Lucas Stach <dev@lynxeye.de> | 2015-03-05 22:50:03 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-03-06 07:52:02 +0100 |
commit | 3110eed114ca6064feae027f73b36eb34d0cc0d4 (patch) | |
tree | 6e8296098c628ca6f0d0cdc3f45ce07a5af9a9e9 | |
parent | cdb471b023c19cb55dc0af74284d8c41b5a0aa4f (diff) | |
download | barebox-3110eed114ca6064feae027f73b36eb34d0cc0d4.tar.gz barebox-3110eed114ca6064feae027f73b36eb34d0cc0d4.tar.xz |
AHCI: convert to streaming DMA ops
Move to the common streaming DMA ops in order to get rid of
the direct usage of the ARM MMU functions for the cache
maintenance.
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/ata/ahci.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 2c121d7c5e..4e42180d9e 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -31,7 +31,6 @@ #include <linux/ctype.h> #include <linux/err.h> #include <disks.h> -#include <asm/mmu.h> #include <ata_drive.h> #include <linux/sizes.h> #include <clock.h> @@ -170,7 +169,11 @@ static int ahci_io(struct ahci_port *ahci_port, u8 *fis, int fis_len, void *rbuf return -EIO; if (wbuf) - dma_flush_range((unsigned long)wbuf, (unsigned long)wbuf + buf_len); + dma_sync_single_for_device((unsigned long)wbuf, buf_len, + DMA_TO_DEVICE); + if (rbuf) + dma_sync_single_for_device((unsigned long)rbuf, buf_len, + DMA_FROM_DEVICE); memcpy((unsigned char *)ahci_port->cmd_tbl, fis, fis_len); @@ -187,8 +190,12 @@ static int ahci_io(struct ahci_port *ahci_port, u8 *fis, int fis_len, void *rbuf if (ret) return -ETIMEDOUT; + if (wbuf) + dma_sync_single_for_cpu((unsigned long)wbuf, buf_len, + DMA_TO_DEVICE); if (rbuf) - dma_inv_range((unsigned long)rbuf, (unsigned long)rbuf + buf_len); + dma_sync_single_for_cpu((unsigned long)rbuf, buf_len, + DMA_FROM_DEVICE); return 0; } |