linux-kirkwood_2.6.29.2.bb : add kludge to allow SDHC cards to work
[vuplus_openembedded] / recipes / linux / linux-kirkwood / mvsdio.patch
1 Patch obtained from http://www.computingplugs.com/index.php/Fixing_SDHC_access_in_the_Orion/Mainline_kernel
2
3 --- a/drivers/mmc/host/mvsdio.c.orig    2009-04-14 20:51:48.000000000 +0000
4 +++ b/drivers/mmc/host/mvsdio.c 2009-04-19 15:58:42.261724324 +0000
5 @@ -21,6 +21,7 @@
6  #include <linux/irq.h>
7  #include <linux/gpio.h>
8  #include <linux/mmc/host.h>
9 +#include <linux/mmc/sd.h>
10  
11  #include <asm/sizes.h>
12  #include <asm/unaligned.h>
13 @@ -123,6 +124,7 @@
14  
15         dev_dbg(host->dev, "cmd %d (hw state 0x%04x)\n",
16                 cmd->opcode, mvsd_read(MVSD_HW_STATE));
17 +       if (cmd->opcode == SD_SWITCH) mdelay(1); /* Voodoo */
18  
19         cmdreg = MVSD_CMD_INDEX(cmd->opcode);
20  
21 @@ -620,9 +622,11 @@
22         if (ios->bus_width == MMC_BUS_WIDTH_4)
23                 ctrl_reg |= MVSD_HOST_CTRL_DATA_WIDTH_4_BITS;
24  
25 +#if 0
26         if (ios->timing == MMC_TIMING_MMC_HS ||
27             ios->timing == MMC_TIMING_SD_HS)
28                 ctrl_reg |= MVSD_HOST_CTRL_HI_SPEED_EN;
29 +#endif
30  
31         host->ctrl = ctrl_reg;
32         mvsd_write(MVSD_HOST_CTRL, ctrl_reg);
33 --- kernel/drivers/mmc/core/core.c.orig 2009-04-14 20:51:48.000000000 +0000
34 +++ kernel/drivers/mmc/core/core.c      2009-04-19 17:36:35.985746917 +0000
35 @@ -286,9 +286,9 @@
36                          * The limit is really 250 ms, but that is
37                          * insufficient for some crappy cards.
38                          */
39 -                       limit_us = 300000;
40 +                       limit_us = 500000;
41                 else
42 -                       limit_us = 100000;
43 +                       limit_us = 200000;
44  
45                 /*
46                  * SDHC cards always use these fixed values.