diff options
author | Manuel Lauss <manuel.lauss@googlemail.com> | 2009-10-13 14:22:35 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2010-02-27 06:52:55 -0500 |
commit | 963accbc82a0912b39de39d59e2fd6741db3aa4b (patch) | |
tree | 4ea340b0261ab19f3f0776f47e4fab8708934b5b /drivers | |
parent | ea071cc705e8bfba0c8bf84be8d4f9f4e9da6962 (diff) |
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.c | 8 | ||||
-rw-r--r-- | drivers/mmc/host/au1xmmc.c | 4 | ||||
-rw-r--r-- | drivers/spi/au1550_spi.c | 4 |
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) | |||
56 | chan_tab_t *ctp; | 56 | chan_tab_t *ctp; |
57 | au1x_ddma_desc_t *dp; | 57 | au1x_ddma_desc_t *dp; |
58 | 58 | ||
59 | if (!au1xxx_dbdma_put_dest(ahwif->rx_chan, (void*)addr, | 59 | if (!au1xxx_dbdma_put_dest(ahwif->rx_chan, virt_to_phys(addr), |
60 | count << 1, DDMA_FLAGS_NOIE)) { | 60 | count << 1, DDMA_FLAGS_NOIE)) { |
61 | printk(KERN_ERR "%s failed %d\n", __func__, __LINE__); | 61 | printk(KERN_ERR "%s failed %d\n", __func__, __LINE__); |
62 | return; | 62 | return; |
@@ -74,7 +74,7 @@ static inline void auide_outsw(unsigned long port, void *addr, u32 count) | |||
74 | chan_tab_t *ctp; | 74 | chan_tab_t *ctp; |
75 | au1x_ddma_desc_t *dp; | 75 | au1x_ddma_desc_t *dp; |
76 | 76 | ||
77 | if (!au1xxx_dbdma_put_source(ahwif->tx_chan, (void*)addr, | 77 | if (!au1xxx_dbdma_put_source(ahwif->tx_chan, virt_to_phys(addr), |
78 | count << 1, DDMA_FLAGS_NOIE)) { | 78 | count << 1, DDMA_FLAGS_NOIE)) { |
79 | printk(KERN_ERR "%s failed %d\n", __func__, __LINE__); | 79 | printk(KERN_ERR "%s failed %d\n", __func__, __LINE__); |
80 | return; | 80 | return; |
@@ -247,13 +247,13 @@ static int auide_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd) | |||
247 | 247 | ||
248 | if (iswrite) { | 248 | if (iswrite) { |
249 | if (!au1xxx_dbdma_put_source(ahwif->tx_chan, | 249 | if (!au1xxx_dbdma_put_source(ahwif->tx_chan, |
250 | (void *)sg_virt(sg), tc, flags)) { | 250 | sg_phys(sg), tc, flags)) { |
251 | printk(KERN_ERR "%s failed %d\n", | 251 | printk(KERN_ERR "%s failed %d\n", |
252 | __func__, __LINE__); | 252 | __func__, __LINE__); |
253 | } | 253 | } |
254 | } else { | 254 | } else { |
255 | if (!au1xxx_dbdma_put_dest(ahwif->rx_chan, | 255 | if (!au1xxx_dbdma_put_dest(ahwif->rx_chan, |
256 | (void *)sg_virt(sg), tc, flags)) { | 256 | sg_phys(sg), tc, flags)) { |
257 | printk(KERN_ERR "%s failed %d\n", | 257 | printk(KERN_ERR "%s failed %d\n", |
258 | __func__, __LINE__); | 258 | __func__, __LINE__); |
259 | } | 259 | } |
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, | |||
651 | 651 | ||
652 | if (host->flags & HOST_F_XMIT) { | 652 | if (host->flags & HOST_F_XMIT) { |
653 | ret = au1xxx_dbdma_put_source(channel, | 653 | ret = au1xxx_dbdma_put_source(channel, |
654 | (void *)sg_virt(sg), len, flags); | 654 | sg_phys(sg), len, flags); |
655 | } else { | 655 | } else { |
656 | ret = au1xxx_dbdma_put_dest(channel, | 656 | ret = au1xxx_dbdma_put_dest(channel, |
657 | (void *)sg_virt(sg), len, flags); | 657 | sg_phys(sg), len, flags); |
658 | } | 658 | } |
659 | 659 | ||
660 | if (!ret) | 660 | 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) | |||
412 | } | 412 | } |
413 | 413 | ||
414 | /* put buffers on the ring */ | 414 | /* put buffers on the ring */ |
415 | res = au1xxx_dbdma_put_dest(hw->dma_rx_ch, hw->rx, | 415 | res = au1xxx_dbdma_put_dest(hw->dma_rx_ch, virt_to_phys(hw->rx), |
416 | t->len, DDMA_FLAGS_IE); | 416 | t->len, DDMA_FLAGS_IE); |
417 | if (!res) | 417 | if (!res) |
418 | dev_err(hw->dev, "rx dma put dest error\n"); | 418 | dev_err(hw->dev, "rx dma put dest error\n"); |
419 | 419 | ||
420 | res = au1xxx_dbdma_put_source(hw->dma_tx_ch, (void *)hw->tx, | 420 | res = au1xxx_dbdma_put_source(hw->dma_tx_ch, virt_to_phys(hw->tx), |
421 | t->len, DDMA_FLAGS_IE); | 421 | t->len, DDMA_FLAGS_IE); |
422 | if (!res) | 422 | if (!res) |
423 | dev_err(hw->dev, "tx dma put source error\n"); | 423 | dev_err(hw->dev, "tx dma put source error\n"); |