summaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorLucas Stach <dev@lynxeye.de>2015-03-05 22:49:55 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-03-06 07:51:47 +0100
commite05f9586b302d0dba5e9c98d849596cad1716a6f (patch)
treee4f8aa0b3e0dd5c3899d09e6d46746a37baf4635 /drivers/ata
parent6c583d0e327deecaea026cf47576fbe42274bd8c (diff)
downloadbarebox-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/ata')
-rw-r--r--drivers/ata/ahci.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 346ab98134..d299ac6e27 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -310,7 +310,8 @@ static int ahci_init_port(struct ahci_port *ahci_port)
* First item in chunk of DMA memory: 32-slot command table,
* 32 bytes each in size
*/
- ahci_port->cmd_slot = dma_alloc_coherent(AHCI_CMD_SLOT_SZ * 32);
+ ahci_port->cmd_slot = dma_alloc_coherent(AHCI_CMD_SLOT_SZ * 32,
+ DMA_ADDRESS_BROKEN);
if (!ahci_port->cmd_slot) {
ret = -ENOMEM;
goto err_alloc;
@@ -321,7 +322,8 @@ static int ahci_init_port(struct ahci_port *ahci_port)
/*
* Second item: Received-FIS area
*/
- ahci_port->rx_fis = (unsigned long)dma_alloc_coherent(AHCI_RX_FIS_SZ);
+ ahci_port->rx_fis = (unsigned long)dma_alloc_coherent(AHCI_RX_FIS_SZ,
+ DMA_ADDRESS_BROKEN);
if (!ahci_port->rx_fis) {
ret = -ENOMEM;
goto err_alloc1;
@@ -331,7 +333,8 @@ static int ahci_init_port(struct ahci_port *ahci_port)
* Third item: data area for storing a single command
* and its scatter-gather table
*/
- ahci_port->cmd_tbl = dma_alloc_coherent(AHCI_CMD_TBL_SZ);
+ ahci_port->cmd_tbl = dma_alloc_coherent(AHCI_CMD_TBL_SZ,
+ DMA_ADDRESS_BROKEN);
if (!ahci_port->cmd_tbl) {
ret = -ENOMEM;
goto err_alloc2;
@@ -429,11 +432,11 @@ static int ahci_init_port(struct ahci_port *ahci_port)
ret = -ENODEV;
err_init:
- dma_free_coherent(ahci_port->cmd_tbl, AHCI_CMD_TBL_SZ);
+ dma_free_coherent(ahci_port->cmd_tbl, 0, AHCI_CMD_TBL_SZ);
err_alloc2:
- dma_free_coherent((void *)ahci_port->rx_fis, AHCI_RX_FIS_SZ);
+ dma_free_coherent((void *)ahci_port->rx_fis, 0, AHCI_RX_FIS_SZ);
err_alloc1:
- dma_free_coherent(ahci_port->cmd_slot, AHCI_CMD_SLOT_SZ * 32);
+ dma_free_coherent(ahci_port->cmd_slot, 0, AHCI_CMD_SLOT_SZ * 32);
err_alloc:
return ret;
}