aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sdhci.c20
-rw-r--r--drivers/mmc/host/sdhci.h2
2 files changed, 15 insertions, 7 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 3a72fe2cf1cf..30d8e3d4e6fd 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1777,13 +1777,19 @@ int sdhci_add_host(struct sdhci_host *host)
1777 * Maximum block size. This varies from controller to controller and 1777 * Maximum block size. This varies from controller to controller and
1778 * is specified in the capabilities register. 1778 * is specified in the capabilities register.
1779 */ 1779 */
1780 mmc->max_blk_size = (caps & SDHCI_MAX_BLOCK_MASK) >> SDHCI_MAX_BLOCK_SHIFT; 1780 if (host->quirks & SDHCI_QUIRK_FORCE_BLK_SZ_2048) {
1781 if (mmc->max_blk_size >= 3) { 1781 mmc->max_blk_size = 2;
1782 printk(KERN_WARNING "%s: Invalid maximum block size, " 1782 } else {
1783 "assuming 512 bytes\n", mmc_hostname(mmc)); 1783 mmc->max_blk_size = (caps & SDHCI_MAX_BLOCK_MASK) >>
1784 mmc->max_blk_size = 512; 1784 SDHCI_MAX_BLOCK_SHIFT;
1785 } else 1785 if (mmc->max_blk_size >= 3) {
1786 mmc->max_blk_size = 512 << mmc->max_blk_size; 1786 printk(KERN_WARNING "%s: Invalid maximum block size, "
1787 "assuming 512 bytes\n", mmc_hostname(mmc));
1788 mmc->max_blk_size = 0;
1789 }
1790 }
1791
1792 mmc->max_blk_size = 512 << mmc->max_blk_size;
1787 1793
1788 /* 1794 /*
1789 * Maximum block count. 1795 * Maximum block count.
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 2962102b6953..f20a834f4309 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -224,6 +224,8 @@ struct sdhci_host {
224#define SDHCI_QUIRK_PIO_NEEDS_DELAY (1<<18) 224#define SDHCI_QUIRK_PIO_NEEDS_DELAY (1<<18)
225/* Controller losing signal/interrupt enable states after reset */ 225/* Controller losing signal/interrupt enable states after reset */
226#define SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET (1<<19) 226#define SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET (1<<19)
227/* Controller has to be forced to use block size of 2048 bytes */
228#define SDHCI_QUIRK_FORCE_BLK_SZ_2048 (1<<20)
227 229
228 int irq; /* Device IRQ */ 230 int irq; /* Device IRQ */
229 void __iomem * ioaddr; /* Mapped address */ 231 void __iomem * ioaddr; /* Mapped address */