summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorManuel Lauss <manuel.lauss@googlemail.com>2009-10-13 20:22:35 +0200
committerRalf Baechle <ralf@linux-mips.org>2010-02-27 12:52:55 +0100
commit963accbc82a0912b39de39d59e2fd6741db3aa4b (patch)
tree4ea340b0261ab19f3f0776f47e4fab8708934b5b /drivers
parentea071cc705e8bfba0c8bf84be8d4f9f4e9da6962 (diff)
downloadblackbird-op-linux-963accbc82a0912b39de39d59e2fd6741db3aa4b.tar.gz
blackbird-op-linux-963accbc82a0912b39de39d59e2fd6741db3aa4b.zip
MIPS: Alchemy: change dbdma to accept physical memory addresses
DMA can only be done from physical addresses; move the "virt_to_phys" source/destination buffer address translation from the dbdma queueing functions (since the hardware can only DMA to/from physical addresses) to their respective users. Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/au1xxx-ide.c8
-rw-r--r--drivers/mmc/host/au1xmmc.c4
-rw-r--r--drivers/spi/au1550_spi.c4
3 files changed, 8 insertions, 8 deletions
diff --git a/drivers/ide/au1xxx-ide.c b/drivers/ide/au1xxx-ide.c
index 377412e1d32b..349a67bf1a36 100644
--- a/drivers/ide/au1xxx-ide.c
+++ b/drivers/ide/au1xxx-ide.c
@@ -56,7 +56,7 @@ static inline void auide_insw(unsigned long port, void *addr, u32 count)
chan_tab_t *ctp;
au1x_ddma_desc_t *dp;
- if (!au1xxx_dbdma_put_dest(ahwif->rx_chan, (void*)addr,
+ if (!au1xxx_dbdma_put_dest(ahwif->rx_chan, virt_to_phys(addr),
count << 1, DDMA_FLAGS_NOIE)) {
printk(KERN_ERR "%s failed %d\n", __func__, __LINE__);
return;
@@ -74,7 +74,7 @@ static inline void auide_outsw(unsigned long port, void *addr, u32 count)
chan_tab_t *ctp;
au1x_ddma_desc_t *dp;
- if (!au1xxx_dbdma_put_source(ahwif->tx_chan, (void*)addr,
+ if (!au1xxx_dbdma_put_source(ahwif->tx_chan, virt_to_phys(addr),
count << 1, DDMA_FLAGS_NOIE)) {
printk(KERN_ERR "%s failed %d\n", __func__, __LINE__);
return;
@@ -247,13 +247,13 @@ static int auide_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd)
if (iswrite) {
if (!au1xxx_dbdma_put_source(ahwif->tx_chan,
- (void *)sg_virt(sg), tc, flags)) {
+ sg_phys(sg), tc, flags)) {
printk(KERN_ERR "%s failed %d\n",
__func__, __LINE__);
}
} else {
if (!au1xxx_dbdma_put_dest(ahwif->rx_chan,
- (void *)sg_virt(sg), tc, flags)) {
+ sg_phys(sg), tc, flags)) {
printk(KERN_ERR "%s failed %d\n",
__func__, __LINE__);
}
diff --git a/drivers/mmc/host/au1xmmc.c b/drivers/mmc/host/au1xmmc.c
index d295dc5e4f6b..c8649dfb2d0c 100644
--- a/drivers/mmc/host/au1xmmc.c
+++ b/drivers/mmc/host/au1xmmc.c
@@ -651,10 +651,10 @@ static int au1xmmc_prepare_data(struct au1xmmc_host *host,
if (host->flags & HOST_F_XMIT) {
ret = au1xxx_dbdma_put_source(channel,
- (void *)sg_virt(sg), len, flags);
+ sg_phys(sg), len, flags);
} else {
ret = au1xxx_dbdma_put_dest(channel,
- (void *)sg_virt(sg), len, flags);
+ sg_phys(sg), len, flags);
}
if (!ret)
diff --git a/drivers/spi/au1550_spi.c b/drivers/spi/au1550_spi.c
index 22f7d7294787..ba8ac4f599d3 100644
--- a/drivers/spi/au1550_spi.c
+++ b/drivers/spi/au1550_spi.c
@@ -412,12 +412,12 @@ static int au1550_spi_dma_txrxb(struct spi_device *spi, struct spi_transfer *t)
}
/* put buffers on the ring */
- res = au1xxx_dbdma_put_dest(hw->dma_rx_ch, hw->rx,
+ res = au1xxx_dbdma_put_dest(hw->dma_rx_ch, virt_to_phys(hw->rx),
t->len, DDMA_FLAGS_IE);
if (!res)
dev_err(hw->dev, "rx dma put dest error\n");
- res = au1xxx_dbdma_put_source(hw->dma_tx_ch, (void *)hw->tx,
+ res = au1xxx_dbdma_put_source(hw->dma_tx_ch, virt_to_phys(hw->tx),
t->len, DDMA_FLAGS_IE);
if (!res)
dev_err(hw->dev, "tx dma put source error\n");
OpenPOWER on IntegriCloud