[U-Boot] [PATCH v2 07/11] mmc: use the generic timeout for cmd6 (SWITCH) provided in the ext_csd

Jean-Jacques Hiblot jjhiblot at ti.com
Wed Jul 10 08:00:13 UTC 2019


Hi Peng,

On 10/07/2019 07:51, Peng Fan wrote:
> Hi Jean,
>
>> -----Original Message-----
>> From: Jean-Jacques Hiblot [mailto:jjhiblot at ti.com]
>> Sent: 2019年7月2日 16:54
>> To: marek.vasut at gmail.com
>> Cc: Jean-Jacques Hiblot <jjhiblot at ti.com>; Jon Nettleton
>> <jon at solid-run.com>; Peng Fan <peng.fan at nxp.com>; Marek Vasut
>> <marek.vasut+renesas at gmail.com>; u-boot at lists.denx.de; Baruch Siach
>> <baruch at tkos.co.il>; Jens Wiklander <jens.wiklander at linaro.org>; Rajesh
>> Bhagat <rajesh.bhagat at nxp.com>
>> Subject: [PATCH v2 07/11] mmc: use the generic timeout for cmd6 (SWITCH)
>> provided in the ext_csd
>>
>> Starting with rev 4.5, the eMMC can define a generic timeout for the SWITCH
>> command.
>>
>> Signed-off-by: Jean-Jacques Hiblot <jjhiblot at ti.com>
>> ---
>>
>> Changes in v2: None
>>
>>   drivers/mmc/mmc.c | 10 +++++++++-
>>   include/mmc.h     |  2 ++
>>   2 files changed, 11 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index
>> a61e311cca..ff56c3dd67 100644
>> --- a/drivers/mmc/mmc.c
>> +++ b/drivers/mmc/mmc.c
>> @@ -21,6 +21,8 @@
>>   #include <div64.h>
>>   #include "mmc_private.h"
>>
>> +#define DEFAULT_CMD6_TIMEOUT_MS  500
>> +
>>   static int mmc_set_signal_voltage(struct mmc *mmc, uint signal_voltage);
>> static int mmc_power_cycle(struct mmc *mmc);
>> #if !CONFIG_IS_ENABLED(MMC_TINY) @@ -745,10 +747,13 @@ static int
>> __mmc_switch(struct mmc *mmc, u8 set, u8 index, u8 value,
>>   			bool send_status)
>>   {
>>   	struct mmc_cmd cmd;
>> -	int timeout = 1000;
>> +	int timeout = DEFAULT_CMD6_TIMEOUT_MS;
> Is this expected to change 1000->500?

Yes. The 500ms timeout value directly comes from the linux driver.

>
> Regards,
> Peng.
>
>>   	int retries = 3;
>>   	int ret;
>


More information about the U-Boot mailing list