summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2014-06-19 18:32:23 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2014-06-19 18:32:23 (GMT)
commit5e200de5d3854fc9c6f30f11698b4a584041343b (patch)
tree1620e6a69c8a6ea6d043fc34e61279d2e2d8ffac
parent0cbd73024ca60225fc293e82779479dddd24c3aa (diff)
downloadabc8000-5e200de5d3854fc9c6f30f11698b4a584041343b.zip
abc8000-5e200de5d3854fc9c6f30f11698b4a584041343b.tar.gz
abc8000-5e200de5d3854fc9c6f30f11698b4a584041343b.tar.bz2
abc8000-5e200de5d3854fc9c6f30f11698b4a584041343b.tar.xz
sdcard: CSD C_SIZE field is 22 bits, not 21HEADmaster
The C_SIZE field in a type 2 (SDHC/SDXC) CSD is 22 bits wide (supports up to 2 TiB, not 1 TiB.) Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--data/sysrom/sdcard.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/data/sysrom/sdcard.c b/data/sysrom/sdcard.c
index 26738e4..a0ead30 100644
--- a/data/sysrom/sdcard.c
+++ b/data/sysrom/sdcard.c
@@ -512,7 +512,7 @@ static unsigned long sdcard_compute_size(struct sdcard_info *sdi)
lbasize = (c_size + 1) << (c_size_mult + read_bl_len + 2 - 9);
break;
case 2: /* SDHC/SDXC/eMMC card */
- c_size = ((sdi->csd.raw[1] & 0x1f) << 16) +
+ c_size = ((sdi->csd.raw[1] & 0x3f) << 16) +
(sdi->csd.raw[2] >> 16);
lbasize = c_size << 10;