public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Romain Izard <romain.izard.pro@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] generic mmc bug in reading sd card capacity
Date: Tue, 6 Nov 2012 08:41:06 +0000 (UTC)	[thread overview]
Message-ID: <k7aif2$r2o$1@ger.gmane.org> (raw)
In-Reply-To: 02e101cdb8c9$7a25fe60$6e71fb20$@keyasic.com

On 2012-11-02, victor <victor@keyasic.com> wrote:
> Hi All,
>
> Accord to SD spec 2.0, the formula to find out sd card capacity is:
>
> memory capacity = (C_SIZE+1) * 512K byte 
>  	and
> C_SIZE  is from CSD [69:48]
>
> Thus, the code in generic mmc is wrong for the high capacity sd card. My
> patch is below.
>

We should be careful about the fact that this only works for SD cards.
The size parameter is handled differently on MMC devices larger than
2 GiB. What do you think of the following patch:

(Compile tested only, I do not have a board available for testing right now)

8<----------------------------------------------------------------------

      reply	other threads:[~2012-11-06  8:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-02  7:12 [U-Boot] generic mmc bug in reading sd card capacity victor
2012-11-06  8:41 ` Romain Izard [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='k7aif2$r2o$1@ger.gmane.org' \
    --to=romain.izard.pro@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox