All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] mmc1 not working on Samsung snow chromebook
       [not found] <b80237e1-85e3-d327-6f0a-6277e1ecd251@free.fr>
@ 2017-11-15 10:22 ` Guillaume Gardet
  2017-11-15 10:27   ` Guillaume Gardet
  0 siblings, 1 reply; 12+ messages in thread
From: Guillaume Gardet @ 2017-11-15 10:22 UTC (permalink / raw)
  To: u-boot

Forgot to Cc ML. Done now.


Le 15/11/2017 à 11:14, Guillaume Gardet a écrit :
> Hello,
>
> I tested U-Boot v2017.09 on a Samsung Snow (Chromebook ARM) and while mmc0 (internal eMMC) is working fine, mmc1 (external SD slot) does not work.
> I get the following error for 'mmc dev 1' command:
>     mmc_init: -110, time 30
>
> Any idea what could be wrong?
>
> Guillaume
>
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] mmc1 not working on Samsung snow chromebook
  2017-11-15 10:22 ` [U-Boot] mmc1 not working on Samsung snow chromebook Guillaume Gardet
@ 2017-11-15 10:27   ` Guillaume Gardet
  2017-11-16 12:29     ` Guillaume Gardet
  0 siblings, 1 reply; 12+ messages in thread
From: Guillaume Gardet @ 2017-11-15 10:27 UTC (permalink / raw)
  To: u-boot



Le 15/11/2017 à 11:22, Guillaume Gardet a écrit :
> Forgot to Cc ML. Done now.
>
>
> Le 15/11/2017 à 11:14, Guillaume Gardet a écrit :
>> Hello,
>>
>> I tested U-Boot v2017.09 on a Samsung Snow (Chromebook ARM) and while mmc0 (internal eMMC) is working fine, mmc1 (external SD slot) does not work.
>> I get the following error for 'mmc dev 1' command:
>>     mmc_init: -110, time 30

Please also note that on boot (or on 1st 'mmc dev 1' cmd if I stop auto-boot), I firstly get:
     mmc_init: -5, time 39

Then, all next attempts retruns:
     mmc_init: -110, time 30


Guillaume


>>
>> Any idea what could be wrong?
>>
>> Guillaume
>>
>>
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] mmc1 not working on Samsung snow chromebook
  2017-11-15 10:27   ` Guillaume Gardet
@ 2017-11-16 12:29     ` Guillaume Gardet
  2017-11-17  9:36       ` Lukasz Majewski
  2017-11-17  9:48       ` Jaehoon Chung
  0 siblings, 2 replies; 12+ messages in thread
From: Guillaume Gardet @ 2017-11-16 12:29 UTC (permalink / raw)
  To: u-boot

I found a workaround. If I disable MMC_MODE_HS_52MHz, then it is working fine.

I guess there is a better way to implement the following patch ?

**********************************************************************
diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
index 23f642980b..a6a0934eef 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;
+       /* MMC_MODE_HS_52MHz is broken (at least) on Samsung Snow, so disbale it for now */
+       cfg->host_caps |= MMC_MODE_HS;

         cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
  }
**********************************************************************


Guillaume



Le 15/11/2017 à 11:27, Guillaume Gardet a écrit :
>
>
> Le 15/11/2017 à 11:22, Guillaume Gardet a écrit :
>> Forgot to Cc ML. Done now.
>>
>>
>> Le 15/11/2017 à 11:14, Guillaume Gardet a écrit :
>>> Hello,
>>>
>>> I tested U-Boot v2017.09 on a Samsung Snow (Chromebook ARM) and while mmc0 (internal eMMC) is working fine, mmc1 (external SD slot) does not work.
>>> I get the following error for 'mmc dev 1' command:
>>>     mmc_init: -110, time 30
>
> Please also note that on boot (or on 1st 'mmc dev 1' cmd if I stop auto-boot), I firstly get:
>     mmc_init: -5, time 39
>
> Then, all next attempts retruns:
>     mmc_init: -110, time 30
>
>
> Guillaume
>
>
>>>
>>> Any idea what could be wrong?
>>>
>>> Guillaume
>>>
>>>
>>
>

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [U-Boot] mmc1 not working on Samsung snow chromebook
  2017-11-16 12:29     ` Guillaume Gardet
@ 2017-11-17  9:36       ` Lukasz Majewski
  2017-11-17  9:38         ` Guillaume Gardet
  2017-11-17  9:48       ` Jaehoon Chung
  1 sibling, 1 reply; 12+ messages in thread
From: Lukasz Majewski @ 2017-11-17  9:36 UTC (permalink / raw)
  To: u-boot

On Thu, 16 Nov 2017 13:29:56 +0100
Guillaume Gardet <guillaume.gardet@free.fr> wrote:

> I found a workaround. If I disable MMC_MODE_HS_52MHz, then it is
> working fine.
> 
> I guess there is a better way to implement the following patch ?
> 
> **********************************************************************
> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
> index 23f642980b..a6a0934eef 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;
> +       /* MMC_MODE_HS_52MHz is broken (at least) on Samsung Snow, so
> disbale it for now */
> +       cfg->host_caps |= MMC_MODE_HS;

This seems like a workaround. The root cause of the problem is the
regression with HS 52MHz....

> 
>          cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
>   }
> **********************************************************************
> 
> 
> Guillaume
> 
> 
> 
> Le 15/11/2017 à 11:27, Guillaume Gardet a écrit :
> >
> >
> > Le 15/11/2017 à 11:22, Guillaume Gardet a écrit :  
> >> Forgot to Cc ML. Done now.
> >>
> >>
> >> Le 15/11/2017 à 11:14, Guillaume Gardet a écrit :  
> >>> Hello,
> >>>
> >>> I tested U-Boot v2017.09 on a Samsung Snow (Chromebook ARM) and
> >>> while mmc0 (internal eMMC) is working fine, mmc1 (external SD
> >>> slot) does not work. I get the following error for 'mmc dev 1'
> >>> command: mmc_init: -110, time 30  
> >
> > Please also note that on boot (or on 1st 'mmc dev 1' cmd if I stop
> > auto-boot), I firstly get: mmc_init: -5, time 39
> >
> > Then, all next attempts retruns:
> >     mmc_init: -110, time 30
> >
> >
> > Guillaume
> >
> >  
> >>>
> >>> Any idea what could be wrong?
> >>>
> >>> Guillaume
> >>>
> >>>  
> >>  
> >  
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171117/9841f9dd/attachment.sig>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] mmc1 not working on Samsung snow chromebook
  2017-11-17  9:36       ` Lukasz Majewski
@ 2017-11-17  9:38         ` Guillaume Gardet
  2017-11-17 16:06           ` Jaehoon Chung
  0 siblings, 1 reply; 12+ messages in thread
From: Guillaume Gardet @ 2017-11-17  9:38 UTC (permalink / raw)
  To: u-boot



Le 17/11/2017 à 10:36, Lukasz Majewski a écrit :
> On Thu, 16 Nov 2017 13:29:56 +0100
> Guillaume Gardet <guillaume.gardet@free.fr> wrote:
>
>> I found a workaround. If I disable MMC_MODE_HS_52MHz, then it is
>> working fine.
>>
>> I guess there is a better way to implement the following patch ?
>>
>> **********************************************************************
>> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
>> index 23f642980b..a6a0934eef 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;
>> +       /* MMC_MODE_HS_52MHz is broken (at least) on Samsung Snow, so
>> disbale it for now */
>> +       cfg->host_caps |= MMC_MODE_HS;
> This seems like a workaround. The root cause of the problem is the
> regression with HS 52MHz....

Not sure it ever worked on this target.

Guillaume

>
>>           cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
>>    }
>> **********************************************************************
>>
>>
>> Guillaume
>>
>>
>>
>> Le 15/11/2017 à 11:27, Guillaume Gardet a écrit :
>>>
>>> Le 15/11/2017 à 11:22, Guillaume Gardet a écrit :
>>>> Forgot to Cc ML. Done now.
>>>>
>>>>
>>>> Le 15/11/2017 à 11:14, Guillaume Gardet a écrit :
>>>>> Hello,
>>>>>
>>>>> I tested U-Boot v2017.09 on a Samsung Snow (Chromebook ARM) and
>>>>> while mmc0 (internal eMMC) is working fine, mmc1 (external SD
>>>>> slot) does not work. I get the following error for 'mmc dev 1'
>>>>> command: mmc_init: -110, time 30
>>> Please also note that on boot (or on 1st 'mmc dev 1' cmd if I stop
>>> auto-boot), I firstly get: mmc_init: -5, time 39
>>>
>>> Then, all next attempts retruns:
>>>      mmc_init: -110, time 30
>>>
>>>
>>> Guillaume
>>>
>>>   
>>>>> Any idea what could be wrong?
>>>>>
>>>>> Guillaume
>>>>>
>>>>>   
>>>>   
>>>   
>> _______________________________________________
>> U-Boot mailing list
>> U-Boot at lists.denx.de
>> https://lists.denx.de/listinfo/u-boot
>
>
> Best regards,
>
> Lukasz Majewski
>
> --
>
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] mmc1 not working on Samsung snow chromebook
  2017-11-16 12:29     ` Guillaume Gardet
  2017-11-17  9:36       ` Lukasz Majewski
@ 2017-11-17  9:48       ` Jaehoon Chung
  2018-01-09 14:37         ` Guillaume Gardet
  1 sibling, 1 reply; 12+ messages in thread
From: Jaehoon Chung @ 2017-11-17  9:48 UTC (permalink / raw)
  To: u-boot

Hi,

On 2017년 11월 16일 21:29, Guillaume Gardet wrote:
> I found a workaround. If I disable MMC_MODE_HS_52MHz, then it is working fine.
> 
> I guess there is a better way to implement the following patch ?
> 
> **********************************************************************
> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
> index 23f642980b..a6a0934eef 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;
> +       /* MMC_MODE_HS_52MHz is broken (at least) on Samsung Snow, so disbale it for now */
> +       cfg->host_caps |= MMC_MODE_HS;

It means that card is running the lower clock frequency..it's not solution.
Timing issue and some problems should be fixed with lowest frequency.

Now, i can't test and check more detail. After back to my office or home, i will check what main cause.

Best Regards,
Jaehoon Chung

> 
>         cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
>  }
> **********************************************************************
> 
> 
> Guillaume
> 
> 
> 
> Le 15/11/2017 à 11:27, Guillaume Gardet a écrit :
>>
>>
>> Le 15/11/2017 à 11:22, Guillaume Gardet a écrit :
>>> Forgot to Cc ML. Done now.
>>>
>>>
>>> Le 15/11/2017 à 11:14, Guillaume Gardet a écrit :
>>>> Hello,
>>>>
>>>> I tested U-Boot v2017.09 on a Samsung Snow (Chromebook ARM) and while mmc0 (internal eMMC) is working fine, mmc1 (external SD slot) does not work.
>>>> I get the following error for 'mmc dev 1' command:
>>>>     mmc_init: -110, time 30
>>
>> Please also note that on boot (or on 1st 'mmc dev 1' cmd if I stop auto-boot), I firstly get:
>>     mmc_init: -5, time 39
>>
>> Then, all next attempts retruns:
>>     mmc_init: -110, time 30
>>
>>
>> Guillaume
>>
>>
>>>>
>>>> Any idea what could be wrong?
>>>>
>>>> Guillaume
>>>>
>>>>
>>>
>>
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] mmc1 not working on Samsung snow chromebook
  2017-11-17  9:38         ` Guillaume Gardet
@ 2017-11-17 16:06           ` Jaehoon Chung
  2017-11-18 16:33             ` Guillaume Gardet
  0 siblings, 1 reply; 12+ messages in thread
From: Jaehoon Chung @ 2017-11-17 16:06 UTC (permalink / raw)
  To: u-boot



On 2017년 11월 17일 18:38, Guillaume Gardet wrote:
> 
> 
> Le 17/11/2017 à 10:36, Lukasz Majewski a écrit :
>> On Thu, 16 Nov 2017 13:29:56 +0100
>> Guillaume Gardet <guillaume.gardet@free.fr> wrote:
>>
>>> I found a workaround. If I disable MMC_MODE_HS_52MHz, then it is
>>> working fine.
>>>
>>> I guess there is a better way to implement the following patch ?
>>>
>>> **********************************************************************
>>> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
>>> index 23f642980b..a6a0934eef 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;
>>> +       /* MMC_MODE_HS_52MHz is broken (at least) on Samsung Snow, so
>>> disbale it for now */
>>> +       cfg->host_caps |= MMC_MODE_HS;
>> This seems like a workaround. The root cause of the problem is the
>> regression with HS 52MHz....
> 
> Not sure it ever worked on this target.

Could you give me the debug log after enabled DEBUG?

Best Regards,
Jaehoon Chung

> 
> Guillaume
> 
>>
>>>           cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
>>>    }
>>> **********************************************************************
>>>
>>>
>>> Guillaume
>>>
>>>
>>>
>>> Le 15/11/2017 à 11:27, Guillaume Gardet a écrit :
>>>>
>>>> Le 15/11/2017 à 11:22, Guillaume Gardet a écrit :
>>>>> Forgot to Cc ML. Done now.
>>>>>
>>>>>
>>>>> Le 15/11/2017 à 11:14, Guillaume Gardet a écrit :
>>>>>> Hello,
>>>>>>
>>>>>> I tested U-Boot v2017.09 on a Samsung Snow (Chromebook ARM) and
>>>>>> while mmc0 (internal eMMC) is working fine, mmc1 (external SD
>>>>>> slot) does not work. I get the following error for 'mmc dev 1'
>>>>>> command: mmc_init: -110, time 30
>>>> Please also note that on boot (or on 1st 'mmc dev 1' cmd if I stop
>>>> auto-boot), I firstly get: mmc_init: -5, time 39
>>>>
>>>> Then, all next attempts retruns:
>>>>      mmc_init: -110, time 30
>>>>
>>>>
>>>> Guillaume
>>>>
>>>>  
>>>>>> Any idea what could be wrong?
>>>>>>
>>>>>> Guillaume
>>>>>>
>>>>>>   
>>>>>   
>>>>   
>>> _______________________________________________
>>> U-Boot mailing list
>>> U-Boot at lists.denx.de
>>> https://lists.denx.de/listinfo/u-boot
>>
>>
>> Best regards,
>>
>> Lukasz Majewski
>>
>> -- 
>>
>> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
>> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
>> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] mmc1 not working on Samsung snow chromebook
  2017-11-17 16:06           ` Jaehoon Chung
@ 2017-11-18 16:33             ` Guillaume Gardet
  2017-12-01 12:42               ` Guillaume Gardet
  0 siblings, 1 reply; 12+ messages in thread
From: Guillaume Gardet @ 2017-11-18 16:33 UTC (permalink / raw)
  To: u-boot



Le 17/11/2017 à 17:06, Jaehoon Chung a écrit :
>
> On 2017년 11월 17일 18:38, Guillaume Gardet wrote:
>>
>> Le 17/11/2017 à 10:36, Lukasz Majewski a écrit :
>>> On Thu, 16 Nov 2017 13:29:56 +0100
>>> Guillaume Gardet <guillaume.gardet@free.fr> wrote:
>>>
>>>> I found a workaround. If I disable MMC_MODE_HS_52MHz, then it is
>>>> working fine.
>>>>
>>>> I guess there is a better way to implement the following patch ?
>>>>
>>>> **********************************************************************
>>>> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
>>>> index 23f642980b..a6a0934eef 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;
>>>> +       /* MMC_MODE_HS_52MHz is broken (at least) on Samsung Snow, so
>>>> disbale it for now */
>>>> +       cfg->host_caps |= MMC_MODE_HS;
>>> This seems like a workaround. The root cause of the problem is the
>>> regression with HS 52MHz....
>> Not sure it ever worked on this target.
> Could you give me the debug log after enabled DEBUG?

WIth debug in mmc.c and dw_mmc.c on the broken system, I have:
Buswidth = 1, clock: 0
Buswidth = 1, clock: 400000
Sending CMD0
Sending CMD8
Sending CMD55
Sending CMD41
Sending CMD55
Sending CMD41
Sending CMD55
Sending CMD41
Sending CMD55
Sending CMD41
Sending CMD55
Sending CMD41
Sending CMD55
Sending CMD41
Sending CMD2
Sending CMD3
Sending CMD9
Sending CMD7
Sending CMD55
Sending CMD51
Sending CMD6
Sending CMD6
Sending CMD55
dwmci_send_cmd: Response Error.
mmc_init: -5, time 78


WIth debug in mmc.c and dw_mmc.c with my workaround, I have:
Buswidth = 1, clock: 0
Buswidth = 1, clock: 400000
Sending CMD0
Sending CMD8
Sending CMD55
Sending CMD41
Sending CMD55
Sending CMD41
Sending CMD55
Sending CMD41
Sending CMD55
Sending CMD41
Sending CMD55
Sending CMD41
Sending CMD55
Sending CMD41
Sending CMD2
Sending CMD3
Sending CMD9
Sending CMD7
Sending CMD55
Sending CMD51
Sending CMD6
Sending CMD55
Sending CMD6
Buswidth = 4, clock: 400000
Sending CMD55
Sending CMD13
Buswidth = 4, clock: 25000000
Sending CMD16
Sending CMD17
switch to partitions #0, OK
mmc1 is current device

The problem occurs in 'sd_change_freq' function when if we try to set high speed with the 2nd call to  'sd_switch' (1st call is just a check).


Guillaume


>
> Best Regards,
> Jaehoon Chung
>
>> Guillaume
>>
>>>>            cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
>>>>     }
>>>> **********************************************************************
>>>>
>>>>
>>>> Guillaume
>>>>
>>>>
>>>>
>>>> Le 15/11/2017 à 11:27, Guillaume Gardet a écrit :
>>>>> Le 15/11/2017 à 11:22, Guillaume Gardet a écrit :
>>>>>> Forgot to Cc ML. Done now.
>>>>>>
>>>>>>
>>>>>> Le 15/11/2017 à 11:14, Guillaume Gardet a écrit :
>>>>>>> Hello,
>>>>>>>
>>>>>>> I tested U-Boot v2017.09 on a Samsung Snow (Chromebook ARM) and
>>>>>>> while mmc0 (internal eMMC) is working fine, mmc1 (external SD
>>>>>>> slot) does not work. I get the following error for 'mmc dev 1'
>>>>>>> command: mmc_init: -110, time 30
>>>>> Please also note that on boot (or on 1st 'mmc dev 1' cmd if I stop
>>>>> auto-boot), I firstly get: mmc_init: -5, time 39
>>>>>
>>>>> Then, all next attempts retruns:
>>>>>       mmc_init: -110, time 30
>>>>>
>>>>>
>>>>> Guillaume
>>>>>
>>>>>   
>>>>>>> Any idea what could be wrong?
>>>>>>>
>>>>>>> Guillaume
>>>>>>>
>>>>>>>    
>>>>>>    
>>>>>    
>>>> _______________________________________________
>>>> U-Boot mailing list
>>>> U-Boot at lists.denx.de
>>>> https://lists.denx.de/listinfo/u-boot
>>>
>>> Best regards,
>>>
>>> Lukasz Majewski
>>>
>>> -- 
>>>
>>> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
>>> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
>>> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
>> _______________________________________________
>> U-Boot mailing list
>> U-Boot at lists.denx.de
>> https://lists.denx.de/listinfo/u-boot

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] mmc1 not working on Samsung snow chromebook
  2017-11-18 16:33             ` Guillaume Gardet
@ 2017-12-01 12:42               ` Guillaume Gardet
  0 siblings, 0 replies; 12+ messages in thread
From: Guillaume Gardet @ 2017-12-01 12:42 UTC (permalink / raw)
  To: u-boot



Le 18/11/2017 à 17:33, Guillaume Gardet a écrit :
>
>
> Le 17/11/2017 à 17:06, Jaehoon Chung a écrit :
>>
>> On 2017년 11월 17일 18:38, Guillaume Gardet wrote:
>>>
>>> Le 17/11/2017 à 10:36, Lukasz Majewski a écrit :
>>>> On Thu, 16 Nov 2017 13:29:56 +0100
>>>> Guillaume Gardet <guillaume.gardet@free.fr> wrote:
>>>>
>>>>> I found a workaround. If I disable MMC_MODE_HS_52MHz, then it is
>>>>> working fine.
>>>>>
>>>>> I guess there is a better way to implement the following patch ?
>>>>>
>>>>> **********************************************************************
>>>>> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
>>>>> index 23f642980b..a6a0934eef 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;
>>>>> +       /* MMC_MODE_HS_52MHz is broken (at least) on Samsung Snow, so
>>>>> disbale it for now */
>>>>> +       cfg->host_caps |= MMC_MODE_HS;
>>>> This seems like a workaround. The root cause of the problem is the
>>>> regression with HS 52MHz....
>>> Not sure it ever worked on this target.
>> Could you give me the debug log after enabled DEBUG?
>
> WIth debug in mmc.c and dw_mmc.c on the broken system, I have:
> Buswidth = 1, clock: 0
> Buswidth = 1, clock: 400000
> Sending CMD0
> Sending CMD8
> Sending CMD55
> Sending CMD41
> Sending CMD55
> Sending CMD41
> Sending CMD55
> Sending CMD41
> Sending CMD55
> Sending CMD41
> Sending CMD55
> Sending CMD41
> Sending CMD55
> Sending CMD41
> Sending CMD2
> Sending CMD3
> Sending CMD9
> Sending CMD7
> Sending CMD55
> Sending CMD51
> Sending CMD6
> Sending CMD6
> Sending CMD55
> dwmci_send_cmd: Response Error.
> mmc_init: -5, time 78
>
>
> WIth debug in mmc.c and dw_mmc.c with my workaround, I have:
> Buswidth = 1, clock: 0
> Buswidth = 1, clock: 400000
> Sending CMD0
> Sending CMD8
> Sending CMD55
> Sending CMD41
> Sending CMD55
> Sending CMD41
> Sending CMD55
> Sending CMD41
> Sending CMD55
> Sending CMD41
> Sending CMD55
> Sending CMD41
> Sending CMD55
> Sending CMD41
> Sending CMD2
> Sending CMD3
> Sending CMD9
> Sending CMD7
> Sending CMD55
> Sending CMD51
> Sending CMD6
> Sending CMD55
> Sending CMD6
> Buswidth = 4, clock: 400000
> Sending CMD55
> Sending CMD13
> Buswidth = 4, clock: 25000000
> Sending CMD16
> Sending CMD17
> switch to partitions #0, OK
> mmc1 is current device
>
> The problem occurs in 'sd_change_freq' function when if we try to set high speed with the 2nd call to  'sd_switch' (1st call is just a check).

Any progress on this problem?

Guillaume


>
>
> Guillaume
>
>
>>
>> Best Regards,
>> Jaehoon Chung
>>
>>> Guillaume
>>>
>>>>>            cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
>>>>>     }
>>>>> **********************************************************************
>>>>>
>>>>>
>>>>> Guillaume
>>>>>
>>>>>
>>>>>
>>>>> Le 15/11/2017 à 11:27, Guillaume Gardet a écrit :
>>>>>> Le 15/11/2017 à 11:22, Guillaume Gardet a écrit :
>>>>>>> Forgot to Cc ML. Done now.
>>>>>>>
>>>>>>>
>>>>>>> Le 15/11/2017 à 11:14, Guillaume Gardet a écrit :
>>>>>>>> Hello,
>>>>>>>>
>>>>>>>> I tested U-Boot v2017.09 on a Samsung Snow (Chromebook ARM) and
>>>>>>>> while mmc0 (internal eMMC) is working fine, mmc1 (external SD
>>>>>>>> slot) does not work. I get the following error for 'mmc dev 1'
>>>>>>>> command: mmc_init: -110, time 30
>>>>>> Please also note that on boot (or on 1st 'mmc dev 1' cmd if I stop
>>>>>> auto-boot), I firstly get: mmc_init: -5, time 39
>>>>>>
>>>>>> Then, all next attempts retruns:
>>>>>>       mmc_init: -110, time 30
>>>>>>
>>>>>>
>>>>>> Guillaume
>>>>>>
>>>>>>>> Any idea what could be wrong?
>>>>>>>>
>>>>>>>> Guillaume
>>>>>>>>
>>>>> _______________________________________________
>>>>> U-Boot mailing list
>>>>> U-Boot at lists.denx.de
>>>>> https://lists.denx.de/listinfo/u-boot
>>>>
>>>> Best regards,
>>>>
>>>> Lukasz Majewski
>>>>
>>>> -- 
>>>>
>>>> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
>>>> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
>>>> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
>>> _______________________________________________
>>> U-Boot mailing list
>>> U-Boot at lists.denx.de
>>> https://lists.denx.de/listinfo/u-boot
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] mmc1 not working on Samsung snow chromebook
  2017-11-17  9:48       ` Jaehoon Chung
@ 2018-01-09 14:37         ` Guillaume Gardet
  2018-01-17 10:05           ` Jaehoon Chung
  0 siblings, 1 reply; 12+ messages in thread
From: Guillaume Gardet @ 2018-01-09 14:37 UTC (permalink / raw)
  To: u-boot

Hi,


Le 17/11/2017 à 10:48, Jaehoon Chung a écrit :
> Hi,
>
> On 2017년 11월 16일 21:29, Guillaume Gardet wrote:
>> I found a workaround. If I disable MMC_MODE_HS_52MHz, then it is working fine.
>>
>> I guess there is a better way to implement the following patch ?
>>
>> **********************************************************************
>> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
>> index 23f642980b..a6a0934eef 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;
>> +       /* MMC_MODE_HS_52MHz is broken (at least) on Samsung Snow, so disbale it for now */
>> +       cfg->host_caps |= MMC_MODE_HS;
> It means that card is running the lower clock frequency..it's not solution.
> Timing issue and some problems should be fixed with lowest frequency.
>
> Now, i can't test and check more detail. After back to my office or home, i will check what main cause.

Any progress on this topic ?

Guillaume

>
> Best Regards,
> Jaehoon Chung
>
>>          cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
>>   }
>> **********************************************************************
>>
>>
>> Guillaume
>>
>>
>>
>> Le 15/11/2017 à 11:27, Guillaume Gardet a écrit :
>>>
>>> Le 15/11/2017 à 11:22, Guillaume Gardet a écrit :
>>>> Forgot to Cc ML. Done now.
>>>>
>>>>
>>>> Le 15/11/2017 à 11:14, Guillaume Gardet a écrit :
>>>>> Hello,
>>>>>
>>>>> I tested U-Boot v2017.09 on a Samsung Snow (Chromebook ARM) and while mmc0 (internal eMMC) is working fine, mmc1 (external SD slot) does not work.
>>>>> I get the following error for 'mmc dev 1' command:
>>>>>      mmc_init: -110, time 30
>>> Please also note that on boot (or on 1st 'mmc dev 1' cmd if I stop auto-boot), I firstly get:
>>>      mmc_init: -5, time 39
>>>
>>> Then, all next attempts retruns:
>>>      mmc_init: -110, time 30
>>>
>>>
>>> Guillaume
>>>
>>>
>>>>> Any idea what could be wrong?
>>>>>
>>>>> Guillaume
>>>>>
>>>>>
>> _______________________________________________
>> U-Boot mailing list
>> U-Boot at lists.denx.de
>> https://lists.denx.de/listinfo/u-boot

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] mmc1 not working on Samsung snow chromebook
  2018-01-09 14:37         ` Guillaume Gardet
@ 2018-01-17 10:05           ` Jaehoon Chung
  2018-01-18  9:05             ` Guillaume Gardet
  0 siblings, 1 reply; 12+ messages in thread
From: Jaehoon Chung @ 2018-01-17 10:05 UTC (permalink / raw)
  To: u-boot

Hi Guillaume,

On 01/09/2018 11:37 PM, Guillaume Gardet wrote:
> Hi,
> 
> 
> Le 17/11/2017 à 10:48, Jaehoon Chung a écrit :
>> Hi,
>>
>> On 2017년 11월 16일 21:29, Guillaume Gardet wrote:
>>> I found a workaround. If I disable MMC_MODE_HS_52MHz, then it is working fine.
>>>
>>> I guess there is a better way to implement the following patch ?
>>>
>>> **********************************************************************
>>> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
>>> index 23f642980b..a6a0934eef 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;
>>> +       /* MMC_MODE_HS_52MHz is broken (at least) on Samsung Snow, so disbale it for now */
>>> +       cfg->host_caps |= MMC_MODE_HS;
>> It means that card is running the lower clock frequency..it's not solution.
>> Timing issue and some problems should be fixed with lowest frequency.
>>
>> Now, i can't test and check more detail. After back to my office or home, i will check what main cause.
> 
> Any progress on this topic ?

Sorry for late. It seems that is related with mmc_power_cycle().

commit 2e7410d76ad11856d09284c18d262d0bb2a3da0c
Author: Kishon Vijay Abraham I <kishon@ti.com>
Date:   Thu Sep 21 16:30:04 2017 +0200

    mmc: disable the mmc clock during power off
    
    There is no point in having the mmc clock enabled during
    power off. Disable the mmc clock. This is similar to how it's
    programmed in Linux Kernel.
    
    Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
    Signed-off-by: Vignesh R <vigneshr@ti.com>
    Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
    Reviewed-by: Simon Glass <sjg@chromium.org>

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 664b71affd..be68d8d930 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -1971,6 +1971,7 @@ static int mmc_power_on(struct mmc *mmc)
 
 static int mmc_power_off(struct mmc *mmc)
 {
+       mmc_set_clock(mmc, 1, true);
 #if CONFIG_IS_ENABLED(DM_MMC) && CONFIG_IS_ENABLED(DM_REGULATOR)
        if (mmc->vmmc_supply) {
                int ret = regulator_set_enable(mmc->vmmc_supply, false);

Current, I'm looking for fixing it.

Could you test with removing its code?

Best Regards,
Jaehoon Chung

> 
> Guillaume
> 
>>
>> Best Regards,
>> Jaehoon Chung
>>
>>>          cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
>>>   }
>>> **********************************************************************
>>>
>>>
>>> Guillaume
>>>
>>>
>>>
>>> Le 15/11/2017 à 11:27, Guillaume Gardet a écrit :
>>>>
>>>> Le 15/11/2017 à 11:22, Guillaume Gardet a écrit :
>>>>> Forgot to Cc ML. Done now.
>>>>>
>>>>>
>>>>> Le 15/11/2017 à 11:14, Guillaume Gardet a écrit :
>>>>>> Hello,
>>>>>>
>>>>>> I tested U-Boot v2017.09 on a Samsung Snow (Chromebook ARM) and while mmc0 (internal eMMC) is working fine, mmc1 (external SD slot) does not work.
>>>>>> I get the following error for 'mmc dev 1' command:
>>>>>>      mmc_init: -110, time 30
>>>> Please also note that on boot (or on 1st 'mmc dev 1' cmd if I stop auto-boot), I firstly get:
>>>>      mmc_init: -5, time 39
>>>>
>>>> Then, all next attempts retruns:
>>>>      mmc_init: -110, time 30
>>>>
>>>>
>>>> Guillaume
>>>>
>>>>
>>>>>> Any idea what could be wrong?
>>>>>>
>>>>>> Guillaume
>>>>>>
>>>>>>
>>> _______________________________________________
>>> U-Boot mailing list
>>> U-Boot at lists.denx.de
>>> https://lists.denx.de/listinfo/u-boot
> 
> 
> 
> 

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [U-Boot] mmc1 not working on Samsung snow chromebook
  2018-01-17 10:05           ` Jaehoon Chung
@ 2018-01-18  9:05             ` Guillaume Gardet
  0 siblings, 0 replies; 12+ messages in thread
From: Guillaume Gardet @ 2018-01-18  9:05 UTC (permalink / raw)
  To: u-boot

Hi,


Le 17/01/2018 à 11:05, Jaehoon Chung a écrit :
> Hi Guillaume,
>
> On 01/09/2018 11:37 PM, Guillaume Gardet wrote:
>> Hi,
>>
>>
>> Le 17/11/2017 à 10:48, Jaehoon Chung a écrit :
>>> Hi,
>>>
>>> On 2017년 11월 16일 21:29, Guillaume Gardet wrote:
>>>> I found a workaround. If I disable MMC_MODE_HS_52MHz, then it is working fine.
>>>>
>>>> I guess there is a better way to implement the following patch ?
>>>>
>>>> **********************************************************************
>>>> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
>>>> index 23f642980b..a6a0934eef 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;
>>>> +       /* MMC_MODE_HS_52MHz is broken (at least) on Samsung Snow, so disbale it for now */
>>>> +       cfg->host_caps |= MMC_MODE_HS;
>>> It means that card is running the lower clock frequency..it's not solution.
>>> Timing issue and some problems should be fixed with lowest frequency.
>>>
>>> Now, i can't test and check more detail. After back to my office or home, i will check what main cause.
>> Any progress on this topic ?
> Sorry for late. It seems that is related with mmc_power_cycle().
>
> commit 2e7410d76ad11856d09284c18d262d0bb2a3da0c
> Author: Kishon Vijay Abraham I <kishon@ti.com>
> Date:   Thu Sep 21 16:30:04 2017 +0200
>
>      mmc: disable the mmc clock during power off
>      
>      There is no point in having the mmc clock enabled during
>      power off. Disable the mmc clock. This is similar to how it's
>      programmed in Linux Kernel.
>      
>      Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
>      Signed-off-by: Vignesh R <vigneshr@ti.com>
>      Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
>      Reviewed-by: Simon Glass <sjg@chromium.org>
>
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index 664b71affd..be68d8d930 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -1971,6 +1971,7 @@ static int mmc_power_on(struct mmc *mmc)
>   
>   static int mmc_power_off(struct mmc *mmc)
>   {
> +       mmc_set_clock(mmc, 1, true);
>   #if CONFIG_IS_ENABLED(DM_MMC) && CONFIG_IS_ENABLED(DM_REGULATOR)
>          if (mmc->vmmc_supply) {
>                  int ret = regulator_set_enable(mmc->vmmc_supply, false);
>
> Current, I'm looking for fixing it.
>
> Could you test with removing its code?

As replied to your patch which fixes this commit, it fixed the MMC problem on snow.

Thanks a lot!


Guillaume

>
> Best Regards,
> Jaehoon Chung
>
>> Guillaume
>>
>>> Best Regards,
>>> Jaehoon Chung
>>>
>>>>           cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
>>>>    }
>>>> **********************************************************************
>>>>
>>>>
>>>> Guillaume
>>>>
>>>>
>>>>
>>>> Le 15/11/2017 à 11:27, Guillaume Gardet a écrit :
>>>>> Le 15/11/2017 à 11:22, Guillaume Gardet a écrit :
>>>>>> Forgot to Cc ML. Done now.
>>>>>>
>>>>>>
>>>>>> Le 15/11/2017 à 11:14, Guillaume Gardet a écrit :
>>>>>>> Hello,
>>>>>>>
>>>>>>> I tested U-Boot v2017.09 on a Samsung Snow (Chromebook ARM) and while mmc0 (internal eMMC) is working fine, mmc1 (external SD slot) does not work.
>>>>>>> I get the following error for 'mmc dev 1' command:
>>>>>>>       mmc_init: -110, time 30
>>>>> Please also note that on boot (or on 1st 'mmc dev 1' cmd if I stop auto-boot), I firstly get:
>>>>>       mmc_init: -5, time 39
>>>>>
>>>>> Then, all next attempts retruns:
>>>>>       mmc_init: -110, time 30
>>>>>
>>>>>
>>>>> Guillaume
>>>>>
>>>>>
>>>>>>> Any idea what could be wrong?
>>>>>>>
>>>>>>> Guillaume
>>>>>>>
>>>>>>>
>>>> _______________________________________________
>>>> U-Boot mailing list
>>>> U-Boot at lists.denx.de
>>>> https://lists.denx.de/listinfo/u-boot
>>
>>
>>
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-01-18  9:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <b80237e1-85e3-d327-6f0a-6277e1ecd251@free.fr>
2017-11-15 10:22 ` [U-Boot] mmc1 not working on Samsung snow chromebook Guillaume Gardet
2017-11-15 10:27   ` Guillaume Gardet
2017-11-16 12:29     ` Guillaume Gardet
2017-11-17  9:36       ` Lukasz Majewski
2017-11-17  9:38         ` Guillaume Gardet
2017-11-17 16:06           ` Jaehoon Chung
2017-11-18 16:33             ` Guillaume Gardet
2017-12-01 12:42               ` Guillaume Gardet
2017-11-17  9:48       ` Jaehoon Chung
2018-01-09 14:37         ` Guillaume Gardet
2018-01-17 10:05           ` Jaehoon Chung
2018-01-18  9:05             ` Guillaume Gardet

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.