summaryrefslogtreecommitdiff
path: root/firmware/export/mmc.h
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2012-08-21 16:25:11 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2012-08-21 16:28:36 +0200
commit41bf9ebc89415380751f2d457db5afac0c824369 (patch)
tree5c6b4a57532fefd853e01fd721fccec1d87857d1 /firmware/export/mmc.h
parent39396cc70752748c3fbafa6a0afc26835719b9e4 (diff)
downloadrockbox-41bf9ebc89415380751f2d457db5afac0c824369.tar.gz
rockbox-41bf9ebc89415380751f2d457db5afac0c824369.zip
imx233: simplify sd/mmc driver
Further merge drivers by using the same command and data functions. No use one mutex per drive instead of a global sd lock. Fix the RCA handling which was different between SD and MMC (shifted 16) and thus confusing. Add MMC commands definition to the mmc.h header similarly to the SD one. Change MMC handling a bit by selecting/deselecting on each transfer like SD, which allows for several MMC devices in theory and is more uniform. Change-Id: I7024cb19c079553806138ead75b00640f1d2d95c
Diffstat (limited to 'firmware/export/mmc.h')
-rw-r--r--firmware/export/mmc.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/firmware/export/mmc.h b/firmware/export/mmc.h
index 4c7e9c0926..8d20f81236 100644
--- a/firmware/export/mmc.h
+++ b/firmware/export/mmc.h
@@ -55,5 +55,55 @@ long mmc_last_disk_activity(void);
55int mmc_num_drives(int first_drive); 55int mmc_num_drives(int first_drive);
56#endif 56#endif
57 57
58/* MMC States */
59#define MMC_IDLE 0
60#define MMC_READY 1
61#define MMC_IDENT 2
62#define MMC_STBY 3
63#define MMC_TRAN 4
64#define MMC_DATA 5
65#define MMC_RCV 6
66#define MMC_PRG 7
67#define MMC_DIS 8
68#define MMC_BTST 9
69
70/* MMC Commands */
71#define MMC_GO_IDLE_STATE 0
72#define MMC_SEND_OP_COND 1
73#define MMC_ALL_SEND_CID 2
74#define MMC_SET_RELATIVE_ADDR 3
75#define MMC_SET_DSR 4
76#define MMC_SWITCH 6
77#define MMC_SELECT_CARD 7 /* with card's rca */
78#define MMC_DESELECT_CARD 7 /* with rca = 0 */
79#define MMC_SEND_EXT_CSD 8
80#define MMC_SEND_CSD 9
81#define MMC_SEND_CID 10
82#define MMC_READ_DAT_UNTIL_STOP 11
83#define MMC_STOP_TRANSMISSION 12
84#define MMC_SEND_STATUS 13
85#define MMC_BUSTEST_R 14
86#define MMC_GO_INACTIVE_STATE 15
87#define MMC_SET_BLOCKLEN 16
88#define MMC_READ_SINGLE_BLOCK 17
89#define MMC_READ_MULTIPLE_BLOCK 18
90#define MMC_BUSTEST_W 19
91#define MMC_WRITE_DAT_UNTIL_STOP 20
92#define MMC_SET_BLOCK_COUNT 23
93#define MMC_WRITE_BLOCK 24
94#define MMC_WRITE_MULTIPLE_BLOCK 25
95#define MMC_PROGRAM_CID 26
96#define MMC_PROGRAM_CSD 27
97#define MMC_SET_WRITE_PROT 28
98#define MMC_CLR_WRITE_PROT 29
99#define MMC_SEND_WRITE_PROT 30
100#define MMC_ERASE_GROUP_START 35
101#define MMC_ERASE_GROUP_END 36
102#define MMC_ERASE 38
103#define MMC_FAST_IO 39
104#define MMC_GO_IRQ_STATE 40
105#define MMC_LOCK_UNLOCK 42
106#define MMC_APP_CMD 55
107#define MMC_GEN_CMD 56
58 108
59#endif 109#endif