diff mbox

mmc: Adjust timings for power ramping up

Message ID 20120813161921.GA5022@x230 (mailing list archive)
State New, archived
Headers show

Commit Message

Dmitry Rozhkov Aug. 13, 2012, 4:19 p.m. UTC
According to p6.4.1.1 of the Physical Layer Simplified Specification
Ver3.01 the "host needs to keep power line level less than 0.5V and
more than 1ms before power ramp up". This patch adds an explicit delay
of 10ms just before power rump up.

Without this patch some microSD cards (e.g. Kingston 8G Class 10) can't be
used as bootable media on some TI OMAP chips at least.
See https://bugs.nemomobile.org/show_bug.cgi?id=92 for details.

Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@jollamobile.com>
---
 drivers/mmc/core/core.c |    7 +++++++
 1 file changed, 7 insertions(+)

Comments

Girish K S Aug. 14, 2012, 1:58 p.m. UTC | #1
On 13 August 2012 11:19, Dmitry Rozhkov <dmitry.rozhkov@jollamobile.com> wrote:
> According to p6.4.1.1 of the Physical Layer Simplified Specification
> Ver3.01 the "host needs to keep power line level less than 0.5V and
> more than 1ms before power ramp up". This patch adds an explicit delay
> of 10ms just before power rump up.
>
> Without this patch some microSD cards (e.g. Kingston 8G Class 10) can't be
> used as bootable media on some TI OMAP chips at least.
> See https://bugs.nemomobile.org/show_bug.cgi?id=92 for details.
>
> Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@jollamobile.com>
> ---
>  drivers/mmc/core/core.c |    7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 0b6141d..22b0eb2 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -1163,6 +1163,13 @@ static void mmc_power_up(struct mmc_host *host)
>
>         mmc_host_clk_hold(host);
>
> +       /*
> +        * According to p6.4.1.1 of the Physical Layer Simplified Specification
> +        * Ver3.01 the "host needs to keep power line level less than 0.5V and
> +        * more than 1ms before power ramp up".
> +        */
> +       mmc_delay(10);
can you instead just try giving this delay in mmc_start_host as a
parameter to mmc_detect_change.
> +
>         /* If ocr is set, we use it */
>         if (host->ocr)
>                 bit = ffs(host->ocr) - 1;
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Dmitry Rozhkov Aug. 14, 2012, 3:59 p.m. UTC | #2
On 08/14/2012 04:58 PM, Girish K S wrote:
> On 13 August 2012 11:19, Dmitry Rozhkov <dmitry.rozhkov@jollamobile.com> wrote:
>> According to p6.4.1.1 of the Physical Layer Simplified Specification
>> Ver3.01 the "host needs to keep power line level less than 0.5V and
>> more than 1ms before power ramp up". This patch adds an explicit delay
>> of 10ms just before power rump up.
>>
>> Without this patch some microSD cards (e.g. Kingston 8G Class 10) can't be
>> used as bootable media on some TI OMAP chips at least.
>> See https://bugs.nemomobile.org/show_bug.cgi?id=92 for details.
>>
>> Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@jollamobile.com>
>> ---
>>   drivers/mmc/core/core.c |    7 +++++++
>>   1 file changed, 7 insertions(+)
>>
>> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
>> index 0b6141d..22b0eb2 100644
>> --- a/drivers/mmc/core/core.c
>> +++ b/drivers/mmc/core/core.c
>> @@ -1163,6 +1163,13 @@ static void mmc_power_up(struct mmc_host *host)
>>
>>          mmc_host_clk_hold(host);
>>
>> +       /*
>> +        * According to p6.4.1.1 of the Physical Layer Simplified Specification
>> +        * Ver3.01 the "host needs to keep power line level less than 0.5V and
>> +        * more than 1ms before power ramp up".
>> +        */
>> +       mmc_delay(10);
> can you instead just try giving this delay in mmc_start_host as a
> parameter to mmc_detect_change.
It would be too late. Here is the theory.

The function mmc_power_up currently controls the process of powering up 
as a two-phases process:

0V (initial state) => apply MMC_POWER_UP => delay 10ms until Vdd is 
reached  (first phase) => apply MMC_POWER_ON => delay 10ms for 
initialization sequence to complete (second phase).

It perfectly conforms to the spec V2.00

But the spec V3.01 clarifies now that the process consists of three 
phases actually:
1. keeping reset level voltage (>1ms)
2. power ramp up phase (from 0.1ms to 35ms)
3. initialization sequence (1ms)

See the figure 6-2 on the page 111.

If I add the delay as a parameter to mmc_detect_change in mmc_start_host 
it'd be equal to extending the third phase to 20ms though even 10ms is 
more than enough.

The second things is that it's better to keep this sequence in one 
function for the sake of maintainability.

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 0b6141d..22b0eb2 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1163,6 +1163,13 @@  static void mmc_power_up(struct mmc_host *host)
 
 	mmc_host_clk_hold(host);
 
+	/*
+	 * According to p6.4.1.1 of the Physical Layer Simplified Specification
+	 * Ver3.01 the "host needs to keep power line level less than 0.5V and
+	 * more than 1ms before power ramp up".
+	 */
+	mmc_delay(10);
+
 	/* If ocr is set, we use it */
 	if (host->ocr)
 		bit = ffs(host->ocr) - 1;