diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2009-07-01 10:07:22 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2009-07-01 10:07:22 +0000 |
commit | e0e24cbf0a3b11cb161e0ae057e4c383c6134801 (patch) | |
tree | fcfdb14a4b2984f4bc2c1bbc9657f11dcb03dcd7 /firmware/export/hotswap.h | |
parent | c929310e55bf337e4a31675a30031a7818f5deda (diff) |
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/export/hotswap.h')
-rw-r--r-- | firmware/export/hotswap.h | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/firmware/export/hotswap.h b/firmware/export/hotswap.h index 6872ca86db..a9bb745f38 100644 --- a/firmware/export/hotswap.h +++ b/firmware/export/hotswap.h @@ -26,34 +26,50 @@ typedef struct { bool initialized; - unsigned char bitrate_register; - unsigned long read_timeout; /* n * 8 clock cycles */ - unsigned long write_timeout; /* n * 8 clock cycles */ - unsigned long ocr; /* OCR register */ - unsigned long csd[4]; /* CSD register, 16 bytes */ - unsigned long cid[4]; /* CID register, 16 bytes */ - unsigned long speed; /* bit/s */ - unsigned int nsac; /* clock cycles */ - unsigned long tsac; /* n * 0.1 ns */ + unsigned long read_timeout; /* n * 8 clock cycles */ + unsigned long write_timeout; /* n * 8 clock cycles */ + + unsigned long ocr; /* OCR register */ + unsigned long csd[4]; /* CSD register, 16 bytes */ + unsigned long cid[4]; /* CID register, 16 bytes */ + unsigned long speed; /* bit/s */ + unsigned int nsac; /* clock cycles */ + unsigned long taac; /* n * 0.1 ns */ unsigned int r2w_factor; - unsigned long numblocks; /* size in flash blocks */ - unsigned int blocksize; /* block size in bytes */ + unsigned long numblocks; /* size in flash blocks */ + unsigned int blocksize; /* block size in bytes */ + +#if (CONFIG_STORAGE & STORAGE_MMC) + unsigned char bitrate_register; +#endif + +#if (CONFIG_STORAGE & STORAGE_SD) + unsigned long rca; /* RCA register */ + unsigned int current_bank; +#endif } tCardInfo; #if (CONFIG_STORAGE & STORAGE_SD) -#include "ata-sd-target.h" + +#include "sd.h" #define card_detect card_detect_target #define card_get_info card_get_info_target +tCardInfo *card_get_info_target(int card_no); + #ifdef HAVE_HOTSWAP #define card_enable_monitoring card_enable_monitoring_target #endif + #else /* STORAGE_MMC */ + #include "ata_mmc.h" #define card_detect mmc_detect #define card_get_info mmc_card_info +tCardInfo *mmc_card_info(int card_no); #define card_touched mmc_touched #define card_enable_monitoring mmc_enable_monitoring + #endif /* helper function to extract n (<=32) bits from an arbitrary position. |