diff options
author | Frank Gevaerts <frank@gevaerts.be> | 2010-06-05 21:12:16 +0000 |
---|---|---|
committer | Frank Gevaerts <frank@gevaerts.be> | 2010-06-05 21:12:16 +0000 |
commit | a0557b23f0c984576fd5a72657593211df148ca4 (patch) | |
tree | db0d1f7a3826bc6fb74965b100d25fb0870e553b /firmware/export/sdmmc.h | |
parent | 8bd527eaa00a9b256f2e371d79677445d34658fb (diff) | |
download | rockbox-a0557b23f0c984576fd5a72657593211df148ca4.tar.gz rockbox-a0557b23f0c984576fd5a72657593211df148ca4.zip |
remane hotswap.* to sdmmc.*. The contents have nothing at all to do with hotswapping things
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26598 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/sdmmc.h')
-rw-r--r-- | firmware/export/sdmmc.h | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/firmware/export/sdmmc.h b/firmware/export/sdmmc.h new file mode 100644 index 0000000000..6ac3bd2af5 --- /dev/null +++ b/firmware/export/sdmmc.h | |||
@@ -0,0 +1,80 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2004 by Jens Arnold | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | #ifndef __SDMMC_H__ | ||
22 | #define __SDMMC_H__ | ||
23 | |||
24 | #include <stdbool.h> | ||
25 | |||
26 | typedef struct | ||
27 | { | ||
28 | bool initialized; | ||
29 | |||
30 | unsigned long read_timeout; /* n * 8 clock cycles */ | ||
31 | unsigned long write_timeout; /* n * 8 clock cycles */ | ||
32 | |||
33 | unsigned long ocr; /* OCR register */ | ||
34 | unsigned long csd[4]; /* CSD register, 16 bytes */ | ||
35 | unsigned long cid[4]; /* CID register, 16 bytes */ | ||
36 | unsigned long speed; /* bit/s */ | ||
37 | unsigned int nsac; /* clock cycles */ | ||
38 | unsigned long taac; /* n * 0.1 ns */ | ||
39 | unsigned int r2w_factor; | ||
40 | unsigned long numblocks; /* size in flash blocks */ | ||
41 | unsigned int blocksize; /* block size in bytes */ | ||
42 | |||
43 | #if (CONFIG_STORAGE & STORAGE_MMC) | ||
44 | unsigned char bitrate_register; | ||
45 | #endif | ||
46 | |||
47 | #if (CONFIG_STORAGE & STORAGE_SD) | ||
48 | unsigned long rca; /* RCA register */ | ||
49 | unsigned int current_bank; | ||
50 | #endif | ||
51 | } tCardInfo; | ||
52 | |||
53 | #if (CONFIG_STORAGE & STORAGE_SD) | ||
54 | |||
55 | #include "sd.h" | ||
56 | #define card_get_info card_get_info_target | ||
57 | tCardInfo *card_get_info_target(int card_no); | ||
58 | void sd_parse_csd(tCardInfo *card); | ||
59 | |||
60 | #ifdef HAVE_HOTSWAP | ||
61 | #define card_enable_monitoring card_enable_monitoring_target | ||
62 | #endif | ||
63 | |||
64 | #else /* STORAGE_MMC */ | ||
65 | |||
66 | #include "ata_mmc.h" | ||
67 | #define card_get_info mmc_card_info | ||
68 | tCardInfo *mmc_card_info(int card_no); | ||
69 | #define card_touched mmc_touched | ||
70 | #define card_enable_monitoring mmc_enable_monitoring | ||
71 | |||
72 | #endif | ||
73 | |||
74 | /* helper function to extract n (<=32) bits from an arbitrary position. | ||
75 | counting from MSB to LSB */ | ||
76 | unsigned long card_extract_bits( | ||
77 | const unsigned long *p, /* the start of the bitfield array */ | ||
78 | unsigned int start, /* bit no. to start reading */ | ||
79 | unsigned int size); /* how many bits to read */ | ||
80 | #endif | ||