@@ -14,6 +14,15 @@ config MMC_BLOCK
mount the filesystem. Almost everyone wishing MMC support
should say Y or M here.
+config MMC_BLOCK_QUIRK_TOSHIBA_32NM
+ tristate "Toshiba MMC 32nm technology flash device quirks"
+ depends on MMC_BLOCK
+ default n
+ help
+ Say Y if you have a Toshiba 32nm technology flash device,
+ such as MMC32G or MMC16G eMMCs. This enables a performance
+ improvement for flash page unaligned writes.
+
config MMC_BLOCK_BOUNCE
bool "Use bounce buffer for simple hosts"
depends on MMC_BLOCK
@@ -729,8 +729,28 @@ mmc_blk_set_blksize(struct mmc_blk_data *md, struct mmc_card *card)
return 0;
}
+#ifdef CONFIG_MMC_BLOCK_QUIRK_TOSHIBA_32NM
+static void toshiba_32nm_fixup(struct mmc_card *card, int data)
+{
+ struct mmc_blk_data *md = mmc_get_drvdata(card);
+ printk(KERN_INFO "Applying Toshiba 32nm workarounds\n");
+
+ /* Page size 8K, this card doesn't like unaligned writes
+ across 8K boundary. */
+ md->write_align_size = 8192;
+
+ /* Doing the alignment for accesses > 12K seems to
+ result in decreased perf. */
+ md->write_align_limit = 12288;
+}
+#endif /* CONFIG_MMC_BLOCK_QUIRK_TOSHIBA_32NM */
+
static const struct mmc_fixup blk_fixups[] =
{
+#ifdef CONFIG_MMC_BLOCK_QUIRK_TOSHIBA_32NM
+ MMC_FIXUP("MMC16G", 0x11, 0x0, toshiba_32nm_fixup, 0),
+ MMC_FIXUP("MMC32G", 0x11, 0x0100, toshiba_32nm_fixup, 0),
+#endif /* CONFIG_MMC_BLOCK_QUIRK_TOSHIBA_32NM */
END_FIXUP
};