diff options
author | Franck Jullien <franck.jullien@gmail.com> | 2011-11-24 21:46:33 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-11-25 12:38:29 +0100 |
commit | 2aad209b78fcd617ba89d4e29cac09b6948eace3 (patch) | |
tree | f0377ea4641fc0195b0012b18ccb49e6ff4e7abf /include/mci.h | |
parent | 52ef4af579d1755e0879ced30aa2038386d42c20 (diff) | |
download | barebox-2aad209b78fcd617ba89d4e29cac09b6948eace3.tar.gz barebox-2aad209b78fcd617ba89d4e29cac09b6948eace3.tar.xz |
mci: Add MCI over SPI support
This patch adds MMC over SPI support to mci-core.c and
mci_spi.c driver.
This driver is useful when SOC doesn't have built-in MCI
component. Tested with nios, 2Go SD-CARD and FAT file system.
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/mci.h')
-rw-r--r-- | include/mci.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/mci.h b/include/mci.h index 69cffe8d3f..d581f99929 100644 --- a/include/mci.h +++ b/include/mci.h @@ -49,6 +49,7 @@ #define MMC_MODE_HS 0x001 #define MMC_MODE_HS_52MHz 0x010 +#define MMC_CAP_SPI 0x020 #define MMC_MODE_4BIT 0x100 #define MMC_MODE_8BIT 0x200 @@ -56,6 +57,12 @@ #define IS_SD(x) (x->version & SD_VERSION_SD) +#ifdef CONFIG_MCI_SPI +#define mmc_host_is_spi(host) ((host)->host_caps & MMC_CAP_SPI) +#else +#define mmc_host_is_spi(host) 0 +#endif + #define MMC_DATA_READ 1 #define MMC_DATA_WRITE 2 @@ -78,6 +85,8 @@ #define MMC_CMD_WRITE_SINGLE_BLOCK 24 #define MMC_CMD_WRITE_MULTIPLE_BLOCK 25 #define MMC_CMD_APP_CMD 55 +#define MMC_CMD_SPI_READ_OCR 58 +#define MMC_CMD_SPI_CRC_ON_OFF 59 #define SD_CMD_SEND_RELATIVE_ADDR 3 #define SD_CMD_SWITCH_FUNC 6 @@ -155,6 +164,15 @@ #define R1_ILLEGAL_COMMAND (1 << 22) #define R1_APP_CMD (1 << 5) +#define R1_SPI_IDLE (1 << 0) +#define R1_SPI_ERASE_RESET (1 << 1) +#define R1_SPI_ILLEGAL_COMMAND (1 << 2) +#define R1_SPI_COM_CRC (1 << 3) +#define R1_SPI_ERASE_SEQ (1 << 4) +#define R1_SPI_ADDRESS (1 << 5) +#define R1_SPI_PARAMETER (1 << 6) +#define R1_SPI_ERROR (1 << 7) + /* response types */ #define MMC_RSP_PRESENT (1 << 0) #define MMC_RSP_136 (1 << 1) /* 136 bit response */ |