All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-Jacques Hiblot <jjhiblot@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [BUG] snow: mmc: SD card access broken: unable to select a mode
Date: Mon, 9 Apr 2018 17:18:31 +0200	[thread overview]
Message-ID: <ceb3031f-708d-1b3c-4da5-7218f6c87863@ti.com> (raw)
In-Reply-To: <8dab0156-5d2d-f2ac-8bbc-4e52f8597307@free.fr>



On 09/04/2018 16:46, Guillaume Gardet wrote:
>
>
> Le 09/04/2018 à 16:21, Jean-Jacques Hiblot a écrit :
>>
>>
>> On 09/04/2018 16:03, Guillaume Gardet wrote:
>>>
>>>
>>> Le 09/04/2018 à 15:58, Jean-Jacques Hiblot a écrit :
>>>>
>>>>
>>>> On 09/04/2018 14:02, Guillaume Gardet wrote:
>>>>> Hi Jaehoon,
>>>>>
>>>>> There are problems with SD card access on Samsung Chromebook 
>>>>> (snow) with latest master (and also 2018.05-rc1 and 2018.03).
>>>>>
>>>>> eMMC is ok, but SD card access leads to 'unable to select a mode' 
>>>>> problem. If I disable HS mode, I can access the SD card without 
>>>>> problem:
>>>>> ******************************************************************************** 
>>>>>
>>>>> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
>>>>> index 23f642980bf..28f4fa0f213 100644
>>>>> --- a/drivers/mmc/dw_mmc.c
>>>>> +++ b/drivers/mmc/dw_mmc.c
>>>>> @@ -508,7 +508,8 @@ void dwmci_setup_cfg(struct mmc_config *cfg, 
>>>>> struct dwmci_host *host,
>>>>>          cfg->host_caps |= MMC_MODE_4BIT;
>>>>>          cfg->host_caps &= ~MMC_MODE_8BIT;
>>>>>      }
>>>>> -    cfg->host_caps |= MMC_MODE_HS | MMC_MODE_HS_52MHz;
>>>>> +    /* Temp workaround for Chromebook snow to avoid the 'unable 
>>>>> to select a mode' error */
>>>>> +//     cfg->host_caps |= MMC_MODE_HS | MMC_MODE_HS_52MHz;
>>>>>
>>>>>      cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
>>>>>  }
>>>>> ******************************************************************************** 
>>>>>
>>>>>
>>>>> Once we try to select HS mode, all access to SD card result in 
>>>>> failure, even when trying to setup a lower frequency mode, 
>>>>> including SD legacy at 25 MHz.
>>>>>
>>>>> Any idea what is going? Maybe you have fixes pending?
>>>>
>>>> Can try with MMC_MODE_HS | MMC_MODE_HS_52MHz but with a lower 
>>>> max-frequency (<25MHz) ? It would be interesting to know if it 
>>>> could come from a frequency limitation.
>>>
>>> I already tried to change SD_HS freq (in mmc_mode2freq) from 
>>> 50000000 to 25000000 with no difference.
>>>
>>>> Is there some pad configuration to do when using higher frequency?
>>>
>>> I do not think so.
>> Can you enable the debug output and post a log ?
>
> Here is the log from u-boot built from u-boot-mmc (latest commit: 
> 21c2ac32b845)
> Yes, I have no serial, so I retyped the messages, so I hope there is 
> no typo:
> **********************************************************************
> selecting mode MMC legacy (freq : 0 MHz)
> selecting mode MMC legacy (freq : 25 MHz)
> sd card: widths [4, 1] modes [SD Legacy, SD High SPeed (50MHz)]
> host: widths [4, 1] modes [MMC legacy, SD Legacy, MMC High Speed 
> (26MHz), SD High Speed (50MHz), MMC High Speed (52MHz), MMC DDR52 
> (52MHz)]
> trying mode SD High Speed (50MHz) width 4 (at 50 MHz)
> selecting mode SD High Speed (50 MHz) (freq : 50 MHz)
> unable to read ssr
> selecting mode SD Legacy (25 MHz) (freq : 25 MHz)
> trying mode SD High Speed (50MHz) width 1 (at 50 MHz)
So it fails either in sd_select_bus_width() or sd_set_card_speed()
Can you try to limit the bus width to 1 ? Does it fail also at 50 MHz ?

> selecting mode SD Legacy (25 MHz) (freq : 25 MHz)
> trying mode SD Legacy (25MHz) width 4 (at 25 MHz)
> selecting mode SD Legacy (25 MHz) (freq : 25 MHz)
> trying mode SD Legacy (25MHz) width 1 (at 25 MHz)
> selecting mode SD Legacy (25 MHz) (freq : 25 MHz)
> unable to select a mode
> mmc_init: -524, time 127
> ** Bad device mmc 1 **
> **********************************************************************
>
> Note that eMMC (on mmc 0) is working fine with MMC DDR52 (52MHz).
>
> Guillaume
>

  reply	other threads:[~2018-04-09 15:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-09 12:02 [U-Boot] [BUG] snow: mmc: SD card access broken: unable to select a mode Guillaume Gardet
2018-04-09 13:58 ` Jean-Jacques Hiblot
2018-04-09 14:03   ` Guillaume Gardet
2018-04-09 14:21     ` Jean-Jacques Hiblot
2018-04-09 14:46       ` Guillaume Gardet
2018-04-09 15:18         ` Jean-Jacques Hiblot [this message]
2018-04-09 16:02           ` Guillaume Gardet
2018-04-09 16:29             ` Guillaume Gardet
2018-04-10  5:24               ` Anand Moon
     [not found] ` <CGME20180426103106epcas1p106acee25ea8ae693cebe1d14f46c6ba9@epcas1p1.samsung.com>
2018-04-26 10:31   ` [U-Boot] [U-Boot, BUG] " Jaehoon Chung
2018-04-26 13:15     ` Guillaume Gardet
2018-05-16  7:22       ` Guillaume Gardet
2018-10-15 12:12         ` Guillaume Gardet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ceb3031f-708d-1b3c-4da5-7218f6c87863@ti.com \
    --to=jjhiblot@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.