diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2009-07-01 19:13:01 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2009-07-01 19:13:01 +0000 |
commit | 93f6e3df246ff50c24524c9d329f27a06e1845db (patch) | |
tree | 9a625a9dd00b34fc8cd317840c41f27e0f33ea00 /firmware/target | |
parent | 7ab33f165ca92c5cbaa76c57cf861fd4c72b1930 (diff) |
card_extract_bits() take the start bit argument as defined in public SanDisk specifications for SD and MMC, i.e. bit 0 is the lsb
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21600 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target')
-rw-r--r-- | firmware/target/arm/ata-sd-pp.c | 10 | ||||
-rw-r--r-- | firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/firmware/target/arm/ata-sd-pp.c b/firmware/target/arm/ata-sd-pp.c index ade5b8090b..8f30195791 100644 --- a/firmware/target/arm/ata-sd-pp.c +++ b/firmware/target/arm/ata-sd-pp.c @@ -1306,12 +1306,12 @@ tCardInfo *card_get_info_target(int card_no) for(i=0; i<4; i++) card.cid[i] = card_info[card_no].cid[3-i]; card.numblocks = card_info[card_no].numblocks; card.blocksize = card_info[card_no].blocksize; - temp = card_extract_bits(card.csd, 29, 3); - card.speed = mantissa[card_extract_bits(card.csd, 25, 4)] + temp = card_extract_bits(card.csd, 98, 3); + card.speed = mantissa[card_extract_bits(card.csd, 102, 4)] * exponent[temp > 2 ? 7 : temp + 4]; - card.nsac = 100 * card_extract_bits(card.csd, 16, 8); - temp = card_extract_bits(card.csd, 13, 3); - card.taac = mantissa[card_extract_bits(card.csd, 9, 4)] + card.nsac = 100 * card_extract_bits(card.csd, 111, 8); + temp = card_extract_bits(card.csd, 114, 3); + card.taac = mantissa[card_extract_bits(card.csd, 118, 4)] * exponent[temp] / 10; card.cid[0] = htobe32(card.cid[0]); /* ascii chars here */ card.cid[1] = htobe32(card.cid[1]); /* ascii chars here */ diff --git a/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c b/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c index 31a9f7d2b0..6e7f62a2e5 100644 --- a/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c +++ b/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c @@ -1675,12 +1675,12 @@ tCardInfo* card_get_info_target(int card_no) card.csd[i] = ((unsigned long*)&mmcinfo.csd)[i]; for(i=0; i<4; i++) card.cid[i] = ((unsigned long*)&mmcinfo.cid)[i]; - temp = card_extract_bits(card.csd, 29, 3); - card.speed = sd_mantissa[card_extract_bits(card.csd, 25, 4)] + temp = card_extract_bits(card.csd, 98, 3); + card.speed = sd_mantissa[card_extract_bits(card.csd, 102, 4)] * sd_exponent[temp > 2 ? 7 : temp + 4]; - card.nsac = 100 * card_extract_bits(card.csd, 16, 8); - temp = card_extract_bits(card.csd, 13, 3); - card.taac = sd_mantissa[card_extract_bits(card.csd, 9, 4)] + card.nsac = 100 * card_extract_bits(card.csd, 111, 8); + temp = card_extract_bits(card.csd, 114, 3); + card.taac = sd_mantissa[card_extract_bits(card.csd, 118, 4)] * sd_exponent[temp] / 10; card.numblocks = mmcinfo.block_num; card.blocksize = mmcinfo.block_len; |