Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -Naur linux-3.2.19/drivers/mmc/core/core.c linux-3.2.19.patch/drivers/mmc/core/core.c
- --- linux-3.2.19/drivers/mmc/core/core.c 2012-05-31 01:44:12.000000000 +0200
- +++ linux-3.2.19.patch/drivers/mmc/core/core.c 2012-06-12 14:06:43.284698203 +0200
- @@ -514,10 +514,14 @@
- if (data->flags & MMC_DATA_WRITE)
- /*
- - * The limit is really 250 ms, but that is
- - * insufficient for some crappy cards.
- + * The MMC spec "It is strongly recommended
- + * for hosts to implement more than 500ms
- + * timeout value even if the card indicates
- + * the 250ms maximum busy length." Even the
- + * previous value of 300ms is known to be
- + * insufficient for some cards.
- */
- - limit_us = 300000;
- + limit_us = 300000;
- else
- limit_us = 100000;
- diff -Naur linux-3.2.19/drivers/mmc/host/sdhci-bcm2708.c linux-3.2.19.patch/drivers/mmc/host/sdhci-bcm2708.c
- --- linux-3.2.19/drivers/mmc/host/sdhci-bcm2708.c 2012-06-12 15:16:07.597871406 +0200
- +++ linux-3.2.19.patch/drivers/mmc/host/sdhci-bcm2708.c 2012-06-12 14:59:57.368541441 +0200
- @@ -71,6 +71,9 @@
- #define BCM2708_SDHCI_SLEEP_TIMEOUT 1000 /* msecs */
- +/* Mhz clock that the EMMC core is running at. Should match the platform clockman settings */
- +#define BCM2708_EMMC_CLOCK_FREQ 100000000
- +
- #define POWER_OFF 0
- #define POWER_LAZY_OFF 1
- #define POWER_ON 2
- @@ -130,6 +133,8 @@
- return (unsigned long)((hptime() - t) * HPTIME_CLK_NS);
- }
- +static bool allow_highspeed = 1;
- +
- #if 0
- static void hptime_test(void)
- {
- @@ -328,12 +333,7 @@
- static unsigned int sdhci_bcm2708_get_max_clock(struct sdhci_host *host)
- {
- - return 100000000; // this value is in Hz (100MHz/4)
- -}
- -
- -static unsigned int sdhci_bcm2708_get_timeout_clock(struct sdhci_host *host)
- -{
- - return 100000; // this value is in kHz (100MHz/4)
- + return BCM2708_EMMC_CLOCK_FREQ;
- }
- /*****************************************************************************\
- @@ -822,7 +822,7 @@
- while (0 != (sdhci_bcm2708_raw_readl(host, SDHCI_PRESENT_STATE)
- & state_mask) && --timeout > 0)
- {
- - udelay(100);
- + udelay(100);
- continue;
- }
- if (timeout <= 0)
- @@ -1222,11 +1222,8 @@
- #else
- #error The BCM2708 SDHCI driver needs CONFIG_MMC_SDHCI_IO_ACCESSORS to be set
- #endif
- - //.enable_dma = NULL,
- //.set_clock = NULL,
- .get_max_clock = sdhci_bcm2708_get_max_clock,
- - //.get_min_clock = NULL,
- - .get_timeout_clock = sdhci_bcm2708_get_timeout_clock,
- .enable = sdhci_bcm2708_enable,
- .disable = sdhci_bcm2708_disable,
- @@ -1287,7 +1284,9 @@
- host->irq = platform_get_irq(pdev, 0);
- host->quirks = SDHCI_QUIRK_BROKEN_CARD_DETECTION |
- - SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK;
- + SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
- + SDHCI_QUIRK_MISSING_CAPS |
- + SDHCI_QUIRK_NO_HISPD_BIT;
- #ifdef CONFIG_MMC_SDHCI_BCM2708_DMA
- host->flags = SDHCI_USE_PLATDMA;
- #endif
- @@ -1354,6 +1353,9 @@
- host_priv->cb_base, (unsigned)host_priv->cb_handle,
- host_priv->dma_chan, host_priv->dma_chan_base,
- host_priv->dma_irq);
- +
- + if (allow_highspeed)
- + host->mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;
- #endif
- ret = sdhci_add_host(host);
- @@ -1459,8 +1461,12 @@
- module_init(sdhci_drv_init);
- module_exit(sdhci_drv_exit);
- +module_param(allow_highspeed, bool, 0444);
- +
- MODULE_DESCRIPTION("Secure Digital Host Controller Interface platform driver");
- MODULE_AUTHOR("Broadcom <[email protected]>");
- MODULE_LICENSE("GPL v2");
- MODULE_ALIAS("platform:"DRIVER_NAME);
- +MODULE_PARM_DESC(allow_highspeed, "Allow high speed transfers modes");
- +
- diff -Naur linux-3.2.19/include/linux/mmc/card.h linux-3.2.19.patch/include/linux/mmc/card.h
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement