linux-kirkwood_2.6.29.2.bb : add kludge to allow SDHC cards to work
authorGraeme Gregory <dp@xora.org.uk>
Sat, 16 May 2009 17:12:31 +0000 (18:12 +0100)
committerGraeme Gregory <dp@xora.org.uk>
Sat, 16 May 2009 17:12:31 +0000 (18:12 +0100)
recipes/linux/linux-kirkwood/mvsdio.patch [new file with mode: 0644]
recipes/linux/linux-kirkwood_2.6.29.2.bb

diff --git a/recipes/linux/linux-kirkwood/mvsdio.patch b/recipes/linux/linux-kirkwood/mvsdio.patch
new file mode 100644 (file)
index 0000000..e4ba675
--- /dev/null
@@ -0,0 +1,46 @@
+Patch obtained from http://www.computingplugs.com/index.php/Fixing_SDHC_access_in_the_Orion/Mainline_kernel
+
+--- a/drivers/mmc/host/mvsdio.c.orig   2009-04-14 20:51:48.000000000 +0000
++++ b/drivers/mmc/host/mvsdio.c        2009-04-19 15:58:42.261724324 +0000
+@@ -21,6 +21,7 @@
+ #include <linux/irq.h>
+ #include <linux/gpio.h>
+ #include <linux/mmc/host.h>
++#include <linux/mmc/sd.h>
+ #include <asm/sizes.h>
+ #include <asm/unaligned.h>
+@@ -123,6 +124,7 @@
+       dev_dbg(host->dev, "cmd %d (hw state 0x%04x)\n",
+               cmd->opcode, mvsd_read(MVSD_HW_STATE));
++      if (cmd->opcode == SD_SWITCH) mdelay(1); /* Voodoo */
+       cmdreg = MVSD_CMD_INDEX(cmd->opcode);
+@@ -620,9 +622,11 @@
+       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);
+--- kernel/drivers/mmc/core/core.c.orig        2009-04-14 20:51:48.000000000 +0000
++++ kernel/drivers/mmc/core/core.c     2009-04-19 17:36:35.985746917 +0000
+@@ -286,9 +286,9 @@
+                        * 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.
index 0e34936..00cdb2b 100644 (file)
@@ -7,12 +7,14 @@ require linux.inc
 
 # Change MACHINE_KERNEL_PR in conf/machine/include/kirkwood.inc
 PV = "2.6.29.2"
+PR = "r2"
 PR_append = "+gitr${SRCREV}"
 #PV = "2.6.28+2.6.29rc7-${PR}+gitr${SRCREV}"
 
 SRCREV = "10a12868405319fbf114af2bde9789aa64c34144"
 SRC_URI = "git://git.marvell.com/orion.git;protocol=git;branch=stable-2.6.29 \
            file://fw.patch;patch=1 \
+           file://mvsdio.patch;patch=1 \
            file://defconfig \
                "