Permalink
Browse files

sdhci-bcm2708: use extension FIFO to buffer DMA transfers

The additional FIFO might speed up transfers in some cases.
  • Loading branch information...
grigorig committed Jun 20, 2012
1 parent 20eadb1 commit 8b1821c5aa046ee4816ecbf3000a90cf6b2debc4
Showing with 10 additions and 0 deletions.
  1. +10 −0 drivers/mmc/host/sdhci-bcm2708.c
@@ -79,6 +79,8 @@
#define POWER_LAZY_OFF 1
#define POWER_ON 2
+#define REG_EXRDFIFO_EN 0x80
+#define REG_EXRDFIFO_CFG 0x84
/*****************************************************************************\
* *
@@ -967,10 +969,12 @@ static ssize_t attr_dma_store(struct device *_dev,
int on = simple_strtol(buf, NULL, 0);
if (on) {
host->flags |= SDHCI_USE_PLATDMA;
+ sdhci_bcm2708_writel(host, 1, REG_EXRDFIFO_EN);
printk(KERN_INFO "%s: DMA enabled\n",
mmc_hostname(host->mmc));
} else {
host->flags &= ~(SDHCI_USE_PLATDMA | SDHCI_REQ_USE_DMA);
+ sdhci_bcm2708_writel(host, 0, REG_EXRDFIFO_EN);
printk(KERN_INFO "%s: DMA disabled\n",
mmc_hostname(host->mmc));
}
@@ -1399,6 +1403,12 @@ static int __devinit sdhci_bcm2708_probe(struct platform_device *pdev)
ret = device_create_file(&pdev->dev, &dev_attr_dma_wait);
ret = device_create_file(&pdev->dev, &dev_attr_status);
+#ifdef CONFIG_MMC_SDHCI_BCM2708_DMA
+ /* enable extension fifo for paced DMA transfers */
+ sdhci_bcm2708_writel(host, 1, REG_EXRDFIFO_EN);
+ sdhci_bcm2708_writel(host, 4, REG_EXRDFIFO_CFG);
+#endif
+
printk(KERN_INFO "%s: BCM2708 SDHC host at 0x%08llx DMA %d IRQ %d\n",
mmc_hostname(host->mmc), (unsigned long long)iomem->start,
host_priv->dma_chan, host_priv->dma_irq);

0 comments on commit 8b1821c

Please sign in to comment.