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)
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);
int mmc_num_drives(int first_drive);
#endif
+/* MMC States */
+#define MMC_IDLE 0
+#define MMC_READY 1
+#define MMC_IDENT 2
+#define MMC_STBY 3
+#define MMC_TRAN 4
+#define MMC_DATA 5
+#define MMC_RCV 6
+#define MMC_PRG 7
+#define MMC_DIS 8
+#define MMC_BTST 9
+
+/* MMC Commands */
+#define MMC_GO_IDLE_STATE 0
+#define MMC_SEND_OP_COND 1
+#define MMC_ALL_SEND_CID 2
+#define MMC_SET_RELATIVE_ADDR 3
+#define MMC_SET_DSR 4
+#define MMC_SWITCH 6
+#define MMC_SELECT_CARD 7 /* with card's rca */
+#define MMC_DESELECT_CARD 7 /* with rca = 0 */
+#define MMC_SEND_EXT_CSD 8
+#define MMC_SEND_CSD 9
+#define MMC_SEND_CID 10
+#define MMC_READ_DAT_UNTIL_STOP 11
+#define MMC_STOP_TRANSMISSION 12
+#define MMC_SEND_STATUS 13
+#define MMC_BUSTEST_R 14
+#define MMC_GO_INACTIVE_STATE 15
+#define MMC_SET_BLOCKLEN 16
+#define MMC_READ_SINGLE_BLOCK 17
+#define MMC_READ_MULTIPLE_BLOCK 18
+#define MMC_BUSTEST_W 19
+#define MMC_WRITE_DAT_UNTIL_STOP 20
+#define MMC_SET_BLOCK_COUNT 23
+#define MMC_WRITE_BLOCK 24
+#define MMC_WRITE_MULTIPLE_BLOCK 25
+#define MMC_PROGRAM_CID 26
+#define MMC_PROGRAM_CSD 27
+#define MMC_SET_WRITE_PROT 28
+#define MMC_CLR_WRITE_PROT 29
+#define MMC_SEND_WRITE_PROT 30
+#define MMC_ERASE_GROUP_START 35
+#define MMC_ERASE_GROUP_END 36
+#define MMC_ERASE 38
+#define MMC_FAST_IO 39
+#define MMC_GO_IRQ_STATE 40
+#define MMC_LOCK_UNLOCK 42
+#define MMC_APP_CMD 55
+#define MMC_GEN_CMD 56
#endif