summaryrefslogtreecommitdiffstats
path: root/drivers/mci/mci_spi.c
diff options
context:
space:
mode:
authorFranck Jullien <franck.jullien@gmail.com>2012-11-12 22:16:31 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2012-11-14 21:08:55 +0100
commitd4695def29861ac920eb055b73f58145159ccc77 (patch)
treec61afd6a14e6efe1d1c2d0ad52ee1a4974279eac /drivers/mci/mci_spi.c
parent9b8fa53626b66eb4c3c3a74122de33c2728d8b00 (diff)
downloadbarebox-d4695def29861ac920eb055b73f58145159ccc77.tar.gz
barebox-d4695def29861ac920eb055b73f58145159ccc77.tar.xz
mci_spi: always compute command crc byte
The spec says: "the CMD8 CRC verification is always enabled. The Host shall set correct CRC in the argument ofCMD8. If CRC error is detected, card returns CRC error in R1 response regardless of command index." Make it simple, and compute crc on every commands. Signed-off-by: Franck Jullien <franck.jullien@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mci/mci_spi.c')
-rw-r--r--drivers/mci/mci_spi.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/drivers/mci/mci_spi.c b/drivers/mci/mci_spi.c
index 5894104231..cb5e0bb981 100644
--- a/drivers/mci/mci_spi.c
+++ b/drivers/mci/mci_spi.c
@@ -121,14 +121,6 @@ mmc_spi_writebytes(struct mmc_spi_host *host, unsigned len, void *data)
return status;
}
-/*
- * Note that while the CRC, in general, is ignored in SPI mode, the very first
- * command must be followed by a valid CRC, since the card is not yet in SPI mode.
- * The CRC byte for a CMD0 command with a zero argument is a constant 0x4A. For
- * simplicity, this CRC byte is always sent with every command.
- */
-#define MMC_SPI_CMD0_CRC ((0x4a << 1) | 0x1)
-
static int mmc_spi_command_send(struct mmc_spi_host *host, struct mci_cmd *cmd)
{
uint8_t r1;
@@ -141,11 +133,7 @@ static int mmc_spi_command_send(struct mmc_spi_host *host, struct mci_cmd *cmd)
command[3] = cmd->cmdarg >> 16;
command[4] = cmd->cmdarg >> 8;
command[5] = cmd->cmdarg;
-#ifdef CONFIG_MMC_SPI_CRC_ON
command[6] = (crc7(0, &command[1], 5) << 1) | 0x01;
-#else
- command[6] = MMC_SPI_CMD0_CRC;
-#endif
mmc_spi_writebytes(host, 7, command);