summaryrefslogtreecommitdiffstats
path: root/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2009-07-01 10:07:22 +0000
committerRafaël Carré <rafael.carre@gmail.com>2009-07-01 10:07:22 +0000
commite0e24cbf0a3b11cb161e0ae057e4c383c6134801 (patch)
treefcfdb14a4b2984f4bc2c1bbc9657f11dcb03dcd7 /firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c
parentc929310e55bf337e4a31675a30031a7818f5deda (diff)
downloadrockbox-e0e24cbf0a3b11cb161e0ae057e4c383c6134801.tar.gz
rockbox-e0e24cbf0a3b11cb161e0ae057e4c383c6134801.tar.bz2
rockbox-e0e24cbf0a3b11cb161e0ae057e4c383c6134801.zip
Merge tCardInfo struct (MMC) and tSDCardInfo struct (SD)
Put specific members under #ifdef (CONFIG_STORAGE & STORAGE_xx) (2 members for SD and 1 for MMC) Fix a typo: tsac doesn't exist and must be read taac Move card_get_info functions declaration inside hotswap.h to remove mutual inclusion of ata_mmc.h and hotswap.h Move static const data structures from SD drivers into sd.h (sd_exponent and sd_mantissa) Fix sd_command prototypes in SD drivers (card registers are unsigned long) Fix speed calculation in Sansa AMS driver (PP SD driver needs to be checked) Move ata-sd-target.h to sd-pp-target.h to reflect the PP specifity. Now it only contains declaration of microsd_int() Remove unused ata-sd-target.h for injenic TODO: - check if CSD register bits are extracted correctly in PP driver - correctly define read_timeout and write_timeout unit for MMC & SD, and use timeouts in Sansa AMS driver git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21586 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c')
-rw-r--r--firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c b/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c
index fd4a96f230..0ec1791928 100644
--- a/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c
+++ b/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c
@@ -1672,10 +1672,6 @@ tCardInfo* card_get_info_target(int card_no)
(void)card_no;
int i, temp;
static tCardInfo card;
- static const char mantissa[] = { /* *10 */
- 0, 10, 12, 13, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70, 80 };
- static const int exponent[] = { /* use varies */
- 1,10,100,1000,10000,100000,1000000,10000000,100000000,1000000000 };
card.initialized = true;
card.ocr = 0;
@@ -1684,12 +1680,12 @@ tCardInfo* card_get_info_target(int card_no)
for(i=0; i<4; i++)
card.cid[i] = (*((unsigned long*)&mmcinfo.cid+4*i));
temp = card_extract_bits(card.csd, 29, 3);
- card.speed = mantissa[card_extract_bits(card.csd, 25, 4)]
- * exponent[temp > 2 ? 7 : temp + 4];
+ card.speed = sd_mantissa[card_extract_bits(card.csd, 25, 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.tsac = mantissa[card_extract_bits(card.csd, 9, 4)]
- * exponent[temp] / 10;
+ card.taac = sd_mantissa[card_extract_bits(card.csd, 9, 4)]
+ * sd_exponent[temp] / 10;
card.numblocks = mmcinfo.block_num;
card.blocksize = mmcinfo.block_len;