summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoshinori Sato <ysato@users.sourceforge.jp>2015-06-01 06:22:37 (GMT)
committerPantelis Antoniou <pantelis.antoniou@konsulko.com>2015-08-13 08:24:26 (GMT)
commit6f67b69b1592662ec49485101a2358b71070bf57 (patch)
treec3da90c0c3c8ec5d267a54e5ef9315e02d426206
parent760177dff4662d000c7b1331ec93b2ea4fbd564e (diff)
downloadu-boot-fsl-qoriq-6f67b69b1592662ec49485101a2358b71070bf57.tar.xz
mmc_spi: Big-endian support
Currently implement always swap for big-endian value. So doesn't work big-endian environment. Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
-rw-r--r--drivers/mmc/mmc_spi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/mmc/mmc_spi.c b/drivers/mmc/mmc_spi.c
index 5b5b33a..9032a73 100644
--- a/drivers/mmc/mmc_spi.c
+++ b/drivers/mmc/mmc_spi.c
@@ -11,7 +11,7 @@
#include <spi.h>
#include <crc.h>
#include <linux/crc7.h>
-#include <linux/byteorder/swab.h>
+#include <asm/byteorder.h>
/* MMC/SD in SPI mode reports R1 status always */
#define R1_SPI_IDLE (1 << 0)
@@ -91,7 +91,7 @@ static uint mmc_spi_readdata(struct mmc *mmc, void *xbuf,
spi_xfer(spi, bsize * 8, NULL, buf, 0);
spi_xfer(spi, 2 * 8, NULL, &crc, 0);
#ifdef CONFIG_MMC_SPI_CRC_ON
- if (swab16(cyg_crc16(buf, bsize)) != crc) {
+ if (be_to_cpu16(cyg_crc16(buf, bsize)) != crc) {
debug("%s: CRC error\n", mmc->cfg->name);
r1 = R1_SPI_COM_CRC;
break;
@@ -120,7 +120,7 @@ static uint mmc_spi_writedata(struct mmc *mmc, const void *xbuf,
tok[1] = multi ? SPI_TOKEN_MULTI_WRITE : SPI_TOKEN_SINGLE;
while (bcnt--) {
#ifdef CONFIG_MMC_SPI_CRC_ON
- crc = swab16(cyg_crc16((u8 *)buf, bsize));
+ crc = cpu_to_be16(cyg_crc16((u8 *)buf, bsize));
#endif
spi_xfer(spi, 2 * 8, tok, NULL, 0);
spi_xfer(spi, bsize * 8, buf, NULL, 0);
@@ -193,7 +193,7 @@ static int mmc_spi_request(struct mmc *mmc, struct mmc_cmd *cmd,
} else if (cmd->resp_type == MMC_RSP_R2) {
r1 = mmc_spi_readdata(mmc, cmd->response, 1, 16);
for (i = 0; i < 4; i++)
- cmd->response[i] = swab32(cmd->response[i]);
+ cmd->response[i] = be32_to_cpu(cmd->response[i]);
debug("r128 %x %x %x %x\n", cmd->response[0], cmd->response[1],
cmd->response[2], cmd->response[3]);
} else if (!data) {
@@ -205,7 +205,7 @@ static int mmc_spi_request(struct mmc *mmc, struct mmc_cmd *cmd,
case SD_CMD_SEND_IF_COND:
case MMC_CMD_SPI_READ_OCR:
spi_xfer(spi, 4 * 8, NULL, cmd->response, 0);
- cmd->response[0] = swab32(cmd->response[0]);
+ cmd->response[0] = be32_to_cpu(cmd->response[0]);
debug("r32 %x\n", cmd->response[0]);
break;
case MMC_CMD_SEND_STATUS: