From: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/4] MMC Card Capacity Bug Fix
Date: Fri, 14 May 2010 13:46:23 +0530 [thread overview]
Message-ID: <014e01caf33d$bde75710$39b60530$@raj@ti.com> (raw)
In-Reply-To: <1273657107-7148-2-git-send-email-alagusankar@embwise.com>
Hi Alagu,
On Wed, May 12, 2010 at 15:08:25, Alagu Sankar wrote:
> Fixed a bug in card capacity calculation for MMC high-capacity cards.
>
> Signed-off-by: Alagu Sankar <alagusankar@embwise.com>
> ---
> drivers/mmc/mmc.c | 9 ++++++++-
> 1 files changed, 8 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index 959d8ad..e7abf94 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -393,6 +393,7 @@ int mmc_change_freq(struct mmc *mmc)
> char ext_csd[512];
> char cardtype;
> int err;
> + unsigned int sec_count;
>
This can be uint too or you can use unsigned int to typecast below.
Regards,
Sudhakar
> mmc->card_caps = 0;
>
> @@ -407,8 +408,14 @@ int mmc_change_freq(struct mmc *mmc)
> if (err)
> return err;
>
> - if (ext_csd[212] || ext_csd[213] || ext_csd[214] || ext_csd[215])
> + sec_count = ((uint)ext_csd[212] |
> + ((uint)ext_csd[213] << 8) |
> + ((uint)ext_csd[214] << 16) |
> + ((uint)ext_csd[215] << 24));
> + if (sec_count) {
> mmc->high_capacity = 1;
> + mmc->capacity = sec_count * 512;
> + }
>
> cardtype = ext_csd[196] & 0xf;
>
> --
> 1.6.0.6
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
next prev parent reply other threads:[~2010-05-14 8:16 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-12 9:38 [U-Boot] [PATCH 1/4] SD1.00 wide-bus fix Alagu Sankar
2010-05-12 9:38 ` [U-Boot] [PATCH 2/4] MMC Card Capacity Bug Fix Alagu Sankar
2010-05-12 9:38 ` [U-Boot] [PATCH 3/4] MMC Multi-block Support Alagu Sankar
2010-05-12 9:38 ` [U-Boot] [PATCH 4/4] Environment in MMC Alagu Sankar
2010-05-13 7:08 ` Lv Terry-R65388
2010-05-14 8:26 ` Sudhakar Rajashekhara
2010-05-14 9:52 ` Wolfgang Denk
2010-05-14 10:02 ` Stefano Babic
2010-05-14 10:54 ` Alagu Sankar
2010-05-14 11:40 ` Stefano Babic
2010-05-14 11:54 ` Alagu Sankar
2010-05-17 7:31 ` Lv Terry-R65388
2010-05-14 17:37 ` [U-Boot] [PATCH 3/4] MMC Multi-block Support Andy Fleming
2010-09-13 7:51 ` Lei Wen
2010-10-04 20:32 ` John Rigby
2010-10-14 21:44 ` Steve Sakoman
2010-10-14 21:53 ` Paulraj, Sandeep
2010-10-23 15:14 ` Ghorai, Sukumar
2010-10-25 17:29 ` Steve Sakoman
2010-10-25 18:19 ` Ghorai, Sukumar
2010-05-14 8:16 ` Sudhakar Rajashekhara [this message]
2010-05-14 17:32 ` [U-Boot] [PATCH 2/4] MMC Card Capacity Bug Fix Andy Fleming
2010-05-13 15:13 ` [U-Boot] [PATCH 1/4] SD1.00 wide-bus fix Paulraj, Sandeep
2010-05-14 17:30 ` Andy Fleming
2010-09-09 22:21 ` John Rigby
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='014e01caf33d$bde75710$39b60530$@raj@ti.com' \
--to=sudhakar.raj@ti.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