RE: [PATCH V2] mmc: core: Add host capability check for power class

2012-04-02 Thread Subhash Jadavani


> -Original Message-
> From: Saugata Das [mailto:saugata@linaro.org]
> Sent: Monday, April 02, 2012 1:20 PM
> To: Subhash Jadavani
> Cc: Girish K S; linux-...@vger.kernel.org; patc...@linaro.org; linux-
> samsung-...@vger.kernel.org; Chris Ball
> Subject: Re: [PATCH V2] mmc: core: Add host capability check for power
class
> 
> On 28 March 2012 16:39, Subhash Jadavani 
> wrote:
> >
> >
> >> -Original Message-
> >> From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
> >> ow...@vger.kernel.org] On Behalf Of Saugata Das
> >> Sent: Thursday, December 15, 2011 6:35 PM
> >> To: Girish K S
> >> Cc: linux-...@vger.kernel.org; patc...@linaro.org; linux-samsung-
> >> s...@vger.kernel.org; subha...@codeaurora.org; Chris Ball
> >> Subject: Re: [PATCH V2] mmc: core: Add host capability check for
> >> power
> > class
> >>
> >> On 15 December 2011 16:22, Girish K S
> >> 
> >> wrote:
> >> > On 15 December 2011 15:34, Saugata Das 
> wrote:
> >> >> On 15 December 2011 09:28, Girish K S
> >> >> 
> >> wrote:
> >> >>> This patch adds a check whether the host supports maximum current
> >> >>> value obtained from the device's extended csd register for a
> >> >>> selected interface voltage and frequency.
> >> >>>
> >> >>> cc: Chris Ball 
> >> >>> Signed-off-by: Girish K S 
> >> >>> ---
> >> >>> Changes in v2:
> >> >>>        deleted a unnecessary if else condition identified by
> >> >>> subhash J Changes in v1:
> >> >>>       reduced the number of comparisons as per Hein's suggestion
> >> >>>
> >> >>>  drivers/mmc/core/mmc.c   |   19 +++
> >> >>>  include/linux/mmc/card.h |    4 
> >> >>>  2 files changed, 23 insertions(+), 0 deletions(-)
> >> >>>
> >> >>> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> >> >>> index
> >> >>> 006e932..b9ef777 100644
> >> >>> --- a/drivers/mmc/core/mmc.c
> >> >>> +++ b/drivers/mmc/core/mmc.c
> >> >>> @@ -688,6 +688,25 @@ static int mmc_select_powerclass(struct
> >> >>> mmc_card *card,
> >> >>>                pwrclass_val = (pwrclass_val &
> >> >>> EXT_CSD_PWR_CL_4BIT_MASK) >>
> >> >>>                                EXT_CSD_PWR_CL_4BIT_SHIFT;
> >> >>>
> >> >>> +       if (pwrclass_val >= MMC_MAX_CURRENT_800)
> >> >>> +               pwrclass_val = MMC_MAX_CURRENT_800;
> >> >>> +       else if (pwrclass_val >= MMC_MAX_CURRENT_600)
> >> >>> +               pwrclass_val = MMC_MAX_CURRENT_600;
> >> >>> +       else if (pwrclass_val >= MMC_MAX_CURRENT_400)
> >> >>> +               pwrclass_val = MMC_MAX_CURRENT_400;
> >> >>> +       else
> >> >>> +               pwrclass_val = MMC_MAX_CURRENT_200;
> >> >>> +
> >> >>> +       if ((pwrclass_val == MMC_MAX_CURRENT_800) &&
> >> >>> +           !(card->host->caps & MMC_CAP_MAX_CURRENT_800))
> >> >>> +               pwrclass_val = MMC_MAX_CURRENT_600;
> >> >>> +       if ((pwrclass_val == MMC_MAX_CURRENT_600) &&
> >> >>> +           !(card->host->caps & MMC_CAP_MAX_CURRENT_600))
> >> >>> +               pwrclass_val = MMC_MAX_CURRENT_400;
> >> >>> +       if ((pwrclass_val == MMC_MAX_CURRENT_400) &&
> >> >>> +           !(card->host->caps & MMC_CAP_MAX_CURRENT_400))
> >> >>> +               pwrclass_val = MMC_MAX_CURRENT_200;
> >> >>> +
> >> >>>        /* If the power class is different from the default value
> >> >>> */
> >> >>>        if (pwrclass_val > 0) {
> >> >>>                err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
> >> >>
> >> >> It is not allowed to set the POWER_CLASS with any value other than
> >> >> what is mentioned in the PWR_CL_ff_vvv or PWR_CL_DDR_ff_vvv  for
> >> the
> >> >> corresponding frequency, voltage. That is, if PWR_CL_200_195 is 14
> >> >> and we want to operate at HS200 then the only value allowed 

RE: [PATCH V2] mmc: core: Add host capability check for power class

2012-03-29 Thread Subhash Jadavani

> -Original Message-
> From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
> ow...@vger.kernel.org] On Behalf Of Girish K S
> Sent: Friday, March 30, 2012 10:29 AM
> To: Subhash Jadavani
> Cc: Saugata Das; linux-...@vger.kernel.org; patc...@linaro.org; linux-
> samsung-...@vger.kernel.org; Chris Ball
> Subject: Re: [PATCH V2] mmc: core: Add host capability check for power
class
> 
> On 29 March 2012 11:17, Girish K S 
wrote:
> > On 28 March 2012 16:39, Subhash Jadavani 
> wrote:
> >>
> >>
> >>> -Original Message-
> >>> From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
> >>> ow...@vger.kernel.org] On Behalf Of Saugata Das
> >>> Sent: Thursday, December 15, 2011 6:35 PM
> >>> To: Girish K S
> >>> Cc: linux-...@vger.kernel.org; patc...@linaro.org; linux-samsung-
> >>> s...@vger.kernel.org; subha...@codeaurora.org; Chris Ball
> >>> Subject: Re: [PATCH V2] mmc: core: Add host capability check for
> >>> power
> >> class
> >>>
> >>> On 15 December 2011 16:22, Girish K S
> >>> 
> >>> wrote:
> >>> > On 15 December 2011 15:34, Saugata Das 
> wrote:
> >>> >> On 15 December 2011 09:28, Girish K S
> >>> >> 
> >>> wrote:
> >>> >>> This patch adds a check whether the host supports maximum
> >>> >>> current value obtained from the device's extended csd register
> >>> >>> for a selected interface voltage and frequency.
> >>> >>>
> >>> >>> cc: Chris Ball 
> >>> >>> Signed-off-by: Girish K S 
> >>> >>> ---
> >>> >>> Changes in v2:
> >>> >>>        deleted a unnecessary if else condition identified by
> >>> >>> subhash J Changes in v1:
> >>> >>>       reduced the number of comparisons as per Hein's suggestion
> >>> >>>
> >>> >>>  drivers/mmc/core/mmc.c   |   19 +++
> >>> >>>  include/linux/mmc/card.h |    4 
> >>> >>>  2 files changed, 23 insertions(+), 0 deletions(-)
> >>> >>>
> >>> >>> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> >>> >>> index
> >>> >>> 006e932..b9ef777 100644
> >>> >>> --- a/drivers/mmc/core/mmc.c
> >>> >>> +++ b/drivers/mmc/core/mmc.c
> >>> >>> @@ -688,6 +688,25 @@ static int mmc_select_powerclass(struct
> >>> >>> mmc_card *card,
> >>> >>>                pwrclass_val = (pwrclass_val &
> >>> >>> EXT_CSD_PWR_CL_4BIT_MASK) >>
> >>> >>>                                EXT_CSD_PWR_CL_4BIT_SHIFT;
> >>> >>>
> >>> >>> +       if (pwrclass_val >= MMC_MAX_CURRENT_800)
> >>> >>> +               pwrclass_val = MMC_MAX_CURRENT_800;
> >>> >>> +       else if (pwrclass_val >= MMC_MAX_CURRENT_600)
> >>> >>> +               pwrclass_val = MMC_MAX_CURRENT_600;
> >>> >>> +       else if (pwrclass_val >= MMC_MAX_CURRENT_400)
> >>> >>> +               pwrclass_val = MMC_MAX_CURRENT_400;
> >>> >>> +       else
> >>> >>> +               pwrclass_val = MMC_MAX_CURRENT_200;
> >>> >>> +
> >>> >>> +       if ((pwrclass_val == MMC_MAX_CURRENT_800) &&
> >>> >>> +           !(card->host->caps & MMC_CAP_MAX_CURRENT_800))
> >>> >>> +               pwrclass_val = MMC_MAX_CURRENT_600;
> >>> >>> +       if ((pwrclass_val == MMC_MAX_CURRENT_600) &&
> >>> >>> +           !(card->host->caps & MMC_CAP_MAX_CURRENT_600))
> >>> >>> +               pwrclass_val = MMC_MAX_CURRENT_400;
> >>> >>> +       if ((pwrclass_val == MMC_MAX_CURRENT_400) &&
> >>> >>> +           !(card->host->caps & MMC_CAP_MAX_CURRENT_400))
> >>> >>> +               pwrclass_val = MMC_MAX_CURRENT_200;
> >>> >>> +
> >>> >>>        /* If the power class is different from the default value
> >>> >>> */
> >>> >>>        if (pwrclass_val > 0) {
> >>> >>>                err = mmc_switch(card, EXT_CSD_CMD_S

RE: [PATCH V2] mmc: core: Add host capability check for power class

2012-03-28 Thread Subhash Jadavani


> -Original Message-
> From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
> ow...@vger.kernel.org] On Behalf Of Saugata Das
> Sent: Thursday, December 15, 2011 6:35 PM
> To: Girish K S
> Cc: linux-...@vger.kernel.org; patc...@linaro.org; linux-samsung-
> s...@vger.kernel.org; subha...@codeaurora.org; Chris Ball
> Subject: Re: [PATCH V2] mmc: core: Add host capability check for power
class
> 
> On 15 December 2011 16:22, Girish K S 
> wrote:
> > On 15 December 2011 15:34, Saugata Das  wrote:
> >> On 15 December 2011 09:28, Girish K S 
> wrote:
> >>> This patch adds a check whether the host supports maximum current
> >>> value obtained from the device's extended csd register for a
> >>> selected interface voltage and frequency.
> >>>
> >>> cc: Chris Ball 
> >>> Signed-off-by: Girish K S 
> >>> ---
> >>> Changes in v2:
> >>>        deleted a unnecessary if else condition identified by subhash
> >>> J Changes in v1:
> >>>       reduced the number of comparisons as per Hein's suggestion
> >>>
> >>>  drivers/mmc/core/mmc.c   |   19 +++
> >>>  include/linux/mmc/card.h |    4 
> >>>  2 files changed, 23 insertions(+), 0 deletions(-)
> >>>
> >>> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index
> >>> 006e932..b9ef777 100644
> >>> --- a/drivers/mmc/core/mmc.c
> >>> +++ b/drivers/mmc/core/mmc.c
> >>> @@ -688,6 +688,25 @@ static int mmc_select_powerclass(struct
> >>> mmc_card *card,
> >>>                pwrclass_val = (pwrclass_val &
> >>> EXT_CSD_PWR_CL_4BIT_MASK) >>
> >>>                                EXT_CSD_PWR_CL_4BIT_SHIFT;
> >>>
> >>> +       if (pwrclass_val >= MMC_MAX_CURRENT_800)
> >>> +               pwrclass_val = MMC_MAX_CURRENT_800;
> >>> +       else if (pwrclass_val >= MMC_MAX_CURRENT_600)
> >>> +               pwrclass_val = MMC_MAX_CURRENT_600;
> >>> +       else if (pwrclass_val >= MMC_MAX_CURRENT_400)
> >>> +               pwrclass_val = MMC_MAX_CURRENT_400;
> >>> +       else
> >>> +               pwrclass_val = MMC_MAX_CURRENT_200;
> >>> +
> >>> +       if ((pwrclass_val == MMC_MAX_CURRENT_800) &&
> >>> +           !(card->host->caps & MMC_CAP_MAX_CURRENT_800))
> >>> +               pwrclass_val = MMC_MAX_CURRENT_600;
> >>> +       if ((pwrclass_val == MMC_MAX_CURRENT_600) &&
> >>> +           !(card->host->caps & MMC_CAP_MAX_CURRENT_600))
> >>> +               pwrclass_val = MMC_MAX_CURRENT_400;
> >>> +       if ((pwrclass_val == MMC_MAX_CURRENT_400) &&
> >>> +           !(card->host->caps & MMC_CAP_MAX_CURRENT_400))
> >>> +               pwrclass_val = MMC_MAX_CURRENT_200;
> >>> +
> >>>        /* If the power class is different from the default value */
> >>>        if (pwrclass_val > 0) {
> >>>                err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
> >>
> >> It is not allowed to set the POWER_CLASS with any value other than
> >> what is mentioned in the PWR_CL_ff_vvv or PWR_CL_DDR_ff_vvv  for
> the
> >> corresponding frequency, voltage. That is, if PWR_CL_200_195 is 14
> >> and we want to operate at HS200 then the only value allowed for
> >> POWER_CLASS is 14. So, we need to check the PWR_CL numbers and
> choose
> >> the operating mode (HS200/DDR50/..) based on the platform capability
> >> to support the current consumption and set the corresponding
> >> POWER_CLASS value.
> >>
> >> Please refer to section 6.6.5 of the 4.5 spec.
> >
> > The upstreamed code reads the extended csd value based on the already
> > set voltage level and frequency of host. So it will get the required
> > power class value which can be set directly. Is my understanding
> > correct?
> >
> 
> It is not enough to just check the voltage level and frequency.
> Consider this example, host has capability to support
> MMC_CAP_MAX_CURRENT_400, the PWR_CL_DDR_52_360 has the value 9
> (400mA) and PWR_CL_200_360 has the value 14 (800mA). Then even though
> the host might be capable to run 200MHz clock and 3.6V, it can only enable
> DDR at 52MHz and set 9 in POWER_CLASS.
> 
> I think, in mmc_select_powerclass, we need to loop through the power
> classes of all supported modes of transfer (HS200, DDR52, ... ) and choose
the
> mode which gives maximum bandwidth but falls within host capability of
> current consumption. Then set this to POWER_CLASS byte and also use the
> same information when setting HS_TIMING in mmc_init_card.

Hi Saugata,

Does the spec mandates you to set the power class to what is needed by
frequency/voltage combination? I can't see that mentioned anywhere
explicitly in eMMC4.5 spec (if it is mentioned in spec, please let me know
section and line number). It may be still possible to set the power class
lower than what is needed by frequency/voltage combination. Say for example,
8-bit HS200 (200MHz) with high voltage cards may specify power class
(PWR_CL_200_3_6) value of 14 (800 mA) but that doesn't mean if you want the
card to work in 8-bit HS200 mode, its POWER_CLASS value must be 14 (800mA).
If host's VDD regulator is only capable of say 600mA then 

Re: [PATCH V8 1/2] mmc: core: HS200 mode support for eMMC 4.5

2011-12-23 Thread Subhash Jadavani


Looks good to me.
Acked-by: Subhash Jadavani 

Regards,
Subhash

On 12/23/2011 12:42 PM, 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 function
prototype of the tuning function is modified to handle the tuning command
number which is different in sd and mmc case.

cc: Chris Ball
Signed-off-by: Girish K S
Signed-off-by: Philip Rakity
---
  drivers/mmc/core/bus.c |3 +-
  drivers/mmc/core/debugfs.c |3 +
  drivers/mmc/core/mmc.c |  163 +---
  drivers/mmc/core/sd.c  |3 +-
  drivers/mmc/core/sdio.c|4 +-
  include/linux/mmc/card.h   |3 +
  include/linux/mmc/host.h   |   11 +++-
  include/linux/mmc/mmc.h|   66 +-
  8 files changed, 242 insertions(+), 14 deletions(-)

diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
index f8a228a..5d011a3 100644
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -303,10 +303,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_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/debugfs.c b/drivers/mmc/core/debugfs.c
index 027615d..9ab5b17 100644
--- a/drivers/mmc/core/debugfs.c
+++ b/drivers/mmc/core/debugfs.c
@@ -135,6 +135,9 @@ static int mmc_ios_show(struct seq_file *s, void *data)
case MMC_TIMING_UHS_DDR50:
str = "sd uhs DDR50";
break;
+   case MMC_TIMING_MMC_HS200:
+   str = "mmc high-speed SDR200";
+   break;
default:
str = "invalid";
break;
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index f0a9f1f..583cb42 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -286,6 +286,27 @@ 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_ALL:
+   case EXT_CSD_CARD_TYPE_SDR_ALL_DDR_1_8V:
+   case EXT_CSD_CARD_TYPE_SDR_ALL_DDR_1_2V:
+   case EXT_CSD_CARD_TYPE_SDR_ALL_DDR_52:
+   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_ALL:
+   case EXT_CSD_CARD_TYPE_SDR_1_2V_DDR_1_8V:
+   case EXT_CSD_CARD_TYPE_SDR_1_2V_DDR_1_2V:
+   case EXT_CSD_CARD_TYPE_SDR_1_2V_DDR_52:
+   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_ALL:
+   case EXT_CSD_CARD_TYPE_SDR_1_8V_DDR_1_8V:
+   case EXT_CSD_CARD_TYPE_SDR_1_8V_DDR_1_2V:
+   case EXT_CSD_CARD_TYPE_SDR_1_8V_DDR_52:
+   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_TYPE_26:
card->ext_csd.hs_max_dtr = 5200;
@@ -700,6 +721,79 @@ static int mmc_select_powerclass(struct mmc_card *card,
  }

  /*
+ * Selects the desired buswidth and switch to the HS200 mode
+ * if bus width set without error
+ */
+static int mmc_select_hs200(struct mmc_card *card)
+{
+   int idx, err = 0;
+   struct mmc_host *host;
+   static unsigned ext_csd_bits[] = {
+   EXT_CSD_BUS_WIDTH_4,
+   EXT_CSD_BUS_WIDTH_8,
+   };
+   static unsigned bus_widths[] = {
+   MMC_BUS_WIDTH_4,
+   MMC_BUS_WIDTH_8,
+   };
+
+   BUG_ON(!card);
+
+   host = card->host;
+
+   if ((card->ext_csd.card_type&  EXT_CSD_CARD_TYPE_SDR_1_2V)
+   &&  (host->caps2&  MMC_CAP2_HS200_1_2V_SDR))
+   if (mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_120, 0))
+   err = mmc_set_signal_voltage(host,
+MMC_SIGNAL_VOLTAGE_180, 0);
+
+   /* If fails try again during next card power cycle */
+   if (err)
+ 

Re: [RESEND PATCH V7 1/2] mmc: core: HS200 mode support for eMMC 4.5

2011-12-21 Thread Subhash Jadavani

 On 12/21/2011 3:10 PM, 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 function
prototype of the tuning function is modified to handle the tuning command
number which is different in sd and mmc case.

cc: Chris Ball
Signed-off-by: Girish K S
---
  drivers/mmc/core/bus.c |3 +-
  drivers/mmc/core/debugfs.c |3 +
  drivers/mmc/core/mmc.c |  148 +---
  drivers/mmc/core/sd.c  |3 +-
  drivers/mmc/core/sdio.c|4 +-
  include/linux/mmc/card.h   |3 +
  include/linux/mmc/host.h   |   11 +++-
  include/linux/mmc/mmc.h|   66 +++-
  8 files changed, 227 insertions(+), 14 deletions(-)

diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
index f8a228a..5d011a3 100644
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -303,10 +303,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_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/debugfs.c b/drivers/mmc/core/debugfs.c
index 027615d..9ab5b17 100644
--- a/drivers/mmc/core/debugfs.c
+++ b/drivers/mmc/core/debugfs.c
@@ -135,6 +135,9 @@ static int mmc_ios_show(struct seq_file *s, void *data)
case MMC_TIMING_UHS_DDR50:
str = "sd uhs DDR50";
break;
+   case MMC_TIMING_MMC_HS200:
+   str = "mmc high-speed SDR200";
+   break;
default:
str = "invalid";
break;
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index f0a9f1f..acb0865 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -286,6 +286,27 @@ 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_ALL:
+   case EXT_CSD_CARD_TYPE_SDR_ALL_DDR_1_8V:
+   case EXT_CSD_CARD_TYPE_SDR_ALL_DDR_1_2V:
+   case EXT_CSD_CARD_TYPE_SDR_ALL_DDR_52:
+   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_ALL:
+   case EXT_CSD_CARD_TYPE_SDR_1_2V_DDR_1_8V:
+   case EXT_CSD_CARD_TYPE_SDR_1_2V_DDR_1_2V:
+   case EXT_CSD_CARD_TYPE_SDR_1_2V_DDR_52:
+   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_ALL:
+   case EXT_CSD_CARD_TYPE_SDR_1_8V_DDR_1_8V:
+   case EXT_CSD_CARD_TYPE_SDR_1_8V_DDR_1_2V:
+   case EXT_CSD_CARD_TYPE_SDR_1_8V_DDR_52:
+   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_TYPE_26:
card->ext_csd.hs_max_dtr = 5200;
@@ -700,6 +721,64 @@ static int mmc_select_powerclass(struct mmc_card *card,
  }

  /*
+ * Selects the desired buswidth and switch to the HS200 mode
+ * if bus width set without error
+ */
+static int mmc_select_hs200(struct mmc_card *card)
+{
+   int err = 0;
+   struct mmc_host *host;
+   u32 bus_width = MMC_BUS_WIDTH_4;
+
+   BUG_ON(!card);
+
+   host = card->host;
+
+   if ((card->ext_csd.card_type&  EXT_CSD_CARD_TYPE_SDR_1_2V)
+   &&  (host->caps2&  MMC_CAP2_HS200_1_2V_SDR))
+   if (mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_120, 0))
+   err = mmc_set_signal_voltage(host,
+MMC_SIGNAL_VOLTAGE_180,0);
+
+   /* If fails try again during next card power cycle */
+   if (err)
+   goto err;
+
+   /*
+* Host is capable of 8bit transfer, then switch
+* the device to work in 8bit transfer mode. If the
+* mmc switch command returns error then switch to
+* 4bit transfer mode. On success set the corresponding
+* bus width on the host.
+*/
+   if (host->caps&  MMC_CAP_8_BIT_DATA) {
+   err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
+EXT_CSD_BUS_WIDTH,
+   

RE: [PATCH V7 1/2] mmc: core: HS200 mode support for eMMC 4.5

2011-12-20 Thread Subhash Jadavani


> -Original Message-
> From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
> ow...@vger.kernel.org] On Behalf Of Girish K S
> Sent: Wednesday, December 21, 2011 9:43 AM
> To: linux-...@vger.kernel.org
> Cc: patc...@linaro.org; linux-samsung-soc@vger.kernel.org; Girish K S;
> Chris Ball
> Subject: [PATCH V7 1/2] 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 function
> prototype of the tuning function is modified to handle the tuning
> command
> number which is different in sd and mmc case.
> 
> cc: Chris Ball 
> Signed-off-by: Girish K S 
> ---
>  drivers/mmc/core/bus.c |3 +-
>  drivers/mmc/core/debugfs.c |3 +
>  drivers/mmc/core/mmc.c |  142
> +---
>  drivers/mmc/core/sd.c  |3 +-
>  drivers/mmc/core/sdio.c|4 +-
>  include/linux/mmc/card.h   |3 +
>  include/linux/mmc/mmc.h|   66 -

Looks like you have missed to add change in "include/linux/mmc/host.h" in
this patch.



>  7 files changed, 211 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
> index f8a228a..5d011a3 100644
> --- a/drivers/mmc/core/bus.c
> +++ b/drivers/mmc/core/bus.c
> @@ -303,10 +303,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_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/debugfs.c b/drivers/mmc/core/debugfs.c
> index 027615d..9ab5b17 100644
> --- a/drivers/mmc/core/debugfs.c
> +++ b/drivers/mmc/core/debugfs.c
> @@ -135,6 +135,9 @@ static int mmc_ios_show(struct seq_file *s, void
> *data)
>   case MMC_TIMING_UHS_DDR50:
>   str = "sd uhs DDR50";
>   break;
> + case MMC_TIMING_MMC_HS200:
> + str = "mmc high-speed SDR200";
> + break;
>   default:
>   str = "invalid";
>   break;
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index f0a9f1f..4de3416 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -286,6 +286,27 @@ 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_ALL:
> + case EXT_CSD_CARD_TYPE_SDR_ALL_DDR_1_8V:
> + case EXT_CSD_CARD_TYPE_SDR_ALL_DDR_1_2V:
> + case EXT_CSD_CARD_TYPE_SDR_ALL_DDR_52:
> + 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_ALL:
> + case EXT_CSD_CARD_TYPE_SDR_1_2V_DDR_1_8V:
> + case EXT_CSD_CARD_TYPE_SDR_1_2V_DDR_1_2V:
> + case EXT_CSD_CARD_TYPE_SDR_1_2V_DDR_52:
> + 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_ALL:
> + case EXT_CSD_CARD_TYPE_SDR_1_8V_DDR_1_8V:
> + case EXT_CSD_CARD_TYPE_SDR_1_8V_DDR_1_2V:
> + case EXT_CSD_CARD_TYPE_SDR_1_8V_DDR_52:
> + 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_TYPE_26:
>   card->ext_csd.hs_max_dtr = 5200;
> @@ -700,6 +721,58 @@ static int mmc_select_powerclass(struct mmc_card
> *card,
>  }
> 
>  /*
> + * Selects the desired buswidth and switch to the HS200 mode
> + * if bus width set without error
> + */
> +static int mmc_select_hs200(struct mmc_card *card)
> +{
> + int err = 0;
> + struct mmc_host *host;
> + u32 bus_width = MMC_BUS_WIDTH_4;
> +
> + BUG_ON(!card);
> +
> + host = card->host;
> +
> + if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_SDR_1_2V)
> + && (host->caps2 & MMC_CAP2_HS200_1_2V_SDR))
> + err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_120,
> 0);
> +
> + /*
> +  * Host is capable of 8bit transfer, then switch
> +  * the device to work in 8bit transfer mode. If the
> +  * mmc switch command returns error then switch to
> +  * 4bit transfer mode. On success set the corresponding
> 

RE: [PATCH V6 1/2] mmc: core: HS200 mode support for eMMC 4.5

2011-12-19 Thread Subhash Jadavani


> -Original Message-
> From: Girish K S [mailto:girish.shivananja...@linaro.org]
> Sent: Monday, December 19, 2011 4:20 PM
> To: Subhash Jadavani
> Cc: linux-...@vger.kernel.org; patc...@linaro.org; linux-samsung-
> s...@vger.kernel.org; Chris Ball
> Subject: Re: [PATCH V6 1/2] mmc: core: HS200 mode support for eMMC 4.5
> 
> On 19 December 2011 15:40, Subhash Jadavani 
> wrote:
> > Hi Girish,
> >
> > Overall this patch looks good. I have only 2 minor comments inline
> below.
> >
> > Regards,
> > Subhash
> >
> >
> >> -Original Message-
> >> From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
> >> ow...@vger.kernel.org] On Behalf Of Girish K S
> >> Sent: Monday, December 19, 2011 12:07 PM
> >> To: linux-...@vger.kernel.org
> >> Cc: patc...@linaro.org; linux-samsung-soc@vger.kernel.org; Girish K
> S;
> >> Chris Ball
> >> Subject: [PATCH V6 1/2] 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 function
> >> prototype of the tuning function is modified to handle the tuning
> >> command
> >> number which is different in sd and mmc case.
> >>
> >> cc: Chris Ball 
> >> Signed-off-by: Girish K S 
> >> ---
> >>  drivers/mmc/core/bus.c     |    3 +-
> >>  drivers/mmc/core/debugfs.c |    3 +
> >>  drivers/mmc/core/mmc.c     |  147
> >> +---
> >>  drivers/mmc/core/sd.c      |    3 +-
> >>  drivers/mmc/core/sdio.c    |    4 +-
> >>  include/linux/mmc/card.h   |    3 +
> >>  include/linux/mmc/mmc.h    |   66 +++-
> >>  7 files changed, 216 insertions(+), 13 deletions(-)
> >>
> >> diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
> >> index f8a228a..5d011a3 100644
> >> --- a/drivers/mmc/core/bus.c
> >> +++ b/drivers/mmc/core/bus.c
> >> @@ -303,10 +303,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_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/debugfs.c b/drivers/mmc/core/debugfs.c
> >> index 027615d..9ab5b17 100644
> >> --- a/drivers/mmc/core/debugfs.c
> >> +++ b/drivers/mmc/core/debugfs.c
> >> @@ -135,6 +135,9 @@ static int mmc_ios_show(struct seq_file *s, void
> >> *data)
> >>       case MMC_TIMING_UHS_DDR50:
> >>               str = "sd uhs DDR50";
> >>               break;
> >> +     case MMC_TIMING_MMC_HS200:
> >> +             str = "mmc high-speed SDR200";
> >> +             break;
> >>       default:
> >>               str = "invalid";
> >>               break;
> >> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> >> index f0a9f1f..d5d93de 100644
> >> --- a/drivers/mmc/core/mmc.c
> >> +++ b/drivers/mmc/core/mmc.c
> >> @@ -286,6 +286,27 @@ 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_ALL:
> >> +     case EXT_CSD_CARD_TYPE_SDR_ALL_DDR_1_8V:
> >> +     case EXT_CSD_CARD_TYPE_SDR_ALL_DDR_1_2V:
> >> +     case EXT_CSD_CARD_TYPE_SDR_ALL_DDR_52:
> >> +             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_ALL:
> >> +     case EXT_CSD_CARD_TYPE

RE: [PATCH V6 1/2] mmc: core: HS200 mode support for eMMC 4.5

2011-12-19 Thread Subhash Jadavani
Hi Girish,

Overall this patch looks good. I have only 2 minor comments inline below.

Regards,
Subhash


> -Original Message-
> From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
> ow...@vger.kernel.org] On Behalf Of Girish K S
> Sent: Monday, December 19, 2011 12:07 PM
> To: linux-...@vger.kernel.org
> Cc: patc...@linaro.org; linux-samsung-soc@vger.kernel.org; Girish K S;
> Chris Ball
> Subject: [PATCH V6 1/2] 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 function
> prototype of the tuning function is modified to handle the tuning
> command
> number which is different in sd and mmc case.
> 
> cc: Chris Ball 
> Signed-off-by: Girish K S 
> ---
>  drivers/mmc/core/bus.c |3 +-
>  drivers/mmc/core/debugfs.c |3 +
>  drivers/mmc/core/mmc.c |  147
> +---
>  drivers/mmc/core/sd.c  |3 +-
>  drivers/mmc/core/sdio.c|4 +-
>  include/linux/mmc/card.h   |3 +
>  include/linux/mmc/mmc.h|   66 +++-
>  7 files changed, 216 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
> index f8a228a..5d011a3 100644
> --- a/drivers/mmc/core/bus.c
> +++ b/drivers/mmc/core/bus.c
> @@ -303,10 +303,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_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/debugfs.c b/drivers/mmc/core/debugfs.c
> index 027615d..9ab5b17 100644
> --- a/drivers/mmc/core/debugfs.c
> +++ b/drivers/mmc/core/debugfs.c
> @@ -135,6 +135,9 @@ static int mmc_ios_show(struct seq_file *s, void
> *data)
>   case MMC_TIMING_UHS_DDR50:
>   str = "sd uhs DDR50";
>   break;
> + case MMC_TIMING_MMC_HS200:
> + str = "mmc high-speed SDR200";
> + break;
>   default:
>   str = "invalid";
>   break;
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index f0a9f1f..d5d93de 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -286,6 +286,27 @@ 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_ALL:
> + case EXT_CSD_CARD_TYPE_SDR_ALL_DDR_1_8V:
> + case EXT_CSD_CARD_TYPE_SDR_ALL_DDR_1_2V:
> + case EXT_CSD_CARD_TYPE_SDR_ALL_DDR_52:
> + 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_ALL:
> + case EXT_CSD_CARD_TYPE_SDR_1_2V_DDR_1_8V:
> + case EXT_CSD_CARD_TYPE_SDR_1_2V_DDR_1_2V:
> + case EXT_CSD_CARD_TYPE_SDR_1_2V_DDR_52:
> + 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_ALL:
> + case EXT_CSD_CARD_TYPE_SDR_1_8V_DDR_1_8V:
> + case EXT_CSD_CARD_TYPE_SDR_1_8V_DDR_1_2V:
> + case EXT_CSD_CARD_TYPE_SDR_1_8V_DDR_52:
> + 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_TYPE_26:
>   card->ext_csd.hs_max_dtr = 5200;
> @@ -700,6 +721,52 @@ static int mmc_select_powerclass(struct mmc_card
> *card,
>  }
> 
>  /*
> + * Selects the desired buswidth and switch to the HS200 mode
> + * if bus width set without error
> + */
> +static int mmc_select_hs200(struct mmc_card *card)
> +{
> + int err = 0;
> + struct mmc_host *host;
> + u32 bus_width = MMC_BUS_WIDTH_4;
> +
> + BUG_ON(!card);
> +
> + host = card->host;
> +
> + /*
> +  * Host is capable of 8bit transfer, then switch
> +  * the device to work in 8bit transfer mode. If the
> +  * mmc switch command returns error then switch to
> +  * 4bit transfer mode. On success set the corresponding
> +  * bus width on the host.
> +  */
> + if (host->caps & MMC_CAP_8_BIT_DATA) {
> + err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
> +  EXT_CSD_BUS_WI

RE: [PATCH] mmc: core: Fix voltage select in DDR mode

2011-12-15 Thread Subhash Jadavani


> -Original Message-
> From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
> ow...@vger.kernel.org] On Behalf Of Girish K S
> Sent: Thursday, December 15, 2011 5:28 PM
> To: linux-...@vger.kernel.org
> Cc: patc...@linaro.org; linux-samsung-soc@vger.kernel.org; Girish K S;
> Philip Rakity; Arindam Nath; Chris Ball
> Subject: [PATCH] mmc: core: Fix voltage select in DDR mode
> 
> This patch fixes the wrong comparison before setting the interface
> voltage in DDR mode.
> 
> The assignment to the variable ddr before comaprison is either
> ddr = MMC_1_2V_DDR_MODE; or ddr == MMC_1_8V_DDR_MODE. But the
> comparison
> is done wth the extended csd value if (ddr ==
> EXT_CSD_CARD_TYPE_DDR_1_2V)
> 
> cc: Philip Rakity 
> cc: Arindam Nath 
> cc: Chris Ball 
> Signed-off-by: Girish K S 
> ---
>  drivers/mmc/core/mmc.c |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index 006e932..f0a9f1f 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -1058,7 +1058,7 @@ static int mmc_init_card(struct mmc_host *host,
> u32 ocr,
>*
>* WARNING: eMMC rules are NOT the same as SD DDR
>*/
> - if (ddr == EXT_CSD_CARD_TYPE_DDR_1_2V) {
> + if (ddr == MMC_1_2V_DDR_MODE) {

Looks fine. 
Acked-by: Subhash Jadavani 

>   err = mmc_set_signal_voltage(host,
>   MMC_SIGNAL_VOLTAGE_120, 0);
>   if (err)
> --
> 1.7.1
> 
> --
> 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

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


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

2011-12-14 Thread Subhash Jadavani
Just a thought (not sure if it's explicitly specified in 4.5 spec or not):
Do we really need to perform bus test in HS200 mode? because in HS200, we
are anyways going to perform the tuning sequence (which achieves what bus
test command does).

Regards,
Subhash

> -Original Message-
> From: Saugata Das [mailto:saugata@linaro.org]
> Sent: Tuesday, December 13, 2011 11:03 AM
> To: Girish K S
> Cc: Subhash Jadavani; linux-...@vger.kernel.org; patc...@linaro.org;
> linux-samsung-soc@vger.kernel.org; Chris Ball
> Subject: Re: [PATCH V5] mmc: core: HS200 mode support for eMMC 4.5
> 
> On 13 December 2011 10:13, Girish K S 
> wrote:
> > On 12 December 2011 12:20, Girish K S
>  wrote:
> >> On 5 December 2011 20:29, Saugata Das 
> wrote:
> >>> Hi Girish
> >>>
> >>> Please refer to Figure 71 (HS200 device output timing) of the MMC-
> 4.5
> >>> spec. It shows that both CMD and DATA[7-0] will have some latency
> till
> >>> valid window. This implies that even the CMD line will need tuning
> for
> >>> reading the response. The specification talks about identifying
> >>> sampling point for data lines by reading tuning blocks. Based on
> host
> >>> controller capability, even the CMD line will get the good sample
> >>> point during the same tuning sequence.
> >>>
> >>> We need to have the tuning done (execute_tuning) soon after
> switching
> >>> to HS200 mode and 200MHz clock.
> >>>
> >> If i make a change as per subhash suggestion"set bus width before
> >> setting the HS200 mode." then it will affect the entire frame work
> of
> >> mmc which is developed as per Annexure A6.1 A.6.2 A.6.3 (mentions
> the
> >> steps for bus initialization). can any of you suggest a way to do
> >> this.
> 
> Note that, we need to make this modification only for HS200 mode. For
> DDR mode, it is required that we keep the current way (i.e. setting
> BUS_WIDTH after HS_TIMING).
> 
> >
> > Any inputs on this
> >
> >>>
> >>> Regards
> >>> Saugata
> >>>
> >>>
> >>> On 5 December 2011 16:59, Subhash Jadavani
>  wrote:
> >>>>
> >>>>
> >>>>> -Original Message-
> >>>>> From: Girish K S [mailto:girish.shivananja...@linaro.org]
> >>>>> Sent: Monday, December 05, 2011 12:20 PM
> >>>>> To: Subhash Jadavani
> >>>>> Cc: linux-...@vger.kernel.org; patc...@linaro.org; linux-samsung-
> >>>>> s...@vger.kernel.org; Chris Ball
> >>>>> Subject: Re: [PATCH V5] mmc: core: HS200 mode support for eMMC
> 4.5
> >>>>>
> >>>>> On 5 December 2011 11:46, Subhash Jadavani
> 
> >>>>> wrote:
> >>>>> >
> >>>>> >
> >>>>> >> -Original Message-
> >>>>> >> From: Girish K S [mailto:girish.shivananja...@linaro.org]
> >>>>> >> Sent: Friday, December 02, 2011 5:08 PM
> >>>>> >> To: Subhash Jadavani
> >>>>> >> Cc: linux-...@vger.kernel.org; patc...@linaro.org; linux-
> samsung-
> >>>>> >> s...@vger.kernel.org; Chris Ball
> >>>>> >> Subject: Re: [PATCH V5] mmc: core: HS200 mode support for eMMC
> 4.5
> >>>>> >>
> >>>>> >> On 2 December 2011 00:02, Subhash Jadavani
> 
> >>>>> >> wrote:
> >>>>> >> >
> >>>>> >> >
> >>>>> >> >> -Original Message-
> >>>>> >> >> From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
> >>>>> >> >> ow...@vger.kernel.org] On Behalf Of Girish K S
> >>>>> >> >> Sent: Thursday, December 01, 2011 7:48 PM
> >>>>> >> >> To: Subhash Jadavani
> >>>>> >> >> Cc: linux-...@vger.kernel.org; patc...@linaro.org; linux-
> samsung-
> >>>>> >> >> s...@vger.kernel.org; Chris Ball
> >>>>> >> >> Subject: Re: [PATCH V5] mmc: core: HS200 mode support for
> eMMC
> >>>>> 4.5
> >>>>> >> >>
> >>>>> >> >> On 1 December 2011 16:27, Subhash Jadavani
> >>>>> 
> >>>>> >> >> wrote:
> >>>>> >> >> >
>

RE: [PATCH V1] mmc: core: Add host capability check for power class

2011-12-14 Thread Subhash Jadavani


> -Original Message-
> From: Girish K S [mailto:girish.shivananja...@linaro.org]
> Sent: Wednesday, December 14, 2011 5:31 PM
> To: linux-...@vger.kernel.org
> Cc: patc...@linaro.org; linux-samsung-soc@vger.kernel.org;
> subha...@codeaurora.org; Girish K S; Chris Ball
> Subject: [PATCH V1] mmc: core: Add host capability check for power
> class
> 
> This patch adds a check whether the host supports maximum current value
> obtained from the device's extended csd register for a selected
> interface
> voltage and frequency.
> 
> cc: Chris Ball 
> Signed-off-by: Girish K S 
> ---
> Changes in v1:
>   reduced the number of comparisons as per Hein's suggestion
> 
>  drivers/mmc/core/mmc.c   |   21 +
>  include/linux/mmc/card.h |4 
>  2 files changed, 25 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index 006e932..e7f1902 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -688,6 +688,27 @@ static int mmc_select_powerclass(struct mmc_card
> *card,
>   pwrclass_val = (pwrclass_val & EXT_CSD_PWR_CL_4BIT_MASK) >>
>   EXT_CSD_PWR_CL_4BIT_SHIFT;
> 
> + if (pwrclass_val >= MMC_MAX_CURRENT_800)
> + pwrclass_val = MMC_MAX_CURRENT_800;
> + else if (pwrclass_val >= MMC_MAX_CURRENT_600)
> + pwrclass_val = MMC_MAX_CURRENT_600;
> + else if (pwrclass_val >= MMC_MAX_CURRENT_400)
> + pwrclass_val = MMC_MAX_CURRENT_400;
> + else if (pwrclass_val >= MMC_MAX_CURRENT_200)
> + pwrclass_val = MMC_MAX_CURRENT_200;
> + else
> + pwrclass_val = MMC_MAX_CURRENT_200;

Last else if and else can be combined as they are assigning the same value
to pwrclass_val.

> +
> + if ((pwrclass_val == MMC_MAX_CURRENT_800) &&
> + !(card->host->caps & MMC_CAP_MAX_CURRENT_800))
> + pwrclass_val = MMC_MAX_CURRENT_600;
> + if ((pwrclass_val == MMC_MAX_CURRENT_600) &&
> + !(card->host->caps & MMC_CAP_MAX_CURRENT_600))
> + pwrclass_val = MMC_MAX_CURRENT_400;
> + if ((pwrclass_val == MMC_MAX_CURRENT_400) &&
> + !(card->host->caps & MMC_CAP_MAX_CURRENT_400))
> + pwrclass_val = MMC_MAX_CURRENT_200;
> +
>   /* If the power class is different from the default value */
>   if (pwrclass_val > 0) {
>   err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
> diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
> index 9478a6b..c5e031a 100644
> --- a/include/linux/mmc/card.h
> +++ b/include/linux/mmc/card.h
> @@ -195,6 +195,10 @@ struct mmc_part {
>  #define MMC_BLK_DATA_AREA_GP (1<<2)
>  };
> 
> +#define MMC_MAX_CURRENT_200  (0)
> +#define MMC_MAX_CURRENT_400  (7)
> +#define MMC_MAX_CURRENT_600  (11)
> +#define MMC_MAX_CURRENT_800  (13)
>  /*
>   * MMC device
>   */
> --
> 1.7.1


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


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

2011-12-05 Thread Subhash Jadavani


> -Original Message-
> From: Girish K S [mailto:girish.shivananja...@linaro.org]
> Sent: Monday, December 05, 2011 12:20 PM
> To: Subhash Jadavani
> Cc: linux-...@vger.kernel.org; patc...@linaro.org; linux-samsung-
> s...@vger.kernel.org; Chris Ball
> Subject: Re: [PATCH V5] mmc: core: HS200 mode support for eMMC 4.5
> 
> On 5 December 2011 11:46, Subhash Jadavani 
> wrote:
> >
> >
> >> -Original Message-
> >> From: Girish K S [mailto:girish.shivananja...@linaro.org]
> >> Sent: Friday, December 02, 2011 5:08 PM
> >> To: Subhash Jadavani
> >> Cc: linux-...@vger.kernel.org; patc...@linaro.org; linux-samsung-
> >> s...@vger.kernel.org; Chris Ball
> >> Subject: Re: [PATCH V5] mmc: core: HS200 mode support for eMMC 4.5
> >>
> >> On 2 December 2011 00:02, Subhash Jadavani 
> >> wrote:
> >> >
> >> >
> >> >> -Original Message-
> >> >> From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
> >> >> ow...@vger.kernel.org] On Behalf Of Girish K S
> >> >> Sent: Thursday, December 01, 2011 7:48 PM
> >> >> To: Subhash Jadavani
> >> >> Cc: linux-...@vger.kernel.org; patc...@linaro.org; linux-samsung-
> >> >> s...@vger.kernel.org; Chris Ball
> >> >> Subject: Re: [PATCH V5] mmc: core: HS200 mode support for eMMC
> 4.5
> >> >>
> >> >> On 1 December 2011 16:27, Subhash Jadavani
> 
> >> >> wrote:
> >> >> >
> >> >> >
> >> >> >> -Original Message-
> >> >> >> From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
> >> >> >> ow...@vger.kernel.org] On Behalf Of Girish K S
> >> >> >> Sent: Thursday, December 01, 2011 3:58 PM
> >> >> >> To: Subhash Jadavani
> >> >> >> Cc: linux-...@vger.kernel.org; patc...@linaro.org; linux-
> samsung-
> >> >> >> s...@vger.kernel.org; Chris Ball
> >> >> >> Subject: Re: [PATCH V5] mmc: core: HS200 mode support for eMMC
> >> 4.5
> >> >> >>
> >> >> >> On 1 December 2011 15:33, 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, November 30, 2011 2:24 PM
> >> >> >> >> To: linux-...@vger.kernel.org
> >> >> >> >> Cc: patc...@linaro.org; linux-samsung-soc@vger.kernel.org;
> >> >> >> >> subha...@codeaurora.org; Girish K S; Chris Ball
> >> >> >> >> Subject: [PATCH V5] 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.
> >> >> >> >>
> >> >> >> >> cc: Chris Ball 
> >> >> >> >> Signed-off-by: Girish K S 
> >> >> >> >> ---
> >> >> >> >> Changes in v5:
> >> >> >> >>       Reduced the case statements for better code
> readability.
> >> >> >> Removed
> >> >> >> >>       unused macro definitions. Modified the tuning
> function
> >> >> >> prototype
> >> >> >> >>       and definition to support tuning for both SD and eMMC
> >> >> cards.
> >> >> >> >> Changes in v4

RE: [PATCH V5] mmc: core: eMMC 4.5 Power Class Selection Feature

2011-12-04 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: Friday, September 23, 2011 8:42 PM
> To: linux-...@vger.kernel.org
> Cc: c...@laptop.org; kgene@samsung.com; patc...@linaro.org; linux-
> samsung-...@vger.kernel.org; Girish K S
> Subject: [PATCH V5] mmc: core: eMMC 4.5 Power Class Selection Feature
> 
> This patch adds the power class selection feature available
> for mmc versions 4.0 and above.
> During the enumeration stage before switching to the lower
> data bus, check if the power class is supported for the
> current bus width. If the power class is available then
> switch to the power class and use the higher data bus. If
> power class is not supported then switch to the lower data
> bus in a worst case.
> 
> Signed-off-by: Girish K S 
> ---
> Changes in v1:
> This version modifies the power_class_select function
> prototype.
> During device enumeration, when the host tries to read the
> extended
> csd register after switching to higher bus width, the read
> fails at
> higher bus width. So the power_class_select function is
> modified to
> reuse the extended csd register values read with 1 bit bus
> width.
> 
> Changes in v2:
> This patch version removes some checkpatch error
> 
> Changes in v3:
> updated with review comments made by chris ball. patch
> generated
> by rebasing to chris balls mmc-next branch.
> 
> Changes in v4:
> updated with review comments.
> 
> Changes in v5:
> Replace break statement with appropriate return error value in
>   drivers/mmc/core/mmc.c for unsupported voltage range.
> 
>  drivers/mmc/core/mmc.c  |   96
> +++
>  include/linux/mmc/mmc.h |   14 +++
>  2 files changed, 110 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index 7adc30d..c2334d6 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -532,6 +532,86 @@ static struct device_type mmc_type = {
>  };
> 
>  /*
> + * Select the PowerClass for the current bus width
> + * If power class is defined for 4/8 bit bus in the
> + * extended CSD register, select it by executing the
> + * mmc_switch command.
> + */
> +static int mmc_select_powerclass(struct mmc_card *card,
> + unsigned int bus_width, u8 *ext_csd)
> +{
> + int err = 0;
> + unsigned int pwrclass_val;
> + unsigned int index = 0;
> + struct mmc_host *host;
> +
> + BUG_ON(!card);
> +
> + host = card->host;
> + BUG_ON(!host);
> +
> + if (ext_csd == NULL)
> + return 0;
> +
> + /* Power class selection is supported for versions >= 4.0 */
> + if (card->csd.mmca_vsn < CSD_SPEC_VER_4)
> + return 0;
> +
> + /* Power class values are defined only for 4/8 bit bus */
> + if (bus_width == EXT_CSD_BUS_WIDTH_1)
> + return 0;
> +
> + switch (1 << host->ios.vdd) {
> + case MMC_VDD_165_195:
> + if (host->ios.clock <= 2600)
> + index = EXT_CSD_PWR_CL_26_195;
> + else if (host->ios.clock <= 5200)
> + index = (bus_width <= EXT_CSD_BUS_WIDTH_8) ?
> + EXT_CSD_PWR_CL_52_195 :
> + EXT_CSD_PWR_CL_DDR_52_195;
> + else if (host->ios.clock <= 2)
> + index = EXT_CSD_PWR_CL_200_195;
> + break;
> + case MMC_VDD_32_33:
> + case MMC_VDD_33_34:
> + case MMC_VDD_34_35:
> + case MMC_VDD_35_36:
> + if (host->ios.clock <= 2600)
> + index = EXT_CSD_PWR_CL_26_360;
> + else if (host->ios.clock <= 5200)
> + index = (bus_width <= EXT_CSD_BUS_WIDTH_8) ?
> + EXT_CSD_PWR_CL_52_360 :
> + EXT_CSD_PWR_CL_DDR_52_360;
> + else if (host->ios.clock <= 2)
> + index = EXT_CSD_PWR_CL_200_360;
> + break;
> + default:
> + pr_warning("%s: Voltage range not supported "
> +"for power class.\n", mmc_hostname(host));
> + return -EINVAL;
> + }
> +
> + pwrclass_val = ext_csd[index];
> +
> + if (bus_width & (EXT_CSD_BUS_WIDTH_8 | EXT_CSD_DDR_BUS_WIDTH_8))
> + pwrclass_val = (pwrclass_val & EXT_CSD_PWR_CL_8BIT_MASK) >>
> + EXT_CSD_PWR_CL_8BIT_SHIFT;
> + else
> + pwrclass_val = (pwrclass_val & EXT_CSD_PWR_CL_4BIT_MASK) >>
> + EXT_CSD_PWR_CL_4BIT_SHIFT;
> +
> + /* If the power class is different from the default value */
> + if (pwrclass_val > 0) {
> + err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
> +  EXT_CSD_POWER_CLASS,
> +  pwrc

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

2011-12-04 Thread Subhash Jadavani


> -Original Message-
> From: Girish K S [mailto:girish.shivananja...@linaro.org]
> Sent: Friday, December 02, 2011 5:08 PM
> To: Subhash Jadavani
> Cc: linux-...@vger.kernel.org; patc...@linaro.org; linux-samsung-
> s...@vger.kernel.org; Chris Ball
> Subject: Re: [PATCH V5] mmc: core: HS200 mode support for eMMC 4.5
> 
> On 2 December 2011 00:02, Subhash Jadavani 
> wrote:
> >
> >
> >> -Original Message-
> >> From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
> >> ow...@vger.kernel.org] On Behalf Of Girish K S
> >> Sent: Thursday, December 01, 2011 7:48 PM
> >> To: Subhash Jadavani
> >> Cc: linux-...@vger.kernel.org; patc...@linaro.org; linux-samsung-
> >> s...@vger.kernel.org; Chris Ball
> >> Subject: Re: [PATCH V5] mmc: core: HS200 mode support for eMMC 4.5
> >>
> >> On 1 December 2011 16:27, Subhash Jadavani 
> >> wrote:
> >> >
> >> >
> >> >> -Original Message-
> >> >> From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
> >> >> ow...@vger.kernel.org] On Behalf Of Girish K S
> >> >> Sent: Thursday, December 01, 2011 3:58 PM
> >> >> To: Subhash Jadavani
> >> >> Cc: linux-...@vger.kernel.org; patc...@linaro.org; linux-samsung-
> >> >> s...@vger.kernel.org; Chris Ball
> >> >> Subject: Re: [PATCH V5] mmc: core: HS200 mode support for eMMC
> 4.5
> >> >>
> >> >> On 1 December 2011 15:33, 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, November 30, 2011 2:24 PM
> >> >> >> To: linux-...@vger.kernel.org
> >> >> >> Cc: patc...@linaro.org; linux-samsung-soc@vger.kernel.org;
> >> >> >> subha...@codeaurora.org; Girish K S; Chris Ball
> >> >> >> Subject: [PATCH V5] 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.
> >> >> >>
> >> >> >> cc: Chris Ball 
> >> >> >> Signed-off-by: Girish K S 
> >> >> >> ---
> >> >> >> Changes in v5:
> >> >> >>       Reduced the case statements for better code readability.
> >> >> Removed
> >> >> >>       unused macro definitions. Modified the tuning function
> >> >> prototype
> >> >> >>       and definition to support tuning for both SD and eMMC
> >> cards.
> >> >> >> 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
> >>

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

2011-12-01 Thread Subhash Jadavani


> -Original Message-
> From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
> ow...@vger.kernel.org] On Behalf Of Girish K S
> Sent: Thursday, December 01, 2011 7:48 PM
> To: Subhash Jadavani
> Cc: linux-...@vger.kernel.org; patc...@linaro.org; linux-samsung-
> s...@vger.kernel.org; Chris Ball
> Subject: Re: [PATCH V5] mmc: core: HS200 mode support for eMMC 4.5
> 
> On 1 December 2011 16:27, Subhash Jadavani 
> wrote:
> >
> >
> >> -Original Message-
> >> From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
> >> ow...@vger.kernel.org] On Behalf Of Girish K S
> >> Sent: Thursday, December 01, 2011 3:58 PM
> >> To: Subhash Jadavani
> >> Cc: linux-...@vger.kernel.org; patc...@linaro.org; linux-samsung-
> >> s...@vger.kernel.org; Chris Ball
> >> Subject: Re: [PATCH V5] mmc: core: HS200 mode support for eMMC 4.5
> >>
> >> On 1 December 2011 15:33, 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, November 30, 2011 2:24 PM
> >> >> To: linux-...@vger.kernel.org
> >> >> Cc: patc...@linaro.org; linux-samsung-soc@vger.kernel.org;
> >> >> subha...@codeaurora.org; Girish K S; Chris Ball
> >> >> Subject: [PATCH V5] 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.
> >> >>
> >> >> cc: Chris Ball 
> >> >> Signed-off-by: Girish K S 
> >> >> ---
> >> >> Changes in v5:
> >> >>       Reduced the case statements for better code readability.
> >> Removed
> >> >>       unused macro definitions. Modified the tuning function
> >> prototype
> >> >>       and definition to support tuning for both SD and eMMC
> cards.
> >> >> 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    |   77
> >> >> 
> >> >>  drivers/mmc/core/sd.c     |    3 +-
> >> >>  drivers/mmc/core/sdio.c   |    4 ++-
> >> >>  drivers/mmc/host/sdhci.c  |   38 +-
> >> >>  include/linux/mmc/card.h  |    3 ++
> >> >>  include/linux/mmc/host.h  |   11 ++-
> >> >>  include/linux/mmc/mmc.h   |   66
> >> >> ++-
> >> >>  include/linux/mm

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

2011-12-01 Thread Subhash Jadavani


> -Original Message-
> From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
> ow...@vger.kernel.org] On Behalf Of Girish K S
> Sent: Thursday, December 01, 2011 3:58 PM
> To: Subhash Jadavani
> Cc: linux-...@vger.kernel.org; patc...@linaro.org; linux-samsung-
> s...@vger.kernel.org; Chris Ball
> Subject: Re: [PATCH V5] mmc: core: HS200 mode support for eMMC 4.5
> 
> On 1 December 2011 15:33, 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, November 30, 2011 2:24 PM
> >> To: linux-...@vger.kernel.org
> >> Cc: patc...@linaro.org; linux-samsung-soc@vger.kernel.org;
> >> subha...@codeaurora.org; Girish K S; Chris Ball
> >> Subject: [PATCH V5] 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.
> >>
> >> cc: Chris Ball 
> >> Signed-off-by: Girish K S 
> >> ---
> >> Changes in v5:
> >>       Reduced the case statements for better code readability.
> Removed
> >>       unused macro definitions. Modified the tuning function
> prototype
> >>       and definition to support tuning for both SD and eMMC cards.
> >> 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    |   77
> >> 
> >>  drivers/mmc/core/sd.c     |    3 +-
> >>  drivers/mmc/core/sdio.c   |    4 ++-
> >>  drivers/mmc/host/sdhci.c  |   38 +-
> >>  include/linux/mmc/card.h  |    3 ++
> >>  include/linux/mmc/host.h  |   11 ++-
> >>  include/linux/mmc/mmc.h   |   66
> >> ++-
> >>  include/linux/mmc/sdhci.h |    1 +
> >>  9 files changed, 185 insertions(+), 21 deletions(-)
> >>
> >> diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
> >> index 5639fdf..83c9f8d 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_card_uhs(card) ? "ultra high speed " :
> >>                       (mmc_card_highspeed(card) ? "high speed " :
> ""),
> >> +                     (mmc_card_hs200(card) ? "HS200 " : ""),
> >>                       mmc_card_ddr_mode(card) ? "DDR " : "",
> >>                       ty

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

2011-12-01 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, November 30, 2011 2:24 PM
> To: linux-...@vger.kernel.org
> Cc: patc...@linaro.org; linux-samsung-soc@vger.kernel.org;
> subha...@codeaurora.org; Girish K S; Chris Ball
> Subject: [PATCH V5] 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.
> 
> cc: Chris Ball 
> Signed-off-by: Girish K S 
> ---
> Changes in v5:
>   Reduced the case statements for better code readability. Removed
>   unused macro definitions. Modified the tuning function prototype
>   and definition to support tuning for both SD and eMMC cards.
> 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|   77
> 
>  drivers/mmc/core/sd.c |3 +-
>  drivers/mmc/core/sdio.c   |4 ++-
>  drivers/mmc/host/sdhci.c  |   38 +-
>  include/linux/mmc/card.h  |3 ++
>  include/linux/mmc/host.h  |   11 ++-
>  include/linux/mmc/mmc.h   |   66
> ++-
>  include/linux/mmc/sdhci.h |1 +
>  9 files changed, 185 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
> index 5639fdf..83c9f8d 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_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 a1223bd..f4124d6 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -285,6 +285,27 @@ 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_ALL:
> + case EXT_CSD_CARD_TYPE_SDR_ALL_DDR_1_8V:
> + case EXT_CSD_CARD_TYPE_SDR_ALL_DDR_1_2V:
> + case EXT_CSD_CARD_TYPE_SDR_ALL_DDR_52:
> + 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_ALL:
> + case EXT_CSD_CARD_TYPE_SDR_1_2V_DDR_1_8V:
> + case EXT_CSD_CARD_TYPE_SDR_1_2V_DDR_1_2V:
> + case EXT_CSD_CARD_TYPE_SDR_1_2V_DDR_52:
> + 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_ALL:
> + case EXT_CSD_CARD_TYPE_SDR_1_8V_DDR_1_8V:
> + case EXT_CSD_CARD_TYPE_SDR_1_8V_DDR_1_2V:
> + case EXT_CSD_CARD_TYPE_SDR_1_8V_DDR_52:
> + 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_TYPE_26:
>   card->ext_csd.hs_max_dtr = 5200;
> @@ -699,6 +720,7 @@ static int

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-...@vger.kernel.org; c...@laptop.org; patc...@linaro.org;
> linux-samsung-soc@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-...@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-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-...@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-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-...@vger.kernel.org; c...@laptop.org; patc...@linaro.org;
> linux-samsung-soc@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:
> > +   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_TY

RE: [PATCH] mmc: core: Fix power_off_notify during suspend

2011-11-15 Thread Subhash Jadavani
Chris, Girish,

I have question here. Are these eMMC4.5 related patches are getting tested
with real eMMC4.5 cards?

Regards,
Subhash

> -Original Message-
> From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
> ow...@vger.kernel.org] On Behalf Of Chris Ball
> Sent: Tuesday, November 15, 2011 6:47 PM
> To: Girish K S
> Cc: linux-...@vger.kernel.org; patc...@linaro.org; linux-samsung-
> s...@vger.kernel.org
> Subject: Re: [PATCH] mmc: core: Fix power_off_notify during suspend
> 
> Hi,
> 
> On Tue, Nov 15 2011, Girish K S wrote:
> > The eMMC 4.5 devices respond to only RESET and AWAKE command in the
> sleep
> > state. Hence the mmc switch command to notify power off state should
> be sent
> > before the device enters sleep state.
> >
> > This patch fixes the same.
> >
> > Signed-off-by: Girish K S 
> 
> Thanks, pushed to mmc-next for 3.2.
> 
> - 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

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