Re: [PATCH RESEND V4] mmc: core: HS200 mode support for eMMC 4.5

2011-11-23 Thread Girish K S
On 24 November 2011 11:43, Subhash Jadavani  wrote:
> Hi Girish,
>
>> -Original Message-
>> From: Girish K S [mailto:girish.shivananja...@linaro.org]
>> Sent: Monday, November 21, 2011 4:12 PM
>> To: Subhash Jadavani
>> Cc: linux-mmc@vger.kernel.org; c...@laptop.org; patc...@linaro.org;
>> linux-samsung-...@vger.kernel.org
>> Subject: Re: [PATCH RESEND V4] mmc: core: HS200 mode support for eMMC
>> 4.5
>>
>> On 19 November 2011 00:29, Subhash Jadavani 
>> wrote:
>> > Hi Girish,
>> >
>> >> -Original Message-
>> >> From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
>> >> ow...@vger.kernel.org] On Behalf Of Girish K S
>> >> Sent: Wednesday, October 26, 2011 10:30 AM
>> >> To: linux-mmc@vger.kernel.org
>> >> Cc: c...@laptop.org; patc...@linaro.org; linux-samsung-
>> >> s...@vger.kernel.org; Girish K S
>> >> Subject: [PATCH RESEND V4] mmc: core: HS200 mode support for eMMC
>> 4.5
>> >>
>> >> This patch adds the support of the HS200 bus speed for eMMC 4.5
>> >> devices.
>> >> The eMMC 4.5 devices have support for 200MHz bus speed.The mmc core
>> and
>> >> host modules have been touched to add support for this module.
>> >>
>> >> It is necessary to know the card type in the sdhci.c file to add
>> >> support
>> >> for eMMC tuning function. So card.h file is included to import the
>> card
>> >> data structure.
>> >
>> > We don't need to know the card type in the host controller driver if
>> we pass
>> > the command opcode as the 2nd argument to execute_tuning() ops.
>> Command
>> > opcode can have have either CMD19 or CMD21 as it's value depending on
>> the
>> > card type (whether it's SD3.0 card or eMMC4.5 card).
>
> Can you see if we can implement this?
I have considered this and made the patch
>
>> >
>> >
>> >>
>> >> cc: Chris Ball 
>> >> Signed-off-by: Girish K S 
>> >> ---
>> >> Changes in v4:
>> >>       Rebased onto chris-mmc/mmc-next branch. This patch is
>> >> successfully
>> >>       applied on commit with id
>> >> de022ed3fdc14808299b2fa66dbb1ed5ab921912.
>> >> Changes in v3:
>> >>       In the previous commits of chris-mmc/mmc-next branch, the
>> patch
>> >> with
>> >>       commit id (c0f22a2c92e357e7cb3988b0b13034d70b7461f9) defines
>> >> caps2 for
>> >>       more capabilities. This patch version deletes the member
>> >> ext_caps(created
>> >>       in my earlier patch) from struct mmc_host and reuses already
>> >> accepted
>> >>       caps2 member.
>> >> Changes in v2:
>> >>       Rebased to latest chris-mmc/mmc-next branch. Resolved
>> indentation
>> >>       problems identified in review. This patch has to be applied
>> >> before
>> >>       the patch released for modifying the printk messages.
>> >> Changes in v1:
>> >>       Case statements in switch that produce same result have
>> >>       been combined to reduce repeated assignments.
>> >>       patch recreated after rebase to chris balls mmc-next branch.
>> >>
>> >>  drivers/mmc/core/bus.c    |    3 +-
>> >>  drivers/mmc/core/mmc.c    |   92
>> >> 
>> >>  drivers/mmc/host/sdhci.c  |   36 +++---
>> >>  include/linux/mmc/card.h  |    3 +
>> >>  include/linux/mmc/host.h  |    6 +++
>> >>  include/linux/mmc/mmc.h   |    8 +++-
>> >>  include/linux/mmc/sdhci.h |    1 +
>> >>  7 files changed, 132 insertions(+), 17 deletions(-)
>> >>
>> >> diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
>> >> index 46b6e84..2f82f6b 100644
>> >> --- a/drivers/mmc/core/bus.c
>> >> +++ b/drivers/mmc/core/bus.c
>> >> @@ -301,10 +301,11 @@ int mmc_add_card(struct mmc_card *card)
>> >>                       mmc_card_ddr_mode(card) ? "DDR " : "",
>> >>                       type);
>> >>       } else {
>> >> -             printk(KERN_INFO "%s: new %s%s%s card at address
>> %04x\n",
>> >> +             pr_info("%s: new %s%s%s%s card at address %04x\n",
>> >>                       mmc_hostname(card->host),
>&

RE: [PATCH RESEND V4] mmc: core: HS200 mode support for eMMC 4.5

2011-11-23 Thread Subhash Jadavani
Hi Girish,

> -Original Message-
> From: Girish K S [mailto:girish.shivananja...@linaro.org]
> Sent: Monday, November 21, 2011 4:12 PM
> To: Subhash Jadavani
> Cc: linux-mmc@vger.kernel.org; c...@laptop.org; patc...@linaro.org;
> linux-samsung-...@vger.kernel.org
> Subject: Re: [PATCH RESEND V4] mmc: core: HS200 mode support for eMMC
> 4.5
> 
> On 19 November 2011 00:29, Subhash Jadavani 
> wrote:
> > Hi Girish,
> >
> >> -Original Message-
> >> From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
> >> ow...@vger.kernel.org] On Behalf Of Girish K S
> >> Sent: Wednesday, October 26, 2011 10:30 AM
> >> To: linux-mmc@vger.kernel.org
> >> Cc: c...@laptop.org; patc...@linaro.org; linux-samsung-
> >> s...@vger.kernel.org; Girish K S
> >> Subject: [PATCH RESEND V4] mmc: core: HS200 mode support for eMMC
> 4.5
> >>
> >> This patch adds the support of the HS200 bus speed for eMMC 4.5
> >> devices.
> >> The eMMC 4.5 devices have support for 200MHz bus speed.The mmc core
> and
> >> host modules have been touched to add support for this module.
> >>
> >> It is necessary to know the card type in the sdhci.c file to add
> >> support
> >> for eMMC tuning function. So card.h file is included to import the
> card
> >> data structure.
> >
> > We don't need to know the card type in the host controller driver if
> we pass
> > the command opcode as the 2nd argument to execute_tuning() ops.
> Command
> > opcode can have have either CMD19 or CMD21 as it's value depending on
> the
> > card type (whether it's SD3.0 card or eMMC4.5 card).

Can you see if we can implement this?

> >
> >
> >>
> >> cc: Chris Ball 
> >> Signed-off-by: Girish K S 
> >> ---
> >> Changes in v4:
> >>       Rebased onto chris-mmc/mmc-next branch. This patch is
> >> successfully
> >>       applied on commit with id
> >> de022ed3fdc14808299b2fa66dbb1ed5ab921912.
> >> Changes in v3:
> >>       In the previous commits of chris-mmc/mmc-next branch, the
> patch
> >> with
> >>       commit id (c0f22a2c92e357e7cb3988b0b13034d70b7461f9) defines
> >> caps2 for
> >>       more capabilities. This patch version deletes the member
> >> ext_caps(created
> >>       in my earlier patch) from struct mmc_host and reuses already
> >> accepted
> >>       caps2 member.
> >> Changes in v2:
> >>       Rebased to latest chris-mmc/mmc-next branch. Resolved
> indentation
> >>       problems identified in review. This patch has to be applied
> >> before
> >>       the patch released for modifying the printk messages.
> >> Changes in v1:
> >>       Case statements in switch that produce same result have
> >>       been combined to reduce repeated assignments.
> >>       patch recreated after rebase to chris balls mmc-next branch.
> >>
> >>  drivers/mmc/core/bus.c    |    3 +-
> >>  drivers/mmc/core/mmc.c    |   92
> >> 
> >>  drivers/mmc/host/sdhci.c  |   36 +++---
> >>  include/linux/mmc/card.h  |    3 +
> >>  include/linux/mmc/host.h  |    6 +++
> >>  include/linux/mmc/mmc.h   |    8 +++-
> >>  include/linux/mmc/sdhci.h |    1 +
> >>  7 files changed, 132 insertions(+), 17 deletions(-)
> >>
> >> diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
> >> index 46b6e84..2f82f6b 100644
> >> --- a/drivers/mmc/core/bus.c
> >> +++ b/drivers/mmc/core/bus.c
> >> @@ -301,10 +301,11 @@ int mmc_add_card(struct mmc_card *card)
> >>                       mmc_card_ddr_mode(card) ? "DDR " : "",
> >>                       type);
> >>       } else {
> >> -             printk(KERN_INFO "%s: new %s%s%s card at address
> %04x\n",
> >> +             pr_info("%s: new %s%s%s%s card at address %04x\n",
> >>                       mmc_hostname(card->host),
> >>                       mmc_sd_card_uhs(card) ? "ultra high speed " :
> >>                       (mmc_card_highspeed(card) ? "high speed " :
> ""),
> >> +                     (mmc_card_hs200(card) ? "HS200 " : ""),
> >>                       mmc_card_ddr_mode(card) ? "DDR " : "",
> >>                       type, card->rca);
> >>       }
> >> diff --git a/drivers/m

Re: [PATCH RESEND V4] mmc: core: HS200 mode support for eMMC 4.5

2011-11-21 Thread Girish K S
On 19 November 2011 00:29, Subhash Jadavani  wrote:
> Hi Girish,
>
>> -Original Message-
>> From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
>> ow...@vger.kernel.org] On Behalf Of Girish K S
>> Sent: Wednesday, October 26, 2011 10:30 AM
>> To: linux-mmc@vger.kernel.org
>> Cc: c...@laptop.org; patc...@linaro.org; linux-samsung-
>> s...@vger.kernel.org; Girish K S
>> Subject: [PATCH RESEND V4] mmc: core: HS200 mode support for eMMC 4.5
>>
>> This patch adds the support of the HS200 bus speed for eMMC 4.5
>> devices.
>> The eMMC 4.5 devices have support for 200MHz bus speed.The mmc core and
>> host modules have been touched to add support for this module.
>>
>> It is necessary to know the card type in the sdhci.c file to add
>> support
>> for eMMC tuning function. So card.h file is included to import the card
>> data structure.
>
> We don't need to know the card type in the host controller driver if we pass
> the command opcode as the 2nd argument to execute_tuning() ops. Command
> opcode can have have either CMD19 or CMD21 as it's value depending on the
> card type (whether it's SD3.0 card or eMMC4.5 card).
>
>
>>
>> cc: Chris Ball 
>> Signed-off-by: Girish K S 
>> ---
>> Changes in v4:
>>       Rebased onto chris-mmc/mmc-next branch. This patch is
>> successfully
>>       applied on commit with id
>> de022ed3fdc14808299b2fa66dbb1ed5ab921912.
>> Changes in v3:
>>       In the previous commits of chris-mmc/mmc-next branch, the patch
>> with
>>       commit id (c0f22a2c92e357e7cb3988b0b13034d70b7461f9) defines
>> caps2 for
>>       more capabilities. This patch version deletes the member
>> ext_caps(created
>>       in my earlier patch) from struct mmc_host and reuses already
>> accepted
>>       caps2 member.
>> Changes in v2:
>>       Rebased to latest chris-mmc/mmc-next branch. Resolved indentation
>>       problems identified in review. This patch has to be applied
>> before
>>       the patch released for modifying the printk messages.
>> Changes in v1:
>>       Case statements in switch that produce same result have
>>       been combined to reduce repeated assignments.
>>       patch recreated after rebase to chris balls mmc-next branch.
>>
>>  drivers/mmc/core/bus.c    |    3 +-
>>  drivers/mmc/core/mmc.c    |   92
>> 
>>  drivers/mmc/host/sdhci.c  |   36 +++---
>>  include/linux/mmc/card.h  |    3 +
>>  include/linux/mmc/host.h  |    6 +++
>>  include/linux/mmc/mmc.h   |    8 +++-
>>  include/linux/mmc/sdhci.h |    1 +
>>  7 files changed, 132 insertions(+), 17 deletions(-)
>>
>> diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
>> index 46b6e84..2f82f6b 100644
>> --- a/drivers/mmc/core/bus.c
>> +++ b/drivers/mmc/core/bus.c
>> @@ -301,10 +301,11 @@ int mmc_add_card(struct mmc_card *card)
>>                       mmc_card_ddr_mode(card) ? "DDR " : "",
>>                       type);
>>       } else {
>> -             printk(KERN_INFO "%s: new %s%s%s card at address %04x\n",
>> +             pr_info("%s: new %s%s%s%s card at address %04x\n",
>>                       mmc_hostname(card->host),
>>                       mmc_sd_card_uhs(card) ? "ultra high speed " :
>>                       (mmc_card_highspeed(card) ? "high speed " : ""),
>> +                     (mmc_card_hs200(card) ? "HS200 " : ""),
>>                       mmc_card_ddr_mode(card) ? "DDR " : "",
>>                       type, card->rca);
>>       }
>> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
>> index 3627044..4db248c 100644
>> --- a/drivers/mmc/core/mmc.c
>> +++ b/drivers/mmc/core/mmc.c
>> @@ -285,6 +285,39 @@ static int mmc_read_ext_csd(struct mmc_card *card,
>> u8 *ext_csd)
>>       }
>>       card->ext_csd.raw_card_type = ext_csd[EXT_CSD_CARD_TYPE];
>>       switch (ext_csd[EXT_CSD_CARD_TYPE] & EXT_CSD_CARD_TYPE_MASK) {
>> +     case EXT_CSD_CARD_TYPE_SDR_200 |
>> +          EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
>> +     case EXT_CSD_CARD_TYPE_SDR_200 | EXT_CSD_CARD_TYPE_DDR_1_8V |
>> +          EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
>> +     case EXT_CSD_CARD_TYPE_SDR_200 | EXT_CSD_CARD_TYPE_DDR_1_2V |
>> +          EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
>> +     case EXT_CSD_CARD_TYPE_SDR_200 | EXT_CSD_CARD_TYPE_DDR_52 |
>> +          EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
>> +             card->ext_csd.hs_max_dtr = 2;
>> +             card->ext_csd.card_type = EXT_CSD_CARD_TYPE_SDR_200;
>> +             break;
>> +     case EXT_CSD_CARD_TYPE_SDR_1_2V |
>> +          EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
>> +     case EXT_CSD_CARD_TYPE_SDR_1_2V | EXT_CSD_CARD_TYPE_DDR_1_8V |
>> +          EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
>> +     case EXT_CSD_CARD_TYPE_SDR_1_2V | EXT_CSD_CARD_TYPE_DDR_1_2V |
>> +          EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
>> +     case EXT_CSD_CARD_TYPE_SDR_1_2V | EXT_CSD_CARD_TYPE_DDR_52 |
>> +          EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
>> + 

RE: [PATCH RESEND V4] mmc: core: HS200 mode support for eMMC 4.5

2011-11-18 Thread Subhash Jadavani
Hi Girish,

> -Original Message-
> From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
> ow...@vger.kernel.org] On Behalf Of Girish K S
> Sent: Wednesday, October 26, 2011 10:30 AM
> To: linux-mmc@vger.kernel.org
> Cc: c...@laptop.org; patc...@linaro.org; linux-samsung-
> s...@vger.kernel.org; Girish K S
> Subject: [PATCH RESEND V4] mmc: core: HS200 mode support for eMMC 4.5
> 
> This patch adds the support of the HS200 bus speed for eMMC 4.5
> devices.
> The eMMC 4.5 devices have support for 200MHz bus speed.The mmc core and
> host modules have been touched to add support for this module.
> 
> It is necessary to know the card type in the sdhci.c file to add
> support
> for eMMC tuning function. So card.h file is included to import the card
> data structure.

We don't need to know the card type in the host controller driver if we pass
the command opcode as the 2nd argument to execute_tuning() ops. Command
opcode can have have either CMD19 or CMD21 as it's value depending on the
card type (whether it's SD3.0 card or eMMC4.5 card).


> 
> cc: Chris Ball 
> Signed-off-by: Girish K S 
> ---
> Changes in v4:
>   Rebased onto chris-mmc/mmc-next branch. This patch is
> successfully
>   applied on commit with id
> de022ed3fdc14808299b2fa66dbb1ed5ab921912.
> Changes in v3:
>   In the previous commits of chris-mmc/mmc-next branch, the patch
> with
>   commit id (c0f22a2c92e357e7cb3988b0b13034d70b7461f9) defines
> caps2 for
>   more capabilities. This patch version deletes the member
> ext_caps(created
>   in my earlier patch) from struct mmc_host and reuses already
> accepted
>   caps2 member.
> Changes in v2:
>   Rebased to latest chris-mmc/mmc-next branch. Resolved indentation
>   problems identified in review. This patch has to be applied
> before
>   the patch released for modifying the printk messages.
> Changes in v1:
>   Case statements in switch that produce same result have
>   been combined to reduce repeated assignments.
>   patch recreated after rebase to chris balls mmc-next branch.
> 
>  drivers/mmc/core/bus.c|3 +-
>  drivers/mmc/core/mmc.c|   92
> 
>  drivers/mmc/host/sdhci.c  |   36 +++---
>  include/linux/mmc/card.h  |3 +
>  include/linux/mmc/host.h  |6 +++
>  include/linux/mmc/mmc.h   |8 +++-
>  include/linux/mmc/sdhci.h |1 +
>  7 files changed, 132 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
> index 46b6e84..2f82f6b 100644
> --- a/drivers/mmc/core/bus.c
> +++ b/drivers/mmc/core/bus.c
> @@ -301,10 +301,11 @@ int mmc_add_card(struct mmc_card *card)
>   mmc_card_ddr_mode(card) ? "DDR " : "",
>   type);
>   } else {
> - printk(KERN_INFO "%s: new %s%s%s card at address %04x\n",
> + pr_info("%s: new %s%s%s%s card at address %04x\n",
>   mmc_hostname(card->host),
>   mmc_sd_card_uhs(card) ? "ultra high speed " :
>   (mmc_card_highspeed(card) ? "high speed " : ""),
> + (mmc_card_hs200(card) ? "HS200 " : ""),
>   mmc_card_ddr_mode(card) ? "DDR " : "",
>   type, card->rca);
>   }
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index 3627044..4db248c 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -285,6 +285,39 @@ static int mmc_read_ext_csd(struct mmc_card *card,
> u8 *ext_csd)
>   }
>   card->ext_csd.raw_card_type = ext_csd[EXT_CSD_CARD_TYPE];
>   switch (ext_csd[EXT_CSD_CARD_TYPE] & EXT_CSD_CARD_TYPE_MASK) {
> + case EXT_CSD_CARD_TYPE_SDR_200 |
> +  EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
> + case EXT_CSD_CARD_TYPE_SDR_200 | EXT_CSD_CARD_TYPE_DDR_1_8V |
> +  EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
> + case EXT_CSD_CARD_TYPE_SDR_200 | EXT_CSD_CARD_TYPE_DDR_1_2V |
> +  EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
> + case EXT_CSD_CARD_TYPE_SDR_200 | EXT_CSD_CARD_TYPE_DDR_52 |
> +  EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
> + card->ext_csd.hs_max_dtr = 2;
> + card->ext_csd.card_type = EXT_CSD_CARD_TYPE_SDR_200;
> + break;
> + case EXT_CSD_CARD_TYPE_SDR_1_2V |
> +  EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
> + case EXT_CSD_CARD_TYPE_SDR_1_2V | EXT_CSD_CARD_TYPE_DDR_1_8V |
> +  EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
> + case EXT_CSD_CARD_TYPE_SDR_1_2V | EXT_CSD_CARD_TYPE_DDR_1_2V |
> +  EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
> + case EXT_CSD_CARD_TYPE_SDR_1_2V | EXT_CSD_CARD_TYPE_DDR_52 |
> +  EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
> + card->ext_csd.hs_max_dtr = 2;
> + card->ext_csd.card_type = EXT_CSD_CARD_TYPE_SDR_1_2V;
> + break;
> + case EXT_CSD_

Re: [PATCH RESEND V4] mmc: core: HS200 mode support for eMMC 4.5

2011-11-17 Thread Girish K S
On 17 November 2011 11:06, Subhash Jadavani  wrote:
> Hi Girish,
>
>> -Original Message-
>> From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
>> ow...@vger.kernel.org] On Behalf Of Sahitya Tummala
>> Sent: Tuesday, November 08, 2011 2:10 PM
>> To: Girish K S
>> Cc: linux-mmc@vger.kernel.org; c...@laptop.org; patc...@linaro.org;
>> linux-samsung-...@vger.kernel.org
>> Subject: Re: [PATCH RESEND V4] mmc: core: HS200 mode support for eMMC
>> 4.5
>>
>> Hi Girish,
>>
>> On 10/26/2011 10:29 AM, Girish K S wrote:
>> > This patch adds the support of the HS200 bus speed for eMMC 4.5
>> devices.
>> > The eMMC 4.5 devices have support for 200MHz bus speed.The mmc core
>> and
>> > host modules have been touched to add support for this module.
>> >
>> > It is necessary to know the card type in the sdhci.c file to add
>> support
>> > for eMMC tuning function. So card.h file is included to import the
>> card
>> > data structure.
>> >
>> > cc: Chris Ball
>> > Signed-off-by: Girish K S
>> > ---
>> > Changes in v4:
>> >     Rebased onto chris-mmc/mmc-next branch. This patch is
>> successfully
>> >     applied on commit with id
>> de022ed3fdc14808299b2fa66dbb1ed5ab921912.
>> > Changes in v3:
>> >     In the previous commits of chris-mmc/mmc-next branch, the patch
>> with
>> >     commit id (c0f22a2c92e357e7cb3988b0b13034d70b7461f9) defines
>> caps2 for
>> >     more capabilities. This patch version deletes the member
>> ext_caps(created
>> >     in my earlier patch) from struct mmc_host and reuses already
>> accepted
>> >     caps2 member.
>> > Changes in v2:
>> >     Rebased to latest chris-mmc/mmc-next branch. Resolved indentation
>> >     problems identified in review. This patch has to be applied
>> before
>> >     the patch released for modifying the printk messages.
>> > Changes in v1:
>> >     Case statements in switch that produce same result have
>> >     been combined to reduce repeated assignments.
>> >     patch recreated after rebase to chris balls mmc-next branch.
>> >
>> >   drivers/mmc/core/bus.c    |    3 +-
>> >   drivers/mmc/core/mmc.c    |   92
>> 
>> >   drivers/mmc/host/sdhci.c  |   36 +++---
>> >   include/linux/mmc/card.h  |    3 +
>> >   include/linux/mmc/host.h  |    6 +++
>> >   include/linux/mmc/mmc.h   |    8 +++-
>> >   include/linux/mmc/sdhci.h |    1 +
>> >   7 files changed, 132 insertions(+), 17 deletions(-)
>> >
>> > diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
>> > index 46b6e84..2f82f6b 100644
>> > --- a/drivers/mmc/core/bus.c
>> > +++ b/drivers/mmc/core/bus.c
>> > @@ -301,10 +301,11 @@ int mmc_add_card(struct mmc_card *card)
>> >                     mmc_card_ddr_mode(card) ? "DDR " : "",
>> >                     type);
>> >     } else {
>> > -           printk(KERN_INFO "%s: new %s%s%s card at address %04x\n",
>> > +           pr_info("%s: new %s%s%s%s card at address %04x\n",
>> >                     mmc_hostname(card->host),
>> >                     mmc_sd_card_uhs(card) ? "ultra high speed " :
>> >                     (mmc_card_highspeed(card) ? "high speed " : ""),
>> > +                   (mmc_card_hs200(card) ? "HS200 " : ""),
>> >                     mmc_card_ddr_mode(card) ? "DDR " : "",
>> >                     type, card->rca);
>> >     }
>> > diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
>> > index 3627044..4db248c 100644
>> > --- a/drivers/mmc/core/mmc.c
>> > +++ b/drivers/mmc/core/mmc.c
>> > @@ -285,6 +285,39 @@ static int mmc_read_ext_csd(struct mmc_card
>> *card, u8 *ext_csd)
>> >     }
>> >     card->ext_csd.raw_card_type = ext_csd[EXT_CSD_CARD_TYPE];
>> >     switch (ext_csd[EXT_CSD_CARD_TYPE]&  EXT_CSD_CARD_TYPE_MASK) {
>> > +   case EXT_CSD_CARD_TYPE_SDR_200 |
>> > +        EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
>> > +   case EXT_CSD_CARD_TYPE_SDR_200 | EXT_CSD_CARD_TYPE_DDR_1_8V |
>> > +        EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
>> > +   case EXT_CSD_CARD_TYPE_SDR_200 | EXT_CSD_CARD_TYPE_DDR_1_2V |
>> > +        EXT_CSD_CARD_TYPE_52 | EXT_CSD_CA

RE: [PATCH RESEND V4] mmc: core: HS200 mode support for eMMC 4.5

2011-11-16 Thread Subhash Jadavani
Hi Girish,

> -Original Message-
> From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
> ow...@vger.kernel.org] On Behalf Of Sahitya Tummala
> Sent: Tuesday, November 08, 2011 2:10 PM
> To: Girish K S
> Cc: linux-mmc@vger.kernel.org; c...@laptop.org; patc...@linaro.org;
> linux-samsung-...@vger.kernel.org
> Subject: Re: [PATCH RESEND V4] mmc: core: HS200 mode support for eMMC
> 4.5
> 
> Hi Girish,
> 
> On 10/26/2011 10:29 AM, Girish K S wrote:
> > This patch adds the support of the HS200 bus speed for eMMC 4.5
> devices.
> > The eMMC 4.5 devices have support for 200MHz bus speed.The mmc core
> and
> > host modules have been touched to add support for this module.
> >
> > It is necessary to know the card type in the sdhci.c file to add
> support
> > for eMMC tuning function. So card.h file is included to import the
> card
> > data structure.
> >
> > cc: Chris Ball
> > Signed-off-by: Girish K S
> > ---
> > Changes in v4:
> > Rebased onto chris-mmc/mmc-next branch. This patch is
> successfully
> > applied on commit with id
> de022ed3fdc14808299b2fa66dbb1ed5ab921912.
> > Changes in v3:
> > In the previous commits of chris-mmc/mmc-next branch, the patch
> with
> > commit id (c0f22a2c92e357e7cb3988b0b13034d70b7461f9) defines
> caps2 for
> > more capabilities. This patch version deletes the member
> ext_caps(created
> > in my earlier patch) from struct mmc_host and reuses already
> accepted
> > caps2 member.
> > Changes in v2:
> > Rebased to latest chris-mmc/mmc-next branch. Resolved indentation
> > problems identified in review. This patch has to be applied
> before
> > the patch released for modifying the printk messages.
> > Changes in v1:
> > Case statements in switch that produce same result have
> > been combined to reduce repeated assignments.
> > patch recreated after rebase to chris balls mmc-next branch.
> >
> >   drivers/mmc/core/bus.c|3 +-
> >   drivers/mmc/core/mmc.c|   92
> 
> >   drivers/mmc/host/sdhci.c  |   36 +++---
> >   include/linux/mmc/card.h  |3 +
> >   include/linux/mmc/host.h  |6 +++
> >   include/linux/mmc/mmc.h   |8 +++-
> >   include/linux/mmc/sdhci.h |1 +
> >   7 files changed, 132 insertions(+), 17 deletions(-)
> >
> > diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
> > index 46b6e84..2f82f6b 100644
> > --- a/drivers/mmc/core/bus.c
> > +++ b/drivers/mmc/core/bus.c
> > @@ -301,10 +301,11 @@ int mmc_add_card(struct mmc_card *card)
> > mmc_card_ddr_mode(card) ? "DDR " : "",
> > type);
> > } else {
> > -   printk(KERN_INFO "%s: new %s%s%s card at address %04x\n",
> > +   pr_info("%s: new %s%s%s%s card at address %04x\n",
> > mmc_hostname(card->host),
> > mmc_sd_card_uhs(card) ? "ultra high speed " :
> > (mmc_card_highspeed(card) ? "high speed " : ""),
> > +   (mmc_card_hs200(card) ? "HS200 " : ""),
> > mmc_card_ddr_mode(card) ? "DDR " : "",
> > type, card->rca);
> > }
> > diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> > index 3627044..4db248c 100644
> > --- a/drivers/mmc/core/mmc.c
> > +++ b/drivers/mmc/core/mmc.c
> > @@ -285,6 +285,39 @@ static int mmc_read_ext_csd(struct mmc_card
> *card, u8 *ext_csd)
> > }
> > card->ext_csd.raw_card_type = ext_csd[EXT_CSD_CARD_TYPE];
> > switch (ext_csd[EXT_CSD_CARD_TYPE]&  EXT_CSD_CARD_TYPE_MASK) {
> > +   case EXT_CSD_CARD_TYPE_SDR_200 |
> > +EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
> > +   case EXT_CSD_CARD_TYPE_SDR_200 | EXT_CSD_CARD_TYPE_DDR_1_8V |
> > +EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
> > +   case EXT_CSD_CARD_TYPE_SDR_200 | EXT_CSD_CARD_TYPE_DDR_1_2V |
> > +EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
> > +   case EXT_CSD_CARD_TYPE_SDR_200 | EXT_CSD_CARD_TYPE_DDR_52 |
> > +EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
> > +   card->ext_csd.hs_max_dtr = 2;
> > +   card->ext_csd.card_type = EXT_CSD_CARD_TYPE_SDR_200;
> > +   break;
> > +   case EXT_CSD_CARD_TYPE_SDR_1_2V |
> > +EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
> >

Re: [PATCH RESEND V4] mmc: core: HS200 mode support for eMMC 4.5

2011-11-08 Thread Sahitya Tummala

Hi Girish,

On 10/26/2011 10:29 AM, Girish K S wrote:

This patch adds the support of the HS200 bus speed for eMMC 4.5 devices.
The eMMC 4.5 devices have support for 200MHz bus speed.The mmc core and
host modules have been touched to add support for this module.

It is necessary to know the card type in the sdhci.c file to add support
for eMMC tuning function. So card.h file is included to import the card
data structure.

cc: Chris Ball
Signed-off-by: Girish K S
---
Changes in v4:
Rebased onto chris-mmc/mmc-next branch. This patch is successfully
applied on commit with id de022ed3fdc14808299b2fa66dbb1ed5ab921912.
Changes in v3:
In the previous commits of chris-mmc/mmc-next branch, the patch with
commit id (c0f22a2c92e357e7cb3988b0b13034d70b7461f9) defines caps2 for
more capabilities. This patch version deletes the member 
ext_caps(created
in my earlier patch) from struct mmc_host and reuses already accepted
caps2 member.
Changes in v2:
Rebased to latest chris-mmc/mmc-next branch. Resolved indentation
problems identified in review. This patch has to be applied before
the patch released for modifying the printk messages.
Changes in v1:
Case statements in switch that produce same result have
been combined to reduce repeated assignments.
patch recreated after rebase to chris balls mmc-next branch.

  drivers/mmc/core/bus.c|3 +-
  drivers/mmc/core/mmc.c|   92 
  drivers/mmc/host/sdhci.c  |   36 +++---
  include/linux/mmc/card.h  |3 +
  include/linux/mmc/host.h  |6 +++
  include/linux/mmc/mmc.h   |8 +++-
  include/linux/mmc/sdhci.h |1 +
  7 files changed, 132 insertions(+), 17 deletions(-)

diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
index 46b6e84..2f82f6b 100644
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -301,10 +301,11 @@ int mmc_add_card(struct mmc_card *card)
mmc_card_ddr_mode(card) ? "DDR " : "",
type);
} else {
-   printk(KERN_INFO "%s: new %s%s%s card at address %04x\n",
+   pr_info("%s: new %s%s%s%s card at address %04x\n",
mmc_hostname(card->host),
mmc_sd_card_uhs(card) ? "ultra high speed " :
(mmc_card_highspeed(card) ? "high speed " : ""),
+   (mmc_card_hs200(card) ? "HS200 " : ""),
mmc_card_ddr_mode(card) ? "DDR " : "",
type, card->rca);
}
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 3627044..4db248c 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -285,6 +285,39 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 
*ext_csd)
}
card->ext_csd.raw_card_type = ext_csd[EXT_CSD_CARD_TYPE];
switch (ext_csd[EXT_CSD_CARD_TYPE]&  EXT_CSD_CARD_TYPE_MASK) {
+   case EXT_CSD_CARD_TYPE_SDR_200 |
+EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
+   case EXT_CSD_CARD_TYPE_SDR_200 | EXT_CSD_CARD_TYPE_DDR_1_8V |
+EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
+   case EXT_CSD_CARD_TYPE_SDR_200 | EXT_CSD_CARD_TYPE_DDR_1_2V |
+EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
+   case EXT_CSD_CARD_TYPE_SDR_200 | EXT_CSD_CARD_TYPE_DDR_52 |
+EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
+   card->ext_csd.hs_max_dtr = 2;
+   card->ext_csd.card_type = EXT_CSD_CARD_TYPE_SDR_200;
+   break;
+   case EXT_CSD_CARD_TYPE_SDR_1_2V |
+EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
+   case EXT_CSD_CARD_TYPE_SDR_1_2V | EXT_CSD_CARD_TYPE_DDR_1_8V |
+EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
+   case EXT_CSD_CARD_TYPE_SDR_1_2V | EXT_CSD_CARD_TYPE_DDR_1_2V |
+EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
+   case EXT_CSD_CARD_TYPE_SDR_1_2V | EXT_CSD_CARD_TYPE_DDR_52 |
+EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
+   card->ext_csd.hs_max_dtr = 2;
+   card->ext_csd.card_type = EXT_CSD_CARD_TYPE_SDR_1_2V;
+   break;
+   case EXT_CSD_CARD_TYPE_SDR_1_8V |
+EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
+   case EXT_CSD_CARD_TYPE_SDR_1_8V | EXT_CSD_CARD_TYPE_DDR_1_8V |
+EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
+   case EXT_CSD_CARD_TYPE_SDR_1_8V | EXT_CSD_CARD_TYPE_DDR_1_2V |
+EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
+   case EXT_CSD_CARD_TYPE_SDR_1_8V | EXT_CSD_CARD_TYPE_DDR_52 |
+EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
+   card->ext_csd.hs_max_dtr = 2;
+   card->ext_csd.card_type = EXT_CSD_CARD_TYPE_SDR_1_8V;
+   break;
case EXT_CSD_CARD_TYPE_DDR_52 | EXT_CSD_CARD_TYPE_52 |
 EXT_CSD_CARD_T

Re: [PATCH RESEND V4] mmc: core: HS200 mode support for eMMC 4.5

2011-10-27 Thread Girish K S
On 27 October 2011 01:23, Chris Ball  wrote:
> Hi Girish,
>
> On Wed, Oct 26 2011, Girish K S wrote:
>> This patch adds the support of the HS200 bus speed for eMMC 4.5 devices.
>> The eMMC 4.5 devices have support for 200MHz bus speed.The mmc core and
>> host modules have been touched to add support for this module.
>>
>> It is necessary to know the card type in the sdhci.c file to add support
>> for eMMC tuning function. So card.h file is included to import the card
>> data structure.
>>
>> cc: Chris Ball 
>> Signed-off-by: Girish K S 
>
> The long case statements and conditionals in this patch make it pretty
> dense/ugly -- can you think of a way to avoid doing this to the code?
Definitely will workout.
> Also, it would be good to hear if anyone else has tested/is using this
> patch.
>
> Is having a new mmc_card_hs200() test desirable, compared to just
> reusing mmc_card_highspeed() and checking the ext_csd.card_type?
The specification classifies from 26 to 52MHz as high speed. And
anything above it upto 200 as hs200. I added the macro for
clarity and to be inclined to the specification.
> Thanks,
>
> - Chris.
> --
> Chris Ball      
> One Laptop Per Child
>
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH RESEND V4] mmc: core: HS200 mode support for eMMC 4.5

2011-10-26 Thread Chris Ball
Hi Girish,

On Wed, Oct 26 2011, Girish K S wrote:
> This patch adds the support of the HS200 bus speed for eMMC 4.5 devices.
> The eMMC 4.5 devices have support for 200MHz bus speed.The mmc core and
> host modules have been touched to add support for this module.
>
> It is necessary to know the card type in the sdhci.c file to add support
> for eMMC tuning function. So card.h file is included to import the card
> data structure.
>
> cc: Chris Ball 
> Signed-off-by: Girish K S 

The long case statements and conditionals in this patch make it pretty
dense/ugly -- can you think of a way to avoid doing this to the code?
Also, it would be good to hear if anyone else has tested/is using this
patch.

Is having a new mmc_card_hs200() test desirable, compared to just
reusing mmc_card_highspeed() and checking the ext_csd.card_type?

Thanks,

- Chris.
-- 
Chris Ball  
One Laptop Per Child
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html