public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
@ 2007-03-07  7:44 Kyungmin Park
  2007-03-08  6:06 ` Kyungmin Park
  2007-03-09  3:31 ` Syed Mohammed, Khasim
  0 siblings, 2 replies; 13+ messages in thread
From: Kyungmin Park @ 2007-03-07  7:44 UTC (permalink / raw)
  To: linux-omap-open-source

Hi

Here's performance results of MMC on OMAP2.
After patch we can good read performances on MoviNAND
Idea's from N800 code.

% Test Environment
Target: Apollon 
Kernel: 2.6.21-rc2-omap1 (latest: 07.03.07)
Filesystem: VFAT

# iozone -A -s 10m -U /mmc -f /mmc/test -e

* Before
% MMC (64MB)
               KB  reclen   write rewrite    read    reread
            10240       4    2418    2463     6393     6362
            10240       8    2391    2463     6362     6393
            10240      16    2396    2463     6362     6362
            10240      32    2348    2418     6393     6393
            10240      64    2365    2404     6331     6331
            10240     128    2365    2409     6040     6040
            10240     256    2348    2413     6068     6040

% MoviNAND (4GB)
              KB  reclen   write rewrite    read    reread
            10240       4    2328    2206     6619     6687
            10240       8    2332    2206     6687     6687
            10240      16    2332    2206     6687     6687
            10240      32    2323    2336     6721     6721
            10240      64    2177    2323     6553     6553
            10240     128    2177    2319     6393     6362
            10240     256    2180    2323     6362     6393

* After patch
mmc0: selected 48.000MHz transfer rate
mmc0: clock 48000000Hz busmode 2 powermode 2 cs 0 Vdd 20 width 2
% MMC (64MB) (Note: The result is similar since current MMC card supports
only 24MHz.)

            KB  reclen   write rewrite    read    reread
           10240       4    2501    2585     6425     6456
           10240       8    2418    2520     6393     6425
           10240      16    2409    2487     6393     6425
           10240      32    2391    2473     6425     6425
           10240      64    2391    2463     6331     6362
           10240     128    2383    2427     6068     6068
           10240     256    2391    2422     6096     6096

% MoviNAND (4GB)
           KB  reclen   write rewrite    read    reread
           10240       4    3034    2605     7201     8856
           10240       8    2616    2468     9039     8916
           10240      16    2600    2642     9102     8916
           10240      32    2422    2600     8977     8916
           10240      64    2409    2580     8977     8738
           10240     128    2404    2580     8456     8456
           10240     256    2409    2585     8402     8456

The interesting thing is why N800 mmc is too slow?

* target: N800
Same test program

Original
               KB  reclen   write rewrite    read    reread
            10240       4     341     338     1418     1425
            10240       8     343     343     1420     1427
            10240      16     342     342     1416     1426
            10240      32     341     345     1419     1427
            10240      64     342     345     1416     1427
            10240     128     342     343     1375     1385
            10240     256     344     345     1378     1381
 
After HS-MMC and multiblock write enable

               KB  reclen   write rewrite    read    reread
            10240       4    1896    1848     2765     2774
            10240       8    1971    2004     2789     2781
            10240      16    1970    2002     2757     2779
            10240      32    1844    1874     2760     2791
            10240      64    1896    1924     2747     2789
            10240     128    1902    1929     2607     2635
            10240     256    1896    1945     2628     2631

Thank you,
Kyungmin Park

ARM: OMAP: MMC performance upgrade on OMAP2

- set max frequency 48000000 on OMAP2
- Add CONFIG_MMC_DEBUG

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
--

diff --git a/drivers/mmc/omap.c b/drivers/mmc/omap.c
index e72a7e8..93ec7fa 100644
--- a/drivers/mmc/omap.c
+++ b/drivers/mmc/omap.c
@@ -415,6 +415,7 @@ mmc_omap_xfer_data(struct mmc_omap_host *host, int
write)
 	}
 }
 
+#ifdef CONFIG_MMC_DEBUG
 static inline void mmc_omap_report_irq(u16 status)
 {
 	static const char *mmc_omap_status_bits[] = {
@@ -431,6 +432,7 @@ static inline void mmc_omap_report_irq(u16 status)
 			c++;
 		}
 }
+#endif
 
 static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
 {
@@ -1096,7 +1098,10 @@ static int __init mmc_omap_probe(struct
platform_device *pdev)
 
 	mmc->ops = &mmc_omap_ops;
 	mmc->f_min = 400000;
-	mmc->f_max = 24000000;
+	if (cpu_class_is_omap2())
+		mmc->f_max = 48000000;
+	else
+		mmc->f_max = 24000000;
 	mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
 	mmc->caps = MMC_CAP_MULTIWRITE | MMC_CAP_BYTEBLOCK;

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
  2007-03-07  7:44 [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2 Kyungmin Park
@ 2007-03-08  6:06 ` Kyungmin Park
       [not found]   ` <45EFA96D.9010604@drzeus.cx>
  2007-03-09  3:31 ` Syed Mohammed, Khasim
  1 sibling, 1 reply; 13+ messages in thread
From: Kyungmin Park @ 2007-03-08  6:06 UTC (permalink / raw)
  To: linux-omap-open-source, drzeus

Updated patch for recent MMC changes

- set max frequency 48000000 on OMAP2
- set HIGHSPEED feature for omap host
- add CONFIG_MMC_DEBUG

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
--

diff --git a/drivers/mmc/omap.c b/drivers/mmc/omap.c
index e72a7e8..daf73e0 100644
--- a/drivers/mmc/omap.c
+++ b/drivers/mmc/omap.c
@@ -415,6 +415,7 @@ mmc_omap_xfer_data(struct mmc_omap_host *host, int
write)
 	}
 }
 
+#ifdef CONFIG_MMC_DEBUG
 static inline void mmc_omap_report_irq(u16 status)
 {
 	static const char *mmc_omap_status_bits[] = {
@@ -431,6 +432,7 @@ static inline void mmc_omap_report_irq(u16 status)
 			c++;
 		}
 }
+#endif
 
 static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
 {
@@ -1096,9 +1098,13 @@ static int __init mmc_omap_probe(struct
platform_device *pdev)
 
 	mmc->ops = &mmc_omap_ops;
 	mmc->f_min = 400000;
-	mmc->f_max = 24000000;
+	if (cpu_class_is_omap2())
+		mmc->f_max = 48000000;
+	else
+		mmc->f_max = 24000000;
 	mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
-	mmc->caps = MMC_CAP_MULTIWRITE | MMC_CAP_BYTEBLOCK;
+	mmc->caps = MMC_CAP_MULTIWRITE | MMC_CAP_BYTEBLOCK |
+		MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED;
 
 	if (minfo->wire4)
 		 mmc->caps |= MMC_CAP_4_BIT_DATA;

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
       [not found]   ` <45EFA96D.9010604@drzeus.cx>
@ 2007-03-08  7:28     ` Kyungmin Park
  2007-03-08 12:02       ` Syed Mohammed, Khasim
  0 siblings, 1 reply; 13+ messages in thread
From: Kyungmin Park @ 2007-03-08  7:28 UTC (permalink / raw)
  To: 'Pierre Ossman'; +Cc: linux-omap-open-source


> Do _not_ take these flags lightly. If you enable them when 
> the hardware doesn't support the alternative timing, you have 
> a good chance of cards not working. So to me this looks very 
> wrong as the pre-48MHz controllers probably only follow the 
> legacy timing requirements.
> 

I'm not sure OMAP2 MMC supports highspeed feature. I can't find anytings in
OMAP2 TRM.
 
	if (cpu_class_is_omap2())
		mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED;

mmc0: selected 48.000MHz transfer rate
mmc0: clock 48000000Hz busmode 2 powermode 2 cs 0 Vdd 20 width 2 timing 1

Then is it dependent on platform?

	if (minfo->highspeed)
		mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED;

And even though we set HIGHSPEED, the card set their clock correctly. Is it
right?

mmc0: selected 26.000MHz transfer rate
mmc0: clock 26000000Hz busmode 2 powermode 2 cs 0 Vdd 20 width 2 timing 1

Thank you,
Kyungmin Park

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
  2007-03-08  7:28     ` Kyungmin Park
@ 2007-03-08 12:02       ` Syed Mohammed, Khasim
       [not found]         ` <45F00C93.2000305@drzeus.cx>
  2007-03-09  2:41         ` Kyungmin Park
  0 siblings, 2 replies; 13+ messages in thread
From: Syed Mohammed, Khasim @ 2007-03-08 12:02 UTC (permalink / raw)
  To: kmpark, Pierre Ossman; +Cc: linux-omap-open-source

Hi Kyungmin,
 
OMAP2420 doesn't support High Speed. OMAP2430 does support Highspeed.
 
Please see our code for 2430 (its on linux.omap.com).
 
Regards,
Khasim

________________________________

From: linux-omap-open-source-bounces@linux.omap.com on behalf of Kyungmin Park
Sent: Thu 3/8/2007 1:28 AM
To: 'Pierre Ossman'
Cc: linux-omap-open-source@linux.omap.com
Subject: RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2




> Do _not_ take these flags lightly. If you enable them when
> the hardware doesn't support the alternative timing, you have
> a good chance of cards not working. So to me this looks very
> wrong as the pre-48MHz controllers probably only follow the
> legacy timing requirements.
>

I'm not sure OMAP2 MMC supports highspeed feature. I can't find anytings in
OMAP2 TRM.

        if (cpu_class_is_omap2())
                mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED;

mmc0: selected 48.000MHz transfer rate
mmc0: clock 48000000Hz busmode 2 powermode 2 cs 0 Vdd 20 width 2 timing 1

Then is it dependent on platform?

        if (minfo->highspeed)
                mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED;

And even though we set HIGHSPEED, the card set their clock correctly. Is it
right?

mmc0: selected 26.000MHz transfer rate
mmc0: clock 26000000Hz busmode 2 powermode 2 cs 0 Vdd 20 width 2 timing 1

Thank you,
Kyungmin Park

_______________________________________________
Linux-omap-open-source mailing list
Linux-omap-open-source@linux.omap.com
http://linux.omap.com/mailman/listinfo/linux-omap-open-source

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
       [not found]         ` <45F00C93.2000305@drzeus.cx>
@ 2007-03-08 13:16           ` Syed Mohammed, Khasim
  0 siblings, 0 replies; 13+ messages in thread
From: Syed Mohammed, Khasim @ 2007-03-08 13:16 UTC (permalink / raw)
  To: Pierre Ossman; +Cc: linux-omap-open-source, kmpark

Hi Pierre,
 
I can't give specs, but I can definitely pass you required data. Will mail you later.
 
Regards,
Khasim

________________________________

From: Pierre Ossman [mailto:drzeus@drzeus.cx]
Sent: Thu 3/8/2007 7:16 AM
To: Syed Mohammed, Khasim
Cc: kmpark@infradead.org; linux-omap-open-source@linux.omap.com
Subject: Re: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2



Syed Mohammed, Khasim wrote:
> Hi Kyungmin,
> 
> OMAP2420 doesn't support High Speed. OMAP2430 does support Highspeed.
> 
> Please see our code for 2430 (its on linux.omap.com).
> 

Do you have some specs for the 2430 with timing info?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
  2007-03-08 12:02       ` Syed Mohammed, Khasim
       [not found]         ` <45F00C93.2000305@drzeus.cx>
@ 2007-03-09  2:41         ` Kyungmin Park
  2007-03-09  5:10           ` Syed Mohammed, Khasim
  1 sibling, 1 reply; 13+ messages in thread
From: Kyungmin Park @ 2007-03-09  2:41 UTC (permalink / raw)
  To: 'Syed Mohammed, Khasim', 'Pierre Ossman'
  Cc: linux-omap-open-source

Hi Khasim,

I checked the mmc code in linux-2.6.14-omap2420-omap2430. It is used the
old samsung patch (mmcplus) in mmc core.
So if the the csd->mmca_vsn is CSD_SPEC_VER_4 then it always set highspeed.
the follwing code is always true if the chip is correct.

              if ((ext_csd->card_type & MMCPLUS_26MHZ) || (ext_csd-
>card_type & MMCPLUS_52MHZ)) {
                        err = mmc_switch_hsmode(host, card);
                        if (err != MMC_ERR_NONE) {
                                mmc_card_set_dead(card);
                                continue;
                        }
                }

then what makes the highspeed enabled? host or card?
If the host supports up to 48MHz clock and card supports the highspeed.
then what's the correct clock?

Currently if we don't set HIGHSPPED flags, it always set 20MHz as in the
Spec. Since it is calculated from card->csd.max_dtr in
mmc_calculate_clock().

        list_for_each_entry(card, &host->cards, node)
                if (!mmc_card_dead(card)) {
                        if (mmc_card_highspeed(card) && mmc_card_sd(card)) {
                                if (max_dtr > card->sw_caps.hs_max_dtr)
                                        max_dtr = card->sw_caps.hs_max_dtr;
                        } else if (mmc_card_highspeed(card) &&
!mmc_card_sd(card)) {
                                if (max_dtr > card->ext_csd.hs_max_dtr)
                                        max_dtr = card->ext_csd.hs_max_dtr;
                        } else if (max_dtr > card->csd.max_dtr) {
                                max_dtr = card->csd.max_dtr;
                        }
                }

Okay I will check the MMC Spec.

Thank you,
Kyungmin Park


________________________________

	From: Syed Mohammed, Khasim [mailto:x0khasim@ti.com] 
	Sent: Thursday, March 08, 2007 9:02 PM
	To: kmpark@infradead.org; Pierre Ossman
	Cc: linux-omap-open-source@linux.omap.com
	Subject: RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
	
	
	Hi Kyungmin,
	 
	OMAP2420 doesn't support High Speed. OMAP2430 does support
Highspeed.
	 
	Please see our code for 2430 (its on linux.omap.com).
	 
	Regards,
	Khasim

________________________________

	From: linux-omap-open-source-bounces@linux.omap.com on behalf of
Kyungmin Park
	Sent: Thu 3/8/2007 1:28 AM
	To: 'Pierre Ossman'
	Cc: linux-omap-open-source@linux.omap.com
	Subject: RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
	
	


	> Do _not_ take these flags lightly. If you enable them when
	> the hardware doesn't support the alternative timing, you have
	> a good chance of cards not working. So to me this looks very
	> wrong as the pre-48MHz controllers probably only follow the
	> legacy timing requirements.
	>
	
	I'm not sure OMAP2 MMC supports highspeed feature. I can't find
anytings in
	OMAP2 TRM.
	
	        if (cpu_class_is_omap2())
	                mmc->caps |= MMC_CAP_MMC_HIGHSPEED |
MMC_CAP_SD_HIGHSPEED;
	
	mmc0: selected 48.000MHz transfer rate
	mmc0: clock 48000000Hz busmode 2 powermode 2 cs 0 Vdd 20 width 2
timing 1
	
	Then is it dependent on platform?
	
	        if (minfo->highspeed)
	                mmc->caps |= MMC_CAP_MMC_HIGHSPEED |
MMC_CAP_SD_HIGHSPEED;
	
	And even though we set HIGHSPEED, the card set their clock
correctly. Is it
	right?
	
	mmc0: selected 26.000MHz transfer rate
	mmc0: clock 26000000Hz busmode 2 powermode 2 cs 0 Vdd 20 width 2
timing 1
	
	Thank you,
	Kyungmin Park
	
	_______________________________________________
	Linux-omap-open-source mailing list
	Linux-omap-open-source@linux.omap.com
	http://linux.omap.com/mailman/listinfo/linux-omap-open-source
	

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
  2007-03-07  7:44 [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2 Kyungmin Park
  2007-03-08  6:06 ` Kyungmin Park
@ 2007-03-09  3:31 ` Syed Mohammed, Khasim
  2007-03-29 20:13   ` Tony Lindgren
  1 sibling, 1 reply; 13+ messages in thread
From: Syed Mohammed, Khasim @ 2007-03-09  3:31 UTC (permalink / raw)
  To: kmpark, linux-omap-open-source

Hi Kyungmin,

For OMAP2420 there are few MMC erratas,

1. If MMC controller is configured for 4bit and if MMC CLK frequency is
over 24Mhz it has as a diminishing impact on throughput. Hence, it is
not recommended to use a clock over 24MHz for MMC 4 bits mode.

2. If an external transceiver with a round trip delay clock greater than
7ns is used then external clock to control the MMC card is limited to
24MHz.

So, though OMAP 2420 MMC Controller is MMC 4.0 spec compliant and
supports clk upto 48Mhz we were not able achieve high data rate (as we
should be for a HSMMC).

Hope this helps for your analysis.

Regards,
Khasim

>-----Original Message-----
>From: linux-omap-open-source-bounces@linux.omap.com [mailto:linux-omap-
>open-source-bounces@linux.omap.com] On Behalf Of Kyungmin Park
>Sent: Wednesday, March 07, 2007 1:44 AM
>To: linux-omap-open-source@linux.omap.com
>Subject: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
>
>Hi
>
>Here's performance results of MMC on OMAP2.
>After patch we can good read performances on MoviNAND
>Idea's from N800 code.
>
>% Test Environment
>Target: Apollon
>Kernel: 2.6.21-rc2-omap1 (latest: 07.03.07)
>Filesystem: VFAT
>
># iozone -A -s 10m -U /mmc -f /mmc/test -e
>
>* Before
>% MMC (64MB)
>               KB  reclen   write rewrite    read    reread
>            10240       4    2418    2463     6393     6362
>            10240       8    2391    2463     6362     6393
>            10240      16    2396    2463     6362     6362
>            10240      32    2348    2418     6393     6393
>            10240      64    2365    2404     6331     6331
>            10240     128    2365    2409     6040     6040
>            10240     256    2348    2413     6068     6040
>
>% MoviNAND (4GB)
>              KB  reclen   write rewrite    read    reread
>            10240       4    2328    2206     6619     6687
>            10240       8    2332    2206     6687     6687
>            10240      16    2332    2206     6687     6687
>            10240      32    2323    2336     6721     6721
>            10240      64    2177    2323     6553     6553
>            10240     128    2177    2319     6393     6362
>            10240     256    2180    2323     6362     6393
>
>* After patch
>mmc0: selected 48.000MHz transfer rate
>mmc0: clock 48000000Hz busmode 2 powermode 2 cs 0 Vdd 20 width 2
>% MMC (64MB) (Note: The result is similar since current MMC card
supports
>only 24MHz.)
>
>            KB  reclen   write rewrite    read    reread
>           10240       4    2501    2585     6425     6456
>           10240       8    2418    2520     6393     6425
>           10240      16    2409    2487     6393     6425
>           10240      32    2391    2473     6425     6425
>           10240      64    2391    2463     6331     6362
>           10240     128    2383    2427     6068     6068
>           10240     256    2391    2422     6096     6096
>
>% MoviNAND (4GB)
>           KB  reclen   write rewrite    read    reread
>           10240       4    3034    2605     7201     8856
>           10240       8    2616    2468     9039     8916
>           10240      16    2600    2642     9102     8916
>           10240      32    2422    2600     8977     8916
>           10240      64    2409    2580     8977     8738
>           10240     128    2404    2580     8456     8456
>           10240     256    2409    2585     8402     8456
>
>The interesting thing is why N800 mmc is too slow?
>
>* target: N800
>Same test program
>
>Original
>               KB  reclen   write rewrite    read    reread
>            10240       4     341     338     1418     1425
>            10240       8     343     343     1420     1427
>            10240      16     342     342     1416     1426
>            10240      32     341     345     1419     1427
>            10240      64     342     345     1416     1427
>            10240     128     342     343     1375     1385
>            10240     256     344     345     1378     1381
>
>After HS-MMC and multiblock write enable
>
>               KB  reclen   write rewrite    read    reread
>            10240       4    1896    1848     2765     2774
>            10240       8    1971    2004     2789     2781
>            10240      16    1970    2002     2757     2779
>            10240      32    1844    1874     2760     2791
>            10240      64    1896    1924     2747     2789
>            10240     128    1902    1929     2607     2635
>            10240     256    1896    1945     2628     2631
>
>Thank you,
>Kyungmin Park
>
>ARM: OMAP: MMC performance upgrade on OMAP2
>
>- set max frequency 48000000 on OMAP2
>- Add CONFIG_MMC_DEBUG
>
>Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>--
>
>diff --git a/drivers/mmc/omap.c b/drivers/mmc/omap.c
>index e72a7e8..93ec7fa 100644
>--- a/drivers/mmc/omap.c
>+++ b/drivers/mmc/omap.c
>@@ -415,6 +415,7 @@ mmc_omap_xfer_data(struct mmc_omap_host *host, int
>write)
> 	}
> }
>
>+#ifdef CONFIG_MMC_DEBUG
> static inline void mmc_omap_report_irq(u16 status)
> {
> 	static const char *mmc_omap_status_bits[] = {
>@@ -431,6 +432,7 @@ static inline void mmc_omap_report_irq(u16 status)
> 			c++;
> 		}
> }
>+#endif
>
> static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
> {
>@@ -1096,7 +1098,10 @@ static int __init mmc_omap_probe(struct
>platform_device *pdev)
>
> 	mmc->ops = &mmc_omap_ops;
> 	mmc->f_min = 400000;
>-	mmc->f_max = 24000000;
>+	if (cpu_class_is_omap2())
>+		mmc->f_max = 48000000;
>+	else
>+		mmc->f_max = 24000000;
> 	mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
> 	mmc->caps = MMC_CAP_MULTIWRITE | MMC_CAP_BYTEBLOCK;
>
>_______________________________________________
>Linux-omap-open-source mailing list
>Linux-omap-open-source@linux.omap.com
>http://linux.omap.com/mailman/listinfo/linux-omap-open-source

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
  2007-03-09  2:41         ` Kyungmin Park
@ 2007-03-09  5:10           ` Syed Mohammed, Khasim
  2007-03-09  5:18             ` Syed Mohammed, Khasim
  0 siblings, 1 reply; 13+ messages in thread
From: Syed Mohammed, Khasim @ 2007-03-09  5:10 UTC (permalink / raw)
  To: kmpark, Pierre Ossman; +Cc: linux-omap-open-source

Hi Kyungmin,

I haven't gone through the entire code as such, here is my
understanding.

>So if the the csd->mmca_vsn is CSD_SPEC_VER_4 then it always set
highspeed.
Yes, if card is 4.0 compliant then it's HS Card.

>then what makes the highspeed enabled? host or card?
Both - right? First controller should support such clock rates, and card
should be 4.0 (or more) compliant.

>If the host supports up to 48MHz clock and card supports the highspeed.
>then what's the correct clock?
If controller supports upto 48Mhz then I think we can only support 26Mhz
max. There are some special bits in 2430 processor to support 52 Mhz

According to spec, a card can support both 52 & 26 or 26 (0x1 or 0x3).
So, if our controller doesn't support 52Mhz clock rates then we should
stick to 26Mhz.

Regards,
Khasim

>-----Original Message-----
>From: Kyungmin Park [mailto:kmpark@infradead.org]
>Sent: Thursday, March 08, 2007 8:42 PM
>To: Syed Mohammed, Khasim; 'Pierre Ossman'
>Cc: linux-omap-open-source@linux.omap.com
>Subject: RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
>
>Hi Khasim,
>
>I checked the mmc code in linux-2.6.14-omap2420-omap2430. It is used
the
>old samsung patch (mmcplus) in mmc core.
>So if the the csd->mmca_vsn is CSD_SPEC_VER_4 then it always set
highspeed.
>the follwing code is always true if the chip is correct.
>
>              if ((ext_csd->card_type & MMCPLUS_26MHZ) || (ext_csd-
>>card_type & MMCPLUS_52MHZ)) {
>                        err = mmc_switch_hsmode(host, card);
>                        if (err != MMC_ERR_NONE) {
>                                mmc_card_set_dead(card);
>                                continue;
>                        }
>                }
>
>then what makes the highspeed enabled? host or card?
>If the host supports up to 48MHz clock and card supports the highspeed.
>then what's the correct clock?
>
>Currently if we don't set HIGHSPPED flags, it always set 20MHz as in
the
>Spec. Since it is calculated from card->csd.max_dtr in
>mmc_calculate_clock().
>
>        list_for_each_entry(card, &host->cards, node)
>                if (!mmc_card_dead(card)) {
>                        if (mmc_card_highspeed(card) &&
mmc_card_sd(card))
>{
>                                if (max_dtr > card->sw_caps.hs_max_dtr)
>                                        max_dtr =
card->sw_caps.hs_max_dtr;
>                        } else if (mmc_card_highspeed(card) &&
>!mmc_card_sd(card)) {
>                                if (max_dtr > card->ext_csd.hs_max_dtr)
>                                        max_dtr =
card->ext_csd.hs_max_dtr;
>                        } else if (max_dtr > card->csd.max_dtr) {
>                                max_dtr = card->csd.max_dtr;
>                        }
>                }
>
>Okay I will check the MMC Spec.
>
>Thank you,
>Kyungmin Park
>
>
>________________________________
>
>	From: Syed Mohammed, Khasim [mailto:x0khasim@ti.com]
>	Sent: Thursday, March 08, 2007 9:02 PM
>	To: kmpark@infradead.org; Pierre Ossman
>	Cc: linux-omap-open-source@linux.omap.com
>	Subject: RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
>
>
>	Hi Kyungmin,
>
>	OMAP2420 doesn't support High Speed. OMAP2430 does support
>Highspeed.
>
>	Please see our code for 2430 (its on linux.omap.com).
>
>	Regards,
>	Khasim
>
>________________________________
>
>	From: linux-omap-open-source-bounces@linux.omap.com on behalf of
>Kyungmin Park
>	Sent: Thu 3/8/2007 1:28 AM
>	To: 'Pierre Ossman'
>	Cc: linux-omap-open-source@linux.omap.com
>	Subject: RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
>
>
>
>
>	> Do _not_ take these flags lightly. If you enable them when
>	> the hardware doesn't support the alternative timing, you have
>	> a good chance of cards not working. So to me this looks very
>	> wrong as the pre-48MHz controllers probably only follow the
>	> legacy timing requirements.
>	>
>
>	I'm not sure OMAP2 MMC supports highspeed feature. I can't find
>anytings in
>	OMAP2 TRM.
>
>	        if (cpu_class_is_omap2())
>	                mmc->caps |= MMC_CAP_MMC_HIGHSPEED |
>MMC_CAP_SD_HIGHSPEED;
>
>	mmc0: selected 48.000MHz transfer rate
>	mmc0: clock 48000000Hz busmode 2 powermode 2 cs 0 Vdd 20 width 2
>timing 1
>
>	Then is it dependent on platform?
>
>	        if (minfo->highspeed)
>	                mmc->caps |= MMC_CAP_MMC_HIGHSPEED |
>MMC_CAP_SD_HIGHSPEED;
>
>	And even though we set HIGHSPEED, the card set their clock
>correctly. Is it
>	right?
>
>	mmc0: selected 26.000MHz transfer rate
>	mmc0: clock 26000000Hz busmode 2 powermode 2 cs 0 Vdd 20 width 2
>timing 1
>
>	Thank you,
>	Kyungmin Park
>
>	_______________________________________________
>	Linux-omap-open-source mailing list
>	Linux-omap-open-source@linux.omap.com
>	http://linux.omap.com/mailman/listinfo/linux-omap-open-source
>
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
  2007-03-09  5:10           ` Syed Mohammed, Khasim
@ 2007-03-09  5:18             ` Syed Mohammed, Khasim
  2007-03-09  5:59               ` Kyungmin Park
  0 siblings, 1 reply; 13+ messages in thread
From: Syed Mohammed, Khasim @ 2007-03-09  5:18 UTC (permalink / raw)
  To: Syed Mohammed, Khasim, kmpark, Pierre Ossman; +Cc: linux-omap-open-source

Sorry, small correction. It can support from 0 to 26 Mhz or 0 to 52 Mhz
We should be able to configure 48Mhz.

Regards,
Khasim

>-----Original Message-----
>From: linux-omap-open-source-bounces@linux.omap.com [mailto:linux-omap-
>open-source-bounces@linux.omap.com] On Behalf Of Syed Mohammed, Khasim
>Sent: Thursday, March 08, 2007 11:11 PM
>To: kmpark@infradead.org; Pierre Ossman
>Cc: linux-omap-open-source@linux.omap.com
>Subject: RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
>
>Hi Kyungmin,
>
>I haven't gone through the entire code as such, here is my
>understanding.
>
>>So if the the csd->mmca_vsn is CSD_SPEC_VER_4 then it always set
>highspeed.
>Yes, if card is 4.0 compliant then it's HS Card.
>
>>then what makes the highspeed enabled? host or card?
>Both - right? First controller should support such clock rates, and
card
>should be 4.0 (or more) compliant.
>
>>If the host supports up to 48MHz clock and card supports the
highspeed.
>>then what's the correct clock?
>If controller supports upto 48Mhz then I think we can only support
26Mhz
>max. There are some special bits in 2430 processor to support 52 Mhz
>
>According to spec, a card can support both 52 & 26 or 26 (0x1 or 0x3).
>So, if our controller doesn't support 52Mhz clock rates then we should
>stick to 26Mhz.
>
>Regards,
>Khasim
>
>>-----Original Message-----
>>From: Kyungmin Park [mailto:kmpark@infradead.org]
>>Sent: Thursday, March 08, 2007 8:42 PM
>>To: Syed Mohammed, Khasim; 'Pierre Ossman'
>>Cc: linux-omap-open-source@linux.omap.com
>>Subject: RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
>>
>>Hi Khasim,
>>
>>I checked the mmc code in linux-2.6.14-omap2420-omap2430. It is used
>the
>>old samsung patch (mmcplus) in mmc core.
>>So if the the csd->mmca_vsn is CSD_SPEC_VER_4 then it always set
>highspeed.
>>the follwing code is always true if the chip is correct.
>>
>>              if ((ext_csd->card_type & MMCPLUS_26MHZ) || (ext_csd-
>>>card_type & MMCPLUS_52MHZ)) {
>>                        err = mmc_switch_hsmode(host, card);
>>                        if (err != MMC_ERR_NONE) {
>>                                mmc_card_set_dead(card);
>>                                continue;
>>                        }
>>                }
>>
>>then what makes the highspeed enabled? host or card?
>>If the host supports up to 48MHz clock and card supports the
highspeed.
>>then what's the correct clock?
>>
>>Currently if we don't set HIGHSPPED flags, it always set 20MHz as in
>the
>>Spec. Since it is calculated from card->csd.max_dtr in
>>mmc_calculate_clock().
>>
>>        list_for_each_entry(card, &host->cards, node)
>>                if (!mmc_card_dead(card)) {
>>                        if (mmc_card_highspeed(card) &&
>mmc_card_sd(card))
>>{
>>                                if (max_dtr >
card->sw_caps.hs_max_dtr)
>>                                        max_dtr =
>card->sw_caps.hs_max_dtr;
>>                        } else if (mmc_card_highspeed(card) &&
>>!mmc_card_sd(card)) {
>>                                if (max_dtr >
card->ext_csd.hs_max_dtr)
>>                                        max_dtr =
>card->ext_csd.hs_max_dtr;
>>                        } else if (max_dtr > card->csd.max_dtr) {
>>                                max_dtr = card->csd.max_dtr;
>>                        }
>>                }
>>
>>Okay I will check the MMC Spec.
>>
>>Thank you,
>>Kyungmin Park
>>
>>
>>________________________________
>>
>>	From: Syed Mohammed, Khasim [mailto:x0khasim@ti.com]
>>	Sent: Thursday, March 08, 2007 9:02 PM
>>	To: kmpark@infradead.org; Pierre Ossman
>>	Cc: linux-omap-open-source@linux.omap.com
>>	Subject: RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
>>
>>
>>	Hi Kyungmin,
>>
>>	OMAP2420 doesn't support High Speed. OMAP2430 does support
>>Highspeed.
>>
>>	Please see our code for 2430 (its on linux.omap.com).
>>
>>	Regards,
>>	Khasim
>>
>>________________________________
>>
>>	From: linux-omap-open-source-bounces@linux.omap.com on behalf of
>>Kyungmin Park
>>	Sent: Thu 3/8/2007 1:28 AM
>>	To: 'Pierre Ossman'
>>	Cc: linux-omap-open-source@linux.omap.com
>>	Subject: RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
>>
>>
>>
>>
>>	> Do _not_ take these flags lightly. If you enable them when
>>	> the hardware doesn't support the alternative timing, you have
>>	> a good chance of cards not working. So to me this looks very
>>	> wrong as the pre-48MHz controllers probably only follow the
>>	> legacy timing requirements.
>>	>
>>
>>	I'm not sure OMAP2 MMC supports highspeed feature. I can't find
>>anytings in
>>	OMAP2 TRM.
>>
>>	        if (cpu_class_is_omap2())
>>	                mmc->caps |= MMC_CAP_MMC_HIGHSPEED |
>>MMC_CAP_SD_HIGHSPEED;
>>
>>	mmc0: selected 48.000MHz transfer rate
>>	mmc0: clock 48000000Hz busmode 2 powermode 2 cs 0 Vdd 20 width 2
>>timing 1
>>
>>	Then is it dependent on platform?
>>
>>	        if (minfo->highspeed)
>>	                mmc->caps |= MMC_CAP_MMC_HIGHSPEED |
>>MMC_CAP_SD_HIGHSPEED;
>>
>>	And even though we set HIGHSPEED, the card set their clock
>>correctly. Is it
>>	right?
>>
>>	mmc0: selected 26.000MHz transfer rate
>>	mmc0: clock 26000000Hz busmode 2 powermode 2 cs 0 Vdd 20 width 2
>>timing 1
>>
>>	Thank you,
>>	Kyungmin Park
>>
>>	_______________________________________________
>>	Linux-omap-open-source mailing list
>>	Linux-omap-open-source@linux.omap.com
>>	http://linux.omap.com/mailman/listinfo/linux-omap-open-source
>>
>>
>
>_______________________________________________
>Linux-omap-open-source mailing list
>Linux-omap-open-source@linux.omap.com
>http://linux.omap.com/mailman/listinfo/linux-omap-open-source

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
  2007-03-09  5:18             ` Syed Mohammed, Khasim
@ 2007-03-09  5:59               ` Kyungmin Park
  2007-03-09  6:16                 ` Syed Mohammed, Khasim
  0 siblings, 1 reply; 13+ messages in thread
From: Kyungmin Park @ 2007-03-09  5:59 UTC (permalink / raw)
  To: 'Syed Mohammed, Khasim', 'Pierre Ossman'
  Cc: linux-omap-open-source

Yes, that's my understanding.

If the card is 4.0 compliant and OMAP2 supports up to 48MHz. then we use
this 48MHz clock.

But current mmc code down-grade to 20MHz since it's not set highspeed.

If the card is 4.0 compliant and even though host don't support highspeed
feature, we set the highspeed flags for support host max clocks.
I think highspeed depends on host clock. Is it right?

Thank you,
Kyungmin Park

> -----Original Message-----
> From: Syed Mohammed, Khasim [mailto:x0khasim@ti.com] 
> Sent: Friday, March 09, 2007 2:18 PM
> To: Syed Mohammed, Khasim; kmpark@infradead.org; Pierre Ossman
> Cc: linux-omap-open-source@linux.omap.com
> Subject: RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
> 
> Sorry, small correction. It can support from 0 to 26 Mhz or 0 
> to 52 Mhz We should be able to configure 48Mhz.
> 
> Regards,
> Khasim
> 
> >-----Original Message-----
> >From: linux-omap-open-source-bounces@linux.omap.com 
> [mailto:linux-omap- 
> >open-source-bounces@linux.omap.com] On Behalf Of Syed 
> Mohammed, Khasim
> >Sent: Thursday, March 08, 2007 11:11 PM
> >To: kmpark@infradead.org; Pierre Ossman
> >Cc: linux-omap-open-source@linux.omap.com
> >Subject: RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
> >
> >Hi Kyungmin,
> >
> >I haven't gone through the entire code as such, here is my 
> >understanding.
> >
> >>So if the the csd->mmca_vsn is CSD_SPEC_VER_4 then it always set
> >highspeed.
> >Yes, if card is 4.0 compliant then it's HS Card.
> >
> >>then what makes the highspeed enabled? host or card?
> >Both - right? First controller should support such clock rates, and
> card
> >should be 4.0 (or more) compliant.
> >
> >>If the host supports up to 48MHz clock and card supports the
> highspeed.
> >>then what's the correct clock?
> >If controller supports upto 48Mhz then I think we can only support
> 26Mhz
> >max. There are some special bits in 2430 processor to support 52 Mhz
> >
> >According to spec, a card can support both 52 & 26 or 26 
> (0x1 or 0x3).
> >So, if our controller doesn't support 52Mhz clock rates then 
> we should 
> >stick to 26Mhz.
> >
> >Regards,
> >Khasim
> >
> >>-----Original Message-----
> >>From: Kyungmin Park [mailto:kmpark@infradead.org]
> >>Sent: Thursday, March 08, 2007 8:42 PM
> >>To: Syed Mohammed, Khasim; 'Pierre Ossman'
> >>Cc: linux-omap-open-source@linux.omap.com
> >>Subject: RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
> >>
> >>Hi Khasim,
> >>
> >>I checked the mmc code in linux-2.6.14-omap2420-omap2430. It is used
> >the
> >>old samsung patch (mmcplus) in mmc core.
> >>So if the the csd->mmca_vsn is CSD_SPEC_VER_4 then it always set
> >highspeed.
> >>the follwing code is always true if the chip is correct.
> >>
> >>              if ((ext_csd->card_type & MMCPLUS_26MHZ) || (ext_csd-
> >>>card_type & MMCPLUS_52MHZ)) {
> >>                        err = mmc_switch_hsmode(host, card);
> >>                        if (err != MMC_ERR_NONE) {
> >>                                mmc_card_set_dead(card);
> >>                                continue;
> >>                        }
> >>                }
> >>
> >>then what makes the highspeed enabled? host or card?
> >>If the host supports up to 48MHz clock and card supports the
> highspeed.
> >>then what's the correct clock?
> >>
> >>Currently if we don't set HIGHSPPED flags, it always set 20MHz as in
> >the
> >>Spec. Since it is calculated from card->csd.max_dtr in 
> >>mmc_calculate_clock().
> >>
> >>        list_for_each_entry(card, &host->cards, node)
> >>                if (!mmc_card_dead(card)) {
> >>                        if (mmc_card_highspeed(card) &&
> >mmc_card_sd(card))
> >>{
> >>                                if (max_dtr >
> card->sw_caps.hs_max_dtr)
> >>                                        max_dtr =
> >card->sw_caps.hs_max_dtr;
> >>                        } else if (mmc_card_highspeed(card) &&
> >>!mmc_card_sd(card)) {
> >>                                if (max_dtr >
> card->ext_csd.hs_max_dtr)
> >>                                        max_dtr =
> >card->ext_csd.hs_max_dtr;
> >>                        } else if (max_dtr > card->csd.max_dtr) {
> >>                                max_dtr = card->csd.max_dtr;
> >>                        }
> >>                }
> >>
> >>Okay I will check the MMC Spec.
> >>
> >>Thank you,
> >>Kyungmin Park
> >>
> >>
> >>________________________________
> >>
> >>	From: Syed Mohammed, Khasim [mailto:x0khasim@ti.com]
> >>	Sent: Thursday, March 08, 2007 9:02 PM
> >>	To: kmpark@infradead.org; Pierre Ossman
> >>	Cc: linux-omap-open-source@linux.omap.com
> >>	Subject: RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
> >>
> >>
> >>	Hi Kyungmin,
> >>
> >>	OMAP2420 doesn't support High Speed. OMAP2430 does 
> support Highspeed.
> >>
> >>	Please see our code for 2430 (its on linux.omap.com).
> >>
> >>	Regards,
> >>	Khasim
> >>
> >>________________________________
> >>
> >>	From: linux-omap-open-source-bounces@linux.omap.com on 
> behalf of 
> >>Kyungmin Park
> >>	Sent: Thu 3/8/2007 1:28 AM
> >>	To: 'Pierre Ossman'
> >>	Cc: linux-omap-open-source@linux.omap.com
> >>	Subject: RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
> >>
> >>
> >>
> >>
> >>	> Do _not_ take these flags lightly. If you enable them when
> >>	> the hardware doesn't support the alternative timing, you have
> >>	> a good chance of cards not working. So to me this looks very
> >>	> wrong as the pre-48MHz controllers probably only follow the
> >>	> legacy timing requirements.
> >>	>
> >>
> >>	I'm not sure OMAP2 MMC supports highspeed feature. I can't find 
> >>anytings in
> >>	OMAP2 TRM.
> >>
> >>	        if (cpu_class_is_omap2())
> >>	                mmc->caps |= MMC_CAP_MMC_HIGHSPEED | 
> >>MMC_CAP_SD_HIGHSPEED;
> >>
> >>	mmc0: selected 48.000MHz transfer rate
> >>	mmc0: clock 48000000Hz busmode 2 powermode 2 cs 0 Vdd 
> 20 width 2 
> >>timing 1
> >>
> >>	Then is it dependent on platform?
> >>
> >>	        if (minfo->highspeed)
> >>	                mmc->caps |= MMC_CAP_MMC_HIGHSPEED | 
> >>MMC_CAP_SD_HIGHSPEED;
> >>
> >>	And even though we set HIGHSPEED, the card set their 
> clock correctly. 
> >>Is it
> >>	right?
> >>
> >>	mmc0: selected 26.000MHz transfer rate
> >>	mmc0: clock 26000000Hz busmode 2 powermode 2 cs 0 Vdd 
> 20 width 2 
> >>timing 1
> >>
> >>	Thank you,
> >>	Kyungmin Park
> >>
> >>	_______________________________________________
> >>	Linux-omap-open-source mailing list
> >>	Linux-omap-open-source@linux.omap.com
> >>	http://linux.omap.com/mailman/listinfo/linux-omap-open-source
> >>
> >>
> >
> >_______________________________________________
> >Linux-omap-open-source mailing list
> >Linux-omap-open-source@linux.omap.com
> >http://linux.omap.com/mailman/listinfo/linux-omap-open-source
> 
> 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
  2007-03-09  5:59               ` Kyungmin Park
@ 2007-03-09  6:16                 ` Syed Mohammed, Khasim
  0 siblings, 0 replies; 13+ messages in thread
From: Syed Mohammed, Khasim @ 2007-03-09  6:16 UTC (permalink / raw)
  To: kmpark, Pierre Ossman; +Cc: linux-omap-open-source

>I think highspeed depends on host clock. Is it right?

Yes.

Regards,
Khasim


>-----Original Message-----
>From: Kyungmin Park [mailto:kmpark@infradead.org]
>Sent: Friday, March 09, 2007 12:00 AM
>To: Syed Mohammed, Khasim; 'Pierre Ossman'
>Cc: linux-omap-open-source@linux.omap.com
>Subject: RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
>
>Yes, that's my understanding.
>
>If the card is 4.0 compliant and OMAP2 supports up to 48MHz. then we
use
>this 48MHz clock.
>
>But current mmc code down-grade to 20MHz since it's not set highspeed.
>
>If the card is 4.0 compliant and even though host don't support
highspeed
>feature, we set the highspeed flags for support host max clocks.
>I think highspeed depends on host clock. Is it right?
>
>Thank you,
>Kyungmin Park
>
>> -----Original Message-----
>> From: Syed Mohammed, Khasim [mailto:x0khasim@ti.com]
>> Sent: Friday, March 09, 2007 2:18 PM
>> To: Syed Mohammed, Khasim; kmpark@infradead.org; Pierre Ossman
>> Cc: linux-omap-open-source@linux.omap.com
>> Subject: RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
>>
>> Sorry, small correction. It can support from 0 to 26 Mhz or 0
>> to 52 Mhz We should be able to configure 48Mhz.
>>
>> Regards,
>> Khasim
>>
>> >-----Original Message-----
>> >From: linux-omap-open-source-bounces@linux.omap.com
>> [mailto:linux-omap-
>> >open-source-bounces@linux.omap.com] On Behalf Of Syed
>> Mohammed, Khasim
>> >Sent: Thursday, March 08, 2007 11:11 PM
>> >To: kmpark@infradead.org; Pierre Ossman
>> >Cc: linux-omap-open-source@linux.omap.com
>> >Subject: RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
>> >
>> >Hi Kyungmin,
>> >
>> >I haven't gone through the entire code as such, here is my
>> >understanding.
>> >
>> >>So if the the csd->mmca_vsn is CSD_SPEC_VER_4 then it always set
>> >highspeed.
>> >Yes, if card is 4.0 compliant then it's HS Card.
>> >
>> >>then what makes the highspeed enabled? host or card?
>> >Both - right? First controller should support such clock rates, and
>> card
>> >should be 4.0 (or more) compliant.
>> >
>> >>If the host supports up to 48MHz clock and card supports the
>> highspeed.
>> >>then what's the correct clock?
>> >If controller supports upto 48Mhz then I think we can only support
>> 26Mhz
>> >max. There are some special bits in 2430 processor to support 52 Mhz
>> >
>> >According to spec, a card can support both 52 & 26 or 26
>> (0x1 or 0x3).
>> >So, if our controller doesn't support 52Mhz clock rates then
>> we should
>> >stick to 26Mhz.
>> >
>> >Regards,
>> >Khasim
>> >
>> >>-----Original Message-----
>> >>From: Kyungmin Park [mailto:kmpark@infradead.org]
>> >>Sent: Thursday, March 08, 2007 8:42 PM
>> >>To: Syed Mohammed, Khasim; 'Pierre Ossman'
>> >>Cc: linux-omap-open-source@linux.omap.com
>> >>Subject: RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
>> >>
>> >>Hi Khasim,
>> >>
>> >>I checked the mmc code in linux-2.6.14-omap2420-omap2430. It is
used
>> >the
>> >>old samsung patch (mmcplus) in mmc core.
>> >>So if the the csd->mmca_vsn is CSD_SPEC_VER_4 then it always set
>> >highspeed.
>> >>the follwing code is always true if the chip is correct.
>> >>
>> >>              if ((ext_csd->card_type & MMCPLUS_26MHZ) || (ext_csd-
>> >>>card_type & MMCPLUS_52MHZ)) {
>> >>                        err = mmc_switch_hsmode(host, card);
>> >>                        if (err != MMC_ERR_NONE) {
>> >>                                mmc_card_set_dead(card);
>> >>                                continue;
>> >>                        }
>> >>                }
>> >>
>> >>then what makes the highspeed enabled? host or card?
>> >>If the host supports up to 48MHz clock and card supports the
>> highspeed.
>> >>then what's the correct clock?
>> >>
>> >>Currently if we don't set HIGHSPPED flags, it always set 20MHz as
in
>> >the
>> >>Spec. Since it is calculated from card->csd.max_dtr in
>> >>mmc_calculate_clock().
>> >>
>> >>        list_for_each_entry(card, &host->cards, node)
>> >>                if (!mmc_card_dead(card)) {
>> >>                        if (mmc_card_highspeed(card) &&
>> >mmc_card_sd(card))
>> >>{
>> >>                                if (max_dtr >
>> card->sw_caps.hs_max_dtr)
>> >>                                        max_dtr =
>> >card->sw_caps.hs_max_dtr;
>> >>                        } else if (mmc_card_highspeed(card) &&
>> >>!mmc_card_sd(card)) {
>> >>                                if (max_dtr >
>> card->ext_csd.hs_max_dtr)
>> >>                                        max_dtr =
>> >card->ext_csd.hs_max_dtr;
>> >>                        } else if (max_dtr > card->csd.max_dtr) {
>> >>                                max_dtr = card->csd.max_dtr;
>> >>                        }
>> >>                }
>> >>
>> >>Okay I will check the MMC Spec.
>> >>
>> >>Thank you,
>> >>Kyungmin Park
>> >>
>> >>
>> >>________________________________
>> >>
>> >>	From: Syed Mohammed, Khasim [mailto:x0khasim@ti.com]
>> >>	Sent: Thursday, March 08, 2007 9:02 PM
>> >>	To: kmpark@infradead.org; Pierre Ossman
>> >>	Cc: linux-omap-open-source@linux.omap.com
>> >>	Subject: RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
>> >>
>> >>
>> >>	Hi Kyungmin,
>> >>
>> >>	OMAP2420 doesn't support High Speed. OMAP2430 does
>> support Highspeed.
>> >>
>> >>	Please see our code for 2430 (its on linux.omap.com).
>> >>
>> >>	Regards,
>> >>	Khasim
>> >>
>> >>________________________________
>> >>
>> >>	From: linux-omap-open-source-bounces@linux.omap.com on
>> behalf of
>> >>Kyungmin Park
>> >>	Sent: Thu 3/8/2007 1:28 AM
>> >>	To: 'Pierre Ossman'
>> >>	Cc: linux-omap-open-source@linux.omap.com
>> >>	Subject: RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
>> >>
>> >>
>> >>
>> >>
>> >>	> Do _not_ take these flags lightly. If you enable them when
>> >>	> the hardware doesn't support the alternative timing, you have
>> >>	> a good chance of cards not working. So to me this looks very
>> >>	> wrong as the pre-48MHz controllers probably only follow the
>> >>	> legacy timing requirements.
>> >>	>
>> >>
>> >>	I'm not sure OMAP2 MMC supports highspeed feature. I can't find
>> >>anytings in
>> >>	OMAP2 TRM.
>> >>
>> >>	        if (cpu_class_is_omap2())
>> >>	                mmc->caps |= MMC_CAP_MMC_HIGHSPEED |
>> >>MMC_CAP_SD_HIGHSPEED;
>> >>
>> >>	mmc0: selected 48.000MHz transfer rate
>> >>	mmc0: clock 48000000Hz busmode 2 powermode 2 cs 0 Vdd
>> 20 width 2
>> >>timing 1
>> >>
>> >>	Then is it dependent on platform?
>> >>
>> >>	        if (minfo->highspeed)
>> >>	                mmc->caps |= MMC_CAP_MMC_HIGHSPEED |
>> >>MMC_CAP_SD_HIGHSPEED;
>> >>
>> >>	And even though we set HIGHSPEED, the card set their
>> clock correctly.
>> >>Is it
>> >>	right?
>> >>
>> >>	mmc0: selected 26.000MHz transfer rate
>> >>	mmc0: clock 26000000Hz busmode 2 powermode 2 cs 0 Vdd
>> 20 width 2
>> >>timing 1
>> >>
>> >>	Thank you,
>> >>	Kyungmin Park
>> >>
>> >>	_______________________________________________
>> >>	Linux-omap-open-source mailing list
>> >>	Linux-omap-open-source@linux.omap.com
>> >>	http://linux.omap.com/mailman/listinfo/linux-omap-open-source
>> >>
>> >>
>> >
>> >_______________________________________________
>> >Linux-omap-open-source mailing list
>> >Linux-omap-open-source@linux.omap.com
>> >http://linux.omap.com/mailman/listinfo/linux-omap-open-source
>>
>>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
       [not found] <45F0FC9F.3070701@drzeus.cx>
@ 2007-03-09  6:40 ` Syed Mohammed, Khasim
  0 siblings, 0 replies; 13+ messages in thread
From: Syed Mohammed, Khasim @ 2007-03-09  6:40 UTC (permalink / raw)
  To: Pierre Ossman, kmpark; +Cc: linux-omap-open-source

Hi Pierre,

If I am not wrong what you mean is,

If (card_is_4.0) then its HS {
	If (it supports 26 && 52) and ur controller can generate 52 Mhz
clk 
	then configure MMC_CLK to operate at 52Mhz

	If (card supports only 26) then configure MMC_CLK at 26Mhz.

	If (card can support upto 52 but controller can only support
till 48) 
	then configure MMC_CLK to 48 and issue a CMD4 to modify DSR (for
new 
	timing values).

	Now this DSR timing depends on what Controller can offer and it
doesn't depend on the frequency as such. Is this what you mean?

}
Else{
Not an HS
}

Regards,
Khasim




>-----Original Message-----
>From: Pierre Ossman [mailto:drzeus@drzeus.cx]
>Sent: Friday, March 09, 2007 12:20 AM
>To: kmpark@infradead.org
>Cc: Syed Mohammed, Khasim; linux-omap-open-source@linux.omap.com
>Subject: Re: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
>
>Kyungmin Park wrote:
>> Yes, that's my understanding.
>>
>> If the card is 4.0 compliant and OMAP2 supports up to 48MHz. then we
use
>> this 48MHz clock.
>>
>> But current mmc code down-grade to 20MHz since it's not set
highspeed.
>>
>> If the card is 4.0 compliant and even though host don't support
highspeed
>> feature, we set the highspeed flags for support host max clocks.
>> I think highspeed depends on host clock. Is it right?
>>
>
>No, high-speed is a _timing_ capability, not one of frequency (although
the
>new
>timing allows a higher maximum frequency). Hence, maximum clock has
>_nothing_ to
>do with what it can support. All it can tell you is that reasonably,
this
>controller should support at least one of SD or MMC high-speed, but it
>cannot
>tell you which.
>
>Rgds
>Pierre
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2
  2007-03-09  3:31 ` Syed Mohammed, Khasim
@ 2007-03-29 20:13   ` Tony Lindgren
  0 siblings, 0 replies; 13+ messages in thread
From: Tony Lindgren @ 2007-03-29 20:13 UTC (permalink / raw)
  To: Syed Mohammed, Khasim; +Cc: linux-omap-open-source, kmpark

Hi,

* Syed Mohammed, Khasim <x0khasim@ti.com> [070308 23:38]:
> Hi Kyungmin,
> 
> For OMAP2420 there are few MMC erratas,
> 
> 1. If MMC controller is configured for 4bit and if MMC CLK frequency is
> over 24Mhz it has as a diminishing impact on throughput. Hence, it is
> not recommended to use a clock over 24MHz for MMC 4 bits mode.

> >@@ -1096,7 +1098,10 @@ static int __init mmc_omap_probe(struct
> >platform_device *pdev)
> >
> > 	mmc->ops = &mmc_omap_ops;
> > 	mmc->f_min = 400000;
> >-	mmc->f_max = 24000000;
> >+	if (cpu_class_is_omap2())
> >+		mmc->f_max = 48000000;
> >+	else
> >+		mmc->f_max = 24000000;
> > 	mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
> > 	mmc->caps = MMC_CAP_MULTIWRITE | MMC_CAP_BYTEBLOCK;

How about throwing a cpu_is_omap2420() in there to work around the
clock limitation above mentioned by Khasim?

Tony

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-03-29 20:13 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-07  7:44 [PATCH] ARM: OMAP: MMC performance upgrade on OMAP2 Kyungmin Park
2007-03-08  6:06 ` Kyungmin Park
     [not found]   ` <45EFA96D.9010604@drzeus.cx>
2007-03-08  7:28     ` Kyungmin Park
2007-03-08 12:02       ` Syed Mohammed, Khasim
     [not found]         ` <45F00C93.2000305@drzeus.cx>
2007-03-08 13:16           ` Syed Mohammed, Khasim
2007-03-09  2:41         ` Kyungmin Park
2007-03-09  5:10           ` Syed Mohammed, Khasim
2007-03-09  5:18             ` Syed Mohammed, Khasim
2007-03-09  5:59               ` Kyungmin Park
2007-03-09  6:16                 ` Syed Mohammed, Khasim
2007-03-09  3:31 ` Syed Mohammed, Khasim
2007-03-29 20:13   ` Tony Lindgren
     [not found] <45F0FC9F.3070701@drzeus.cx>
2007-03-09  6:40 ` Syed Mohammed, Khasim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox