[PATCH 2/6] mci: do not limit clock to card capabilities

Juergen Beisert jbe at pengutronix.de
Fri May 31 03:30:08 EDT 2013


Hi Sascha,

Sascha Hauer wrote:
> No need to limit the clock to the cards capabilities since the values
> passed to mci_set_clock are based on the cards capabilities. This
> enables MMC high speed cards to operate at higher speeds since on
> this cards the csd field only holds the non highspeed maximum clock.
>
> Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
> ---
>  drivers/mci/mci-core.c | 4 ----
>  1 file changed, 4 deletions(-)
>
> diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
> index 283df2f..895108f 100644
> --- a/drivers/mci/mci-core.c
> +++ b/drivers/mci/mci-core.c
> @@ -664,10 +664,6 @@ static void mci_set_clock(struct mci *mci, unsigned clock)
>       if (clock < host->f_min) 
>  		clock = host->f_min;
>
> -	/* check against the limit at the card's side */
> -	if (mci->tran_speed != 0 && clock > mci->tran_speed)
> -		clock = mci->tran_speed;
> -
>  	host->clock = clock;	/* the new target frequency */
>  	mci_set_ios(mci);
>  }

I'm not sure. In mci_startup_sd() there is a very primitive decision for the
clock frequency.

	/* if possible, speed up the transfer */
	if (mci->card_caps & MMC_MODE_HS)
		mci_set_clock(mci, 50000000);
	else
		mci_set_clock(mci, 25000000);

And yes, the spec tells us, there are two cards at 3.3 V available: 25 MHz and
50 MHz. But theoretically a vendor can limit the max transfer speed to a
different value. I'm confused about the spec here, as the card reports a max
transfer speed *and* a standard/high speed bit. Which one is reliable?

jbe

-- 
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | http://www.pengutronix.de/  |



More information about the barebox mailing list