linux-ti33x-psp 3.1: add dto patch to fix problems with various sd cards
[glsdk/meta-ti-glsdk.git] / recipes-bsp / u-boot / u-boot / 2011.12 / U-Boot-OMAP-MMC-Add-delay-before-waiting-for-status.patch
1 From patchwork Thu Dec 22 09:56:35 2011
2 Content-Type: text/plain; charset="utf-8"
3 MIME-Version: 1.0
4 Content-Transfer-Encoding: 8bit
5 Subject: [U-Boot] OMAP MMC: Add delay before waiting for status
6 Date: Wed, 21 Dec 2011 23:56:35 -0000
7 From: =?utf-8?q?Andreas_M=C3=BCller_=3Cschnitzeltony=40gmx=2Ede=3E?=
8 X-Patchwork-Id: 132795
9 Message-Id: <1324547795-19678-1-git-send-email-schnitzeltony@gmx.de>
10 To: u-boot@lists.denx.de
12 Loading kernel from MMC created the following error message reproducable:
14 | reading uImage
15 | mmc_send_cmd: timedout waiting for stat!
16 |
17 | 2860468 bytes read
19 Tested on overo with OMAP3530:
20 * OMAP3530-GP ES3.1, CPU-OPP2, L3-165MHz, Max CPU Clock 720 mHz
21   Die ID #470e000400000000040398d31402100c
22 * OMAP3530-GP ES3.1, CPU-OPP2, L3-165MHz, Max CPU Clock 600 mHz
23   Die ID #112000040000000004035c140101b011
25 Signed-off-by: Andreas Müller <schnitzeltony@gmx.de>
27 ---
28 drivers/mmc/omap_hsmmc.c |    4 ++++
29  1 files changed, 4 insertions(+), 0 deletions(-)
31 diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
32 index c38b9e6..ac91e5d 100644
33 --- a/drivers/mmc/omap_hsmmc.c
34 +++ b/drivers/mmc/omap_hsmmc.c
35 @@ -197,6 +197,10 @@ static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
36         unsigned int flags, mmc_stat;
37         ulong start;
38  
39 +       /* Delay added before checking the status */
40 +       if (cmd->cmdidx == MMC_CMD_SEND_STATUS)
41 +               udelay(1); /* wait 1 us */
42 +
43         start = get_timer(0);
44         while ((readl(&mmc_base->pstate) & DATI_MASK) == DATI_CMDDIS) {
45                 if (get_timer(0) - start > MAX_RETRY_MS) {