1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright © 2008 Rafaël Carré
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.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 /* ARM PrimeCell PL180 SD/MMC controller */
26 /* bits 10:0 can be cleared by a write in MCIClear */
27 #define MCI_CMD_CRC_FAIL (1<<0)
28 #define MCI_DATA_CRC_FAIL (1<<1)
29 #define MCI_CMD_TIMEOUT (1<<2)
30 #define MCI_DATA_TIMEOUT (1<<3)
31 #define MCI_TX_UNDERRUN (1<<4)
32 #define MCI_RX_OVERRUN (1<<5)
33 #define MCI_CMD_RESP_END (1<<6)
34 #define MCI_CMD_SENT (1<<7)
35 #define MCI_DATA_END (1<<8)
36 #define MCI_START_BIT_ERR (1<<9)
37 #define MCI_DATA_BLOCK_END (1<<10)
38 /* bits 21:11 are only cleared by the hardware logic */
39 #define MCI_CMD_ACTIVE (1<<11)
40 #define MCI_TX_ACTIVE (1<<12)
41 #define MCI_RX_ACTIVE (1<<13)
42 #define MCI_TX_FIFO_HALF_EMPTY (1<<14)
43 #define MCI_RX_FIFO_HALF_FULL (1<<15)
44 #define MCI_TX_FIFO_FULL (1<<16)
45 #define MCI_RX_FIFO_FULL (1<<17)
46 #define MCI_TX_FIFO_EMPTY (1<<18)
47 #define MCI_RX_FIFO_EMPTY (1<<19)
48 #define MCI_TX_DATA_AVAIL (1<<20)
49 #define MCI_RX_DATA_AVAIL (1<<21)
53 #define MCI_POWER_OFF 0x0
55 #define MCI_POWER_UP 0x2
56 #define MCI_POWER_ON 0x3
58 /* bits 5:2 are the voltage */
60 #define MCI_POWER_OPEN_DRAIN (1<<6)
61 #define MCI_POWER_ROD (1<<7)
65 /* bits 7:0 are the clock divider */
66 #define MCI_CLOCK_ENABLE (1<<8)
67 #define MCI_CLOCK_POWERSAVE (1<<9)
68 #define MCI_CLOCK_BYPASS (1<<10)
69 #define MCI_CLOCK_WIDEBUS (1<<11)
73 /* bits 5:0 are the command index */
74 #define MCI_COMMAND_RESPONSE (1<<6)
75 #define MCI_COMMAND_LONG_RESPONSE (1<<7)
76 #define MCI_COMMAND_INTERRUPT (1<<8)
77 #define MCI_COMMAND_PENDING (1<<9)
78 #define MCI_COMMAND_ENABLE (1<<10)