summaryrefslogtreecommitdiff
path: root/target/linux/kirkwood
diff options
context:
space:
mode:
authorImre Kaloz <kaloz@openwrt.org>2009-06-01 12:50:35 +0000
committerImre Kaloz <kaloz@openwrt.org>2009-06-01 12:50:35 +0000
commit5bf5036c0c2e7abafe070a688ba58fa08224701d (patch)
treecc443aa082fecb31dfb1bb4ffcde1a198916a627 /target/linux/kirkwood
parent1befe26655f630823cc56a8ab1e84fad8273ee90 (diff)
downloadmtk-20170518-5bf5036c0c2e7abafe070a688ba58fa08224701d.zip
mtk-20170518-5bf5036c0c2e7abafe070a688ba58fa08224701d.tar.gz
mtk-20170518-5bf5036c0c2e7abafe070a688ba58fa08224701d.tar.bz2
fix compatibility with certain SD cards
SVN-Revision: 16249
Diffstat (limited to 'target/linux/kirkwood')
-rw-r--r--target/linux/kirkwood/patches/002-mvsdio_delay.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/target/linux/kirkwood/patches/002-mvsdio_delay.patch b/target/linux/kirkwood/patches/002-mvsdio_delay.patch
new file mode 100644
index 0000000..ee73030
--- /dev/null
+++ b/target/linux/kirkwood/patches/002-mvsdio_delay.patch
@@ -0,0 +1,46 @@
+--- a/drivers/mmc/core/sd.c
++++ b/drivers/mmc/core/sd.c
+@@ -263,6 +263,15 @@ static int mmc_switch_hs(struct mmc_card
+ return -ENOMEM;
+ }
+
++ /*
++ * Some SDHC cards, notably those with a Sandisk SD controller
++ * (also found in Kingston products) need a bit of slack
++ * before successfully handling the SWITCH command. So far,
++ * cards identifying themselves as "SD04G" and "SD08G" are
++ * affected
++ */
++ udelay(1000);
++
+ err = mmc_sd_switch(card, 1, 0, 1, status);
+ if (err)
+ goto out;
+--- a/drivers/mmc/host/mvsdio.c
++++ b/drivers/mmc/host/mvsdio.c
+@@ -620,9 +620,11 @@ static void mvsd_set_ios(struct mmc_host
+ if (ios->bus_width == MMC_BUS_WIDTH_4)
+ ctrl_reg |= MVSD_HOST_CTRL_DATA_WIDTH_4_BITS;
+
++#if 0
+ if (ios->timing == MMC_TIMING_MMC_HS ||
+ ios->timing == MMC_TIMING_SD_HS)
+ ctrl_reg |= MVSD_HOST_CTRL_HI_SPEED_EN;
++#endif
+
+ host->ctrl = ctrl_reg;
+ mvsd_write(MVSD_HOST_CTRL, ctrl_reg);
+--- a/drivers/mmc/core/core.c
++++ b/drivers/mmc/core/core.c
+@@ -286,9 +286,9 @@ void mmc_set_data_timeout(struct mmc_dat
+ * The limit is really 250 ms, but that is
+ * insufficient for some crappy cards.
+ */
+- limit_us = 300000;
++ limit_us = 500000;
+ else
+- limit_us = 100000;
++ limit_us = 200000;
+
+ /*
+ * SDHC cards always use these fixed values.