brcm2708: switch to 3.14
[15.05/openwrt.git] / target / linux / brcm2708 / patches-3.10 / 0021-sdhci-bcm2708-use-extension-FIFO-to-buffer-DMA-trans.patch
1 From b802bfd3bb337e92226bd521f8ebbbcfc6642333 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/196] sdhci-bcm2708: use extension FIFO to buffer DMA
5  transfers
6
7 The additional FIFO might speed up transfers in some cases.
8 ---
9  drivers/mmc/host/sdhci-bcm2708.c | 11 +++++++++++
10  1 file changed, 11 insertions(+)
11
12 diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c
13 index 3792b9f..326b962 100644
14 --- a/drivers/mmc/host/sdhci-bcm2708.c
15 +++ b/drivers/mmc/host/sdhci-bcm2708.c
16 @@ -74,6 +74,9 @@
17  /* Mhz clock that the EMMC core is running at. Should match the platform clockman settings */
18  #define BCM2708_EMMC_CLOCK_FREQ 50000000
19  
20 +#define REG_EXRDFIFO_EN     0x80
21 +#define REG_EXRDFIFO_CFG    0x84
22 +
23  /*****************************************************************************\
24   *                                                                          *
25   * Debug                                                                    *
26 @@ -957,10 +960,12 @@ static ssize_t attr_dma_store(struct device *_dev,
27                 int on = simple_strtol(buf, NULL, 0);
28                 if (on) {
29                         host->flags |= SDHCI_USE_PLATDMA;
30 +                       sdhci_bcm2708_writel(host, 1, REG_EXRDFIFO_EN);
31                         printk(KERN_INFO "%s: DMA enabled\n",
32                                mmc_hostname(host->mmc));
33                 } else {
34                         host->flags &= ~(SDHCI_USE_PLATDMA | SDHCI_REQ_USE_DMA);
35 +                       sdhci_bcm2708_writel(host, 0, REG_EXRDFIFO_EN);
36                         printk(KERN_INFO "%s: DMA disabled\n",
37                                mmc_hostname(host->mmc));
38                 }
39 @@ -1272,6 +1277,12 @@ static int sdhci_bcm2708_probe(struct platform_device *pdev)
40         ret = device_create_file(&pdev->dev, &dev_attr_dma_wait);
41         ret = device_create_file(&pdev->dev, &dev_attr_status);
42  
43 +#ifdef CONFIG_MMC_SDHCI_BCM2708_DMA
44 +       /* enable extension fifo for paced DMA transfers */
45 +       sdhci_bcm2708_writel(host, 1, REG_EXRDFIFO_EN);
46 +       sdhci_bcm2708_writel(host, 4, REG_EXRDFIFO_CFG);
47 +#endif
48 +
49         printk(KERN_INFO "%s: BCM2708 SDHC host at 0x%08llx DMA %d IRQ %d\n",
50                mmc_hostname(host->mmc), (unsigned long long)iomem->start,
51                host_priv->dma_chan, host_priv->dma_irq);
52 -- 
53 1.9.1
54