1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2002 by Alan Korr
11 * Copyright (C) 2008 by Frank Gevaerts
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
21 ****************************************************************************/
27 #include "mv.h" /* for HAVE_MULTIDRIVE or not */
31 void mmc_enable(bool on
);
32 void mmc_spindown(int seconds
);
34 void mmc_sleepnow(void);
35 bool mmc_disk_is_active(void);
36 int mmc_soft_reset(void);
37 int mmc_init(void) STORAGE_INIT_ATTR
;
39 int mmc_read_sectors(IF_MD2(int drive
,) unsigned long start
, int count
, void* buf
);
40 int mmc_write_sectors(IF_MD2(int drive
,) unsigned long start
, int count
, const void* buf
);
42 int mmc_spinup_time(void);
44 #ifdef STORAGE_GET_INFO
45 void mmc_get_info(IF_MD2(int drive
,) struct storage_info
*info
);
48 bool mmc_removable(IF_MD_NONVOID(int drive
));
49 bool mmc_present(IF_MD_NONVOID(int drive
));
52 long mmc_last_disk_activity(void);
54 #ifdef CONFIG_STORAGE_MULTI
55 int mmc_num_drives(int first_drive
);
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
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
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