1 From 3e9891e91d7dda096ab1cc2518830938ad69880d Mon Sep 17 00:00:00 2001
2 From: popcornmix <popcornmix@gmail.com>
3 Date: Sun, 12 May 2013 12:25:52 +0100
4 Subject: [PATCH 021/174] sdhci-bcm2708: use extension FIFO to buffer DMA
7 The additional FIFO might speed up transfers in some cases.
9 drivers/mmc/host/sdhci-bcm2708.c | 11 +++++++++++
10 1 file changed, 11 insertions(+)
12 --- a/drivers/mmc/host/sdhci-bcm2708.c
13 +++ b/drivers/mmc/host/sdhci-bcm2708.c
15 /* Mhz clock that the EMMC core is running at. Should match the platform clockman settings */
16 #define BCM2708_EMMC_CLOCK_FREQ 50000000
18 +#define REG_EXRDFIFO_EN 0x80
19 +#define REG_EXRDFIFO_CFG 0x84
21 /*****************************************************************************\
24 @@ -957,10 +960,12 @@ static ssize_t attr_dma_store(struct dev
25 int on = simple_strtol(buf, NULL, 0);
27 host->flags |= SDHCI_USE_PLATDMA;
28 + sdhci_bcm2708_writel(host, 1, REG_EXRDFIFO_EN);
29 printk(KERN_INFO "%s: DMA enabled\n",
30 mmc_hostname(host->mmc));
32 host->flags &= ~(SDHCI_USE_PLATDMA | SDHCI_REQ_USE_DMA);
33 + sdhci_bcm2708_writel(host, 0, REG_EXRDFIFO_EN);
34 printk(KERN_INFO "%s: DMA disabled\n",
35 mmc_hostname(host->mmc));
37 @@ -1272,6 +1277,12 @@ static int sdhci_bcm2708_probe(struct pl
38 ret = device_create_file(&pdev->dev, &dev_attr_dma_wait);
39 ret = device_create_file(&pdev->dev, &dev_attr_status);
41 +#ifdef CONFIG_MMC_SDHCI_BCM2708_DMA
42 + /* enable extension fifo for paced DMA transfers */
43 + sdhci_bcm2708_writel(host, 1, REG_EXRDFIFO_EN);
44 + sdhci_bcm2708_writel(host, 4, REG_EXRDFIFO_CFG);
47 printk(KERN_INFO "%s: BCM2708 SDHC host at 0x%08llx DMA %d IRQ %d\n",
48 mmc_hostname(host->mmc), (unsigned long long)iomem->start,
49 host_priv->dma_chan, host_priv->dma_irq);