* [U-Boot] [U-BOOT][PATCH] mmc: support the revision check for eMMC4.5
@ 2012-03-27 7:16 Jaehoon Chung
2012-04-02 18:35 ` Jae hoon Chung
0 siblings, 1 reply; 4+ messages in thread
From: Jaehoon Chung @ 2012-03-27 7:16 UTC (permalink / raw)
To: u-boot
eMMC card is introduced the eMMC4.5.
But now eMMC card is checked up to eMMC4.0.
This patch is supported until eMMC4.5
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
common/cmd_mmc.c | 5 ++++-
drivers/mmc/mmc.c | 25 +++++++++++++++++++++++++
include/mmc.h | 8 ++++++++
3 files changed, 37 insertions(+), 1 deletions(-)
diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
index 8f13c22..ff150ca 100644
--- a/common/cmd_mmc.c
+++ b/common/cmd_mmc.c
@@ -106,7 +106,10 @@ static void print_mmcinfo(struct mmc *mmc)
printf("Rd Block Len: %d\n", mmc->read_bl_len);
printf("%s version %d.%d\n", IS_SD(mmc) ? "SD" : "MMC",
- (mmc->version >> 4) & 0xf, mmc->version & 0xf);
+ (mmc->version >> 4) & 0xf,
+ (mmc->version & 0xf) == EXT_CSD_REV_1_5 ?
+ 41 :((mmc->version & 0xf) > EXT_CSD_REV_1_5 ?
+ (mmc->version & 0xf) - 1 : (mmc->version & 0xf)));
printf("High Capacity: %s\n", mmc->high_capacity ? "Yes" : "No");
puts("Capacity: ");
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 49c3349..e035012 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -651,6 +651,31 @@ int mmc_change_freq(struct mmc *mmc)
if (err)
return err;
+ switch (ext_csd[EXT_CSD_REV]) {
+ case EXT_CSD_REV_1_0:
+ mmc->version |= EXT_CSD_REV_1_0;
+ break;
+ case EXT_CSD_REV_1_1:
+ mmc->version |= EXT_CSD_REV_1_1;
+ break;
+ case EXT_CSD_REV_1_2:
+ mmc->version |= EXT_CSD_REV_1_2;
+ break;
+ case EXT_CSD_REV_1_3:
+ mmc->version |= EXT_CSD_REV_1_3;
+ break;
+ case EXT_CSD_REV_1_5:
+ mmc->version |= EXT_CSD_REV_1_5;
+ break;
+ case EXT_CSD_REV_1_6:
+ mmc->version |= EXT_CSD_REV_1_6;
+ break;
+ case EXT_CSD_REV_1_4:
+ default:
+ printf("Unknown revision - %x\n", ext_csd[EXT_CSD_REV]);
+ return 0;
+ }
+
/* No high-speed support */
if (!ext_csd[EXT_CSD_HS_TIMING])
return 0;
diff --git a/include/mmc.h b/include/mmc.h
index 30c2375..726da99 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -157,6 +157,14 @@
#define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */
#define EXT_CSD_HC_ERASE_GRP_SIZE 224 /* RO */
+#define EXT_CSD_REV_1_0 0
+#define EXT_CSD_REV_1_1 1
+#define EXT_CSD_REV_1_2 2
+#define EXT_CSD_REV_1_3 3
+#define EXT_CSD_REV_1_4 4
+#define EXT_CSD_REV_1_5 5
+#define EXT_CSD_REV_1_6 6
+
/*
* EXT_CSD field definitions
*/
--
1.7.4.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* [U-Boot] [U-BOOT][PATCH] mmc: support the revision check for eMMC4.5
2012-03-27 7:16 [U-Boot] [U-BOOT][PATCH] mmc: support the revision check for eMMC4.5 Jaehoon Chung
@ 2012-04-02 18:35 ` Jae hoon Chung
2012-09-01 6:15 ` Marek Vasut
0 siblings, 1 reply; 4+ messages in thread
From: Jae hoon Chung @ 2012-04-02 18:35 UTC (permalink / raw)
To: u-boot
Hi,
Anybody think about this patch?
mmcinfo is produce correctly?
if i miss something, let me know, plz.
Best Regards,
Jaehoon Chung
2012/3/27 Jaehoon Chung <jh80.chung@samsung.com>:
> eMMC card is introduced the eMMC4.5.
> But now eMMC card is checked up to eMMC4.0.
> This patch is supported until eMMC4.5
>
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> ?common/cmd_mmc.c ?| ? ?5 ++++-
> ?drivers/mmc/mmc.c | ? 25 +++++++++++++++++++++++++
> ?include/mmc.h ? ? | ? ?8 ++++++++
> ?3 files changed, 37 insertions(+), 1 deletions(-)
>
> diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
> index 8f13c22..ff150ca 100644
> --- a/common/cmd_mmc.c
> +++ b/common/cmd_mmc.c
> @@ -106,7 +106,10 @@ static void print_mmcinfo(struct mmc *mmc)
> ? ? ? ?printf("Rd Block Len: %d\n", mmc->read_bl_len);
>
> ? ? ? ?printf("%s version %d.%d\n", IS_SD(mmc) ? "SD" : "MMC",
> - ? ? ? ? ? ? ? ? ? ? ? (mmc->version >> 4) & 0xf, mmc->version & 0xf);
> + ? ? ? ? ? ? ? ? ? ? ? (mmc->version >> 4) & 0xf,
> + ? ? ? ? ? ? ? ? ? ? ? (mmc->version & 0xf) == EXT_CSD_REV_1_5 ?
> + ? ? ? ? ? ? ? ? ? ? ? 41 :((mmc->version & 0xf) > EXT_CSD_REV_1_5 ?
> + ? ? ? ? ? ? ? ? ? ? ? (mmc->version & 0xf) - 1 : (mmc->version & 0xf)));
>
> ? ? ? ?printf("High Capacity: %s\n", mmc->high_capacity ? "Yes" : "No");
> ? ? ? ?puts("Capacity: ");
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index 49c3349..e035012 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -651,6 +651,31 @@ int mmc_change_freq(struct mmc *mmc)
> ? ? ? ?if (err)
> ? ? ? ? ? ? ? ?return err;
>
> + ? ? ? switch (ext_csd[EXT_CSD_REV]) {
> + ? ? ? case EXT_CSD_REV_1_0:
> + ? ? ? ? ? ? ? mmc->version |= EXT_CSD_REV_1_0;
> + ? ? ? ? ? ? ? break;
> + ? ? ? case EXT_CSD_REV_1_1:
> + ? ? ? ? ? ? ? mmc->version |= EXT_CSD_REV_1_1;
> + ? ? ? ? ? ? ? break;
> + ? ? ? case EXT_CSD_REV_1_2:
> + ? ? ? ? ? ? ? mmc->version |= EXT_CSD_REV_1_2;
> + ? ? ? ? ? ? ? break;
> + ? ? ? case EXT_CSD_REV_1_3:
> + ? ? ? ? ? ? ? mmc->version |= EXT_CSD_REV_1_3;
> + ? ? ? ? ? ? ? break;
> + ? ? ? case EXT_CSD_REV_1_5:
> + ? ? ? ? ? ? ? mmc->version |= EXT_CSD_REV_1_5;
> + ? ? ? ? ? ? ? break;
> + ? ? ? case EXT_CSD_REV_1_6:
> + ? ? ? ? ? ? ? mmc->version |= EXT_CSD_REV_1_6;
> + ? ? ? ? ? ? ? break;
> + ? ? ? case EXT_CSD_REV_1_4:
> + ? ? ? default:
> + ? ? ? ? ? ? ? printf("Unknown revision - %x\n", ext_csd[EXT_CSD_REV]);
> + ? ? ? ? ? ? ? return 0;
> + ? ? ? }
> +
> ? ? ? ?/* No high-speed support */
> ? ? ? ?if (!ext_csd[EXT_CSD_HS_TIMING])
> ? ? ? ? ? ? ? ?return 0;
> diff --git a/include/mmc.h b/include/mmc.h
> index 30c2375..726da99 100644
> --- a/include/mmc.h
> +++ b/include/mmc.h
> @@ -157,6 +157,14 @@
> ?#define EXT_CSD_SEC_CNT ? ? ? ? ? ? ? ? ? ? ? ?212 ? ? /* RO, 4 bytes */
> ?#define EXT_CSD_HC_ERASE_GRP_SIZE ? ? ?224 ? ? /* RO */
>
> +#define EXT_CSD_REV_1_0 ? ? ? ? ? ? ? ? ? ? ? ?0
> +#define EXT_CSD_REV_1_1 ? ? ? ? ? ? ? ? ? ? ? ?1
> +#define EXT_CSD_REV_1_2 ? ? ? ? ? ? ? ? ? ? ? ?2
> +#define EXT_CSD_REV_1_3 ? ? ? ? ? ? ? ? ? ? ? ?3
> +#define EXT_CSD_REV_1_4 ? ? ? ? ? ? ? ? ? ? ? ?4
> +#define EXT_CSD_REV_1_5 ? ? ? ? ? ? ? ? ? ? ? ?5
> +#define EXT_CSD_REV_1_6 ? ? ? ? ? ? ? ? ? ? ? ?6
> +
> ?/*
> ?* EXT_CSD field definitions
> ?*/
> --
> 1.7.4.1
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
^ permalink raw reply [flat|nested] 4+ messages in thread* [U-Boot] [U-BOOT][PATCH] mmc: support the revision check for eMMC4.5
2012-04-02 18:35 ` Jae hoon Chung
@ 2012-09-01 6:15 ` Marek Vasut
2012-09-03 5:32 ` Jaehoon Chung
0 siblings, 1 reply; 4+ messages in thread
From: Marek Vasut @ 2012-09-01 6:15 UTC (permalink / raw)
To: u-boot
Dear Jae hoon Chung,
> Hi,
>
> Anybody think about this patch?
> mmcinfo is produce correctly?
>
> if i miss something, let me know, plz.
Andy?
> Best Regards,
> Jaehoon Chung
>
> 2012/3/27 Jaehoon Chung <jh80.chung@samsung.com>:
> > eMMC card is introduced the eMMC4.5.
> > But now eMMC card is checked up to eMMC4.0.
> > This patch is supported until eMMC4.5
> >
> > Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> > ---
> > common/cmd_mmc.c | 5 ++++-
> > drivers/mmc/mmc.c | 25 +++++++++++++++++++++++++
> > include/mmc.h | 8 ++++++++
> > 3 files changed, 37 insertions(+), 1 deletions(-)
> >
> > diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
> > index 8f13c22..ff150ca 100644
> > --- a/common/cmd_mmc.c
> > +++ b/common/cmd_mmc.c
> > @@ -106,7 +106,10 @@ static void print_mmcinfo(struct mmc *mmc)
> > printf("Rd Block Len: %d\n", mmc->read_bl_len);
> >
> > printf("%s version %d.%d\n", IS_SD(mmc) ? "SD" : "MMC",
> > - (mmc->version >> 4) & 0xf, mmc->version & 0xf);
> > + (mmc->version >> 4) & 0xf,
> > + (mmc->version & 0xf) == EXT_CSD_REV_1_5 ?
> > + 41 :((mmc->version & 0xf) > EXT_CSD_REV_1_5 ?
> > + (mmc->version & 0xf) - 1 : (mmc->version &
> > 0xf)));
> >
> > printf("High Capacity: %s\n", mmc->high_capacity ? "Yes" : "No");
> > puts("Capacity: ");
> > diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> > index 49c3349..e035012 100644
> > --- a/drivers/mmc/mmc.c
> > +++ b/drivers/mmc/mmc.c
> > @@ -651,6 +651,31 @@ int mmc_change_freq(struct mmc *mmc)
> > if (err)
> > return err;
> >
> > + switch (ext_csd[EXT_CSD_REV]) {
> > + case EXT_CSD_REV_1_0:
> > + mmc->version |= EXT_CSD_REV_1_0;
> > + break;
> > + case EXT_CSD_REV_1_1:
> > + mmc->version |= EXT_CSD_REV_1_1;
> > + break;
> > + case EXT_CSD_REV_1_2:
> > + mmc->version |= EXT_CSD_REV_1_2;
> > + break;
> > + case EXT_CSD_REV_1_3:
> > + mmc->version |= EXT_CSD_REV_1_3;
> > + break;
> > + case EXT_CSD_REV_1_5:
> > + mmc->version |= EXT_CSD_REV_1_5;
> > + break;
> > + case EXT_CSD_REV_1_6:
> > + mmc->version |= EXT_CSD_REV_1_6;
> > + break;
> > + case EXT_CSD_REV_1_4:
> > + default:
> > + printf("Unknown revision - %x\n", ext_csd[EXT_CSD_REV]);
> > + return 0;
> > + }
> > +
> > /* No high-speed support */
> > if (!ext_csd[EXT_CSD_HS_TIMING])
> > return 0;
> > diff --git a/include/mmc.h b/include/mmc.h
> > index 30c2375..726da99 100644
> > --- a/include/mmc.h
> > +++ b/include/mmc.h
> > @@ -157,6 +157,14 @@
> > #define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */
> > #define EXT_CSD_HC_ERASE_GRP_SIZE 224 /* RO */
> >
> > +#define EXT_CSD_REV_1_0 0
> > +#define EXT_CSD_REV_1_1 1
> > +#define EXT_CSD_REV_1_2 2
> > +#define EXT_CSD_REV_1_3 3
> > +#define EXT_CSD_REV_1_4 4
> > +#define EXT_CSD_REV_1_5 5
> > +#define EXT_CSD_REV_1_6 6
> > +
> > /*
> > * EXT_CSD field definitions
> > */
> > --
> > 1.7.4.1
> > _______________________________________________
> > U-Boot mailing list
> > U-Boot at lists.denx.de
> > http://lists.denx.de/mailman/listinfo/u-boot
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
^ permalink raw reply [flat|nested] 4+ messages in thread* [U-Boot] [U-BOOT][PATCH] mmc: support the revision check for eMMC4.5
2012-09-01 6:15 ` Marek Vasut
@ 2012-09-03 5:32 ` Jaehoon Chung
0 siblings, 0 replies; 4+ messages in thread
From: Jaehoon Chung @ 2012-09-03 5:32 UTC (permalink / raw)
To: u-boot
Hi Marek,
I will resend this patch with Andy's comment.
If you have any other opinion, let me know plz.
Best Regards,
Jaehoon Chung
On 09/01/2012 03:15 PM, Marek Vasut wrote:
> Dear Jae hoon Chung,
>
>> Hi,
>>
>> Anybody think about this patch?
>> mmcinfo is produce correctly?
>>
>> if i miss something, let me know, plz.
>
> Andy?
>
>> Best Regards,
>> Jaehoon Chung
>>
>> 2012/3/27 Jaehoon Chung <jh80.chung@samsung.com>:
>>> eMMC card is introduced the eMMC4.5.
>>> But now eMMC card is checked up to eMMC4.0.
>>> This patch is supported until eMMC4.5
>>>
>>> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
>>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>>> ---
>>> common/cmd_mmc.c | 5 ++++-
>>> drivers/mmc/mmc.c | 25 +++++++++++++++++++++++++
>>> include/mmc.h | 8 ++++++++
>>> 3 files changed, 37 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
>>> index 8f13c22..ff150ca 100644
>>> --- a/common/cmd_mmc.c
>>> +++ b/common/cmd_mmc.c
>>> @@ -106,7 +106,10 @@ static void print_mmcinfo(struct mmc *mmc)
>>> printf("Rd Block Len: %d\n", mmc->read_bl_len);
>>>
>>> printf("%s version %d.%d\n", IS_SD(mmc) ? "SD" : "MMC",
>>> - (mmc->version >> 4) & 0xf, mmc->version & 0xf);
>>> + (mmc->version >> 4) & 0xf,
>>> + (mmc->version & 0xf) == EXT_CSD_REV_1_5 ?
>>> + 41 :((mmc->version & 0xf) > EXT_CSD_REV_1_5 ?
>>> + (mmc->version & 0xf) - 1 : (mmc->version &
>>> 0xf)));
>>>
>>> printf("High Capacity: %s\n", mmc->high_capacity ? "Yes" : "No");
>>> puts("Capacity: ");
>>> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
>>> index 49c3349..e035012 100644
>>> --- a/drivers/mmc/mmc.c
>>> +++ b/drivers/mmc/mmc.c
>>> @@ -651,6 +651,31 @@ int mmc_change_freq(struct mmc *mmc)
>>> if (err)
>>> return err;
>>>
>>> + switch (ext_csd[EXT_CSD_REV]) {
>>> + case EXT_CSD_REV_1_0:
>>> + mmc->version |= EXT_CSD_REV_1_0;
>>> + break;
>>> + case EXT_CSD_REV_1_1:
>>> + mmc->version |= EXT_CSD_REV_1_1;
>>> + break;
>>> + case EXT_CSD_REV_1_2:
>>> + mmc->version |= EXT_CSD_REV_1_2;
>>> + break;
>>> + case EXT_CSD_REV_1_3:
>>> + mmc->version |= EXT_CSD_REV_1_3;
>>> + break;
>>> + case EXT_CSD_REV_1_5:
>>> + mmc->version |= EXT_CSD_REV_1_5;
>>> + break;
>>> + case EXT_CSD_REV_1_6:
>>> + mmc->version |= EXT_CSD_REV_1_6;
>>> + break;
>>> + case EXT_CSD_REV_1_4:
>>> + default:
>>> + printf("Unknown revision - %x\n", ext_csd[EXT_CSD_REV]);
>>> + return 0;
>>> + }
>>> +
>>> /* No high-speed support */
>>> if (!ext_csd[EXT_CSD_HS_TIMING])
>>> return 0;
>>> diff --git a/include/mmc.h b/include/mmc.h
>>> index 30c2375..726da99 100644
>>> --- a/include/mmc.h
>>> +++ b/include/mmc.h
>>> @@ -157,6 +157,14 @@
>>> #define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */
>>> #define EXT_CSD_HC_ERASE_GRP_SIZE 224 /* RO */
>>>
>>> +#define EXT_CSD_REV_1_0 0
>>> +#define EXT_CSD_REV_1_1 1
>>> +#define EXT_CSD_REV_1_2 2
>>> +#define EXT_CSD_REV_1_3 3
>>> +#define EXT_CSD_REV_1_4 4
>>> +#define EXT_CSD_REV_1_5 5
>>> +#define EXT_CSD_REV_1_6 6
>>> +
>>> /*
>>> * EXT_CSD field definitions
>>> */
>>> --
>>> 1.7.4.1
>>> _______________________________________________
>>> U-Boot mailing list
>>> U-Boot at lists.denx.de
>>> http://lists.denx.de/mailman/listinfo/u-boot
>>
>> _______________________________________________
>> U-Boot mailing list
>> U-Boot at lists.denx.de
>> http://lists.denx.de/mailman/listinfo/u-boot
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-09-03 5:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-27 7:16 [U-Boot] [U-BOOT][PATCH] mmc: support the revision check for eMMC4.5 Jaehoon Chung
2012-04-02 18:35 ` Jae hoon Chung
2012-09-01 6:15 ` Marek Vasut
2012-09-03 5:32 ` Jaehoon Chung
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox