From: Juergen Beisert <jbe@pengutronix.de>
To: barebox@lists.infradead.org
Subject: Re: SD card experts wanted
Date: Thu, 30 Aug 2012 20:05:56 +0200 [thread overview]
Message-ID: <201208302005.56531.jbe@pengutronix.de> (raw)
In-Reply-To: <20120830164720.GA22722@sig21.net>
Hi Johannes,
Johannes Stezenbach wrote:
> On Thu, Aug 30, 2012 at 03:08:19PM +0200, Juergen Beisert wrote:
> > Johannes Stezenbach wrote:
> > > MMC has the following speed modes:
> > >
> > > - legacy 0-26MHz
> > > - high speed SDR 0-52MHz
> > > - high speed DDR 0-52MHz
> > > - HS200 SDR 0-200MHz
> >
> > Ahh, here come the curious 26 MHz and 52 MHz into the game. Its related
> > to MMC only.
> >
> > > while SD has:
> > >
> > > - SDR12
> > > - SDR25
> > > - SDR50
> > > - SDR104
> > > - DDR50
> > >
> > > So my guess is that MMC_MODE_HS maps to SDR25 for SD-only,
> > > and MMC_MODE_HS_52MHz maps to SDR50 for SD and MMC.
> > >
> > > (Apparently mmc_change_freq always sets MMC_MODE_HS, it is
> > > meaningless for MMC.)
> > >
> > > Thus, mci_startup_sd() should do:
> > > if (mci->card_caps & MMC_MODE_HS)
> > > mci_set_clock(mci, 25000000);
> > > else
> > > mci_set_clock(mci, 12500000);
> >
> > As far as I understand the spec, there is a max. speed field in the CSD
> > which tells us the regular max. speed of this card. And the fields from
> > the CSR can overwrite the CSD settings. So, a card which reports 25 MHz
> > in the CSD can still enable 50 MHz (SDR50) in the CSR and the SDHC then
> > can use 50 MHz for the clock. But maybe I'm wrong here.
>
> What I wrote is not even correct ;-/
>
> SD has legacy Default Mode and legacy High Speed mode,
> and "Ultra High Speed" modes. SDR12, SDR25, SDR50, SDR104 and DDR50
> are all UHS modes. And Default Mode and SDR12 support up to 12.5MB/s,
> but the bus clock is up to 25MHz (4 bit parallel).
> So the code in mci_startup_sd() is correct as is.
Now I found the Abbreviations in the spec:
UHS Ultra High Speed
SDR12 One of UHS modes with single data rate. Up to 12.5MB/sec at 25MHz
SDR25 One of UHS modes with single data rate. Up to 25MB/sec at 50MHz
SDR50 One of UHS modes with single data rate. Up to 50MB/sec at 100MHz
SDR104 One of UHS modes with single data rate. Up to 104MB/sec at 208MHz
So they mean the transfer capacity in "bytes per second" and not the clock
speed with their SDR<number>. Thanks for this hint.
Reading further discovers:
* all these UHS modes are _not_ valid for SDSC type of SD cards (up to 2 GiB
capacity)
This information should help to get the code right.
> Regarding CSD, my understanding is that TRAN_SPEED only
> applies to legacy Default Mode. If the card supports HS mode
> or UHS modes then it must be able to use 50MHz clock.
Ack.
Regards,
Juergen
--
Pengutronix e.K. | Juergen Beisert |
Linux Solutions for Science and Industry | http://www.pengutronix.de/ |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2012-08-30 18:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-29 21:17 SD card experts wanted Juergen Beisert
2012-08-30 3:27 ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-30 10:04 ` Johannes Stezenbach
2012-08-30 13:08 ` Juergen Beisert
2012-08-30 16:47 ` Johannes Stezenbach
2012-08-30 18:05 ` Juergen Beisert [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201208302005.56531.jbe@pengutronix.de \
--to=jbe@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.