Advertisement
Guest User

Untitled

a guest
Jun 12th, 2012
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.67 KB | None | 0 0
  1. diff -Naur linux-3.2.19/drivers/mmc/core/core.c linux-3.2.19.patch/drivers/mmc/core/core.c
  2. --- linux-3.2.19/drivers/mmc/core/core.c 2012-05-31 01:44:12.000000000 +0200
  3. +++ linux-3.2.19.patch/drivers/mmc/core/core.c 2012-06-12 14:06:43.284698203 +0200
  4. @@ -514,10 +514,14 @@
  5.  
  6. if (data->flags & MMC_DATA_WRITE)
  7. /*
  8. - * The limit is really 250 ms, but that is
  9. - * insufficient for some crappy cards.
  10. + * The MMC spec "It is strongly recommended
  11. + * for hosts to implement more than 500ms
  12. + * timeout value even if the card indicates
  13. + * the 250ms maximum busy length." Even the
  14. + * previous value of 300ms is known to be
  15. + * insufficient for some cards.
  16. */
  17. - limit_us = 300000;
  18. + limit_us = 300000;
  19. else
  20. limit_us = 100000;
  21.  
  22. diff -Naur linux-3.2.19/drivers/mmc/host/sdhci-bcm2708.c linux-3.2.19.patch/drivers/mmc/host/sdhci-bcm2708.c
  23. --- linux-3.2.19/drivers/mmc/host/sdhci-bcm2708.c 2012-06-12 15:16:07.597871406 +0200
  24. +++ linux-3.2.19.patch/drivers/mmc/host/sdhci-bcm2708.c 2012-06-12 14:59:57.368541441 +0200
  25. @@ -71,6 +71,9 @@
  26.  
  27. #define BCM2708_SDHCI_SLEEP_TIMEOUT 1000 /* msecs */
  28.  
  29. +/* Mhz clock that the EMMC core is running at. Should match the platform clockman settings */
  30. +#define BCM2708_EMMC_CLOCK_FREQ 100000000
  31. +
  32. #define POWER_OFF 0
  33. #define POWER_LAZY_OFF 1
  34. #define POWER_ON 2
  35. @@ -130,6 +133,8 @@
  36. return (unsigned long)((hptime() - t) * HPTIME_CLK_NS);
  37. }
  38.  
  39. +static bool allow_highspeed = 1;
  40. +
  41. #if 0
  42. static void hptime_test(void)
  43. {
  44. @@ -328,12 +333,7 @@
  45.  
  46. static unsigned int sdhci_bcm2708_get_max_clock(struct sdhci_host *host)
  47. {
  48. - return 100000000; // this value is in Hz (100MHz/4)
  49. -}
  50. -
  51. -static unsigned int sdhci_bcm2708_get_timeout_clock(struct sdhci_host *host)
  52. -{
  53. - return 100000; // this value is in kHz (100MHz/4)
  54. + return BCM2708_EMMC_CLOCK_FREQ;
  55. }
  56.  
  57. /*****************************************************************************\
  58. @@ -822,7 +822,7 @@
  59. while (0 != (sdhci_bcm2708_raw_readl(host, SDHCI_PRESENT_STATE)
  60. & state_mask) && --timeout > 0)
  61. {
  62. - udelay(100);
  63. + udelay(100);
  64. continue;
  65. }
  66. if (timeout <= 0)
  67. @@ -1222,11 +1222,8 @@
  68. #else
  69. #error The BCM2708 SDHCI driver needs CONFIG_MMC_SDHCI_IO_ACCESSORS to be set
  70. #endif
  71. - //.enable_dma = NULL,
  72. //.set_clock = NULL,
  73. .get_max_clock = sdhci_bcm2708_get_max_clock,
  74. - //.get_min_clock = NULL,
  75. - .get_timeout_clock = sdhci_bcm2708_get_timeout_clock,
  76.  
  77. .enable = sdhci_bcm2708_enable,
  78. .disable = sdhci_bcm2708_disable,
  79. @@ -1287,7 +1284,9 @@
  80. host->irq = platform_get_irq(pdev, 0);
  81.  
  82. host->quirks = SDHCI_QUIRK_BROKEN_CARD_DETECTION |
  83. - SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK;
  84. + SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
  85. + SDHCI_QUIRK_MISSING_CAPS |
  86. + SDHCI_QUIRK_NO_HISPD_BIT;
  87. #ifdef CONFIG_MMC_SDHCI_BCM2708_DMA
  88. host->flags = SDHCI_USE_PLATDMA;
  89. #endif
  90. @@ -1354,6 +1353,9 @@
  91. host_priv->cb_base, (unsigned)host_priv->cb_handle,
  92. host_priv->dma_chan, host_priv->dma_chan_base,
  93. host_priv->dma_irq);
  94. +
  95. + if (allow_highspeed)
  96. + host->mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;
  97. #endif
  98.  
  99. ret = sdhci_add_host(host);
  100. @@ -1459,8 +1461,12 @@
  101. module_init(sdhci_drv_init);
  102. module_exit(sdhci_drv_exit);
  103.  
  104. +module_param(allow_highspeed, bool, 0444);
  105. +
  106. MODULE_DESCRIPTION("Secure Digital Host Controller Interface platform driver");
  107. MODULE_AUTHOR("Broadcom <info@broadcom.com>");
  108. MODULE_LICENSE("GPL v2");
  109. MODULE_ALIAS("platform:"DRIVER_NAME);
  110.  
  111. +MODULE_PARM_DESC(allow_highspeed, "Allow high speed transfers modes");
  112. +
  113. 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