Commit 73f52410 authored by Kevin Hilman's avatar Kevin Hilman

Revert "mmc: host: davinci: reimplement read/write fifo in C"

This reverts commit 5912086e.
Signed-off-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
parent 6cb2d372
...@@ -225,73 +225,59 @@ MODULE_PARM_DESC(use_dma, "Wether to use DMA or not. Default = 1"); ...@@ -225,73 +225,59 @@ MODULE_PARM_DESC(use_dma, "Wether to use DMA or not. Default = 1");
#define RSP_TYPE(x) ((x) & ~(MMC_RSP_BUSY|MMC_RSP_OPCODE)) #define RSP_TYPE(x) ((x) & ~(MMC_RSP_BUSY|MMC_RSP_OPCODE))
static void davinci_mmc_read_fifo(struct mmc_davinci_host *host, #define DAVINCI_MMCSD_READ_FIFO(pDst, pRegs, cnt) asm( \
u16 len, u8 *dest) " cmp %3,#16\n" \
{ "1: ldrhs r0,[%1,%2]\n" \
void __iomem *fifo = host->base + DAVINCI_MMCDRR; " ldrhs r1,[%1,%2]\n" \
u16 index = 0; " ldrhs r2,[%1,%2]\n" \
" ldrhs r3,[%1,%2]\n" \
dev_dbg(mmc_dev(host->mmc), "RX fifo %p count %d buf %p\n", " stmhsia %0!,{r0,r1,r2,r3}\n" \
fifo, len, dest); " beq 3f\n" \
" subhs %3,%3,#16\n" \
if (likely((0x03 & (unsigned long) dest) == 0)) { " cmp %3,#16\n" \
if (len >= 4) { " bhs 1b\n" \
ioread32_rep(fifo, dest, len >> 2); " tst %3,#0x0c\n" \
index = len & ~0x03; "2: ldrne r0,[%1,%2]\n" \
} " strne r0,[%0],#4\n" \
if (len & 0x02) { " subne %3,%3,#4\n" \
*(u16 *)&dest[index] = ioread16(fifo); " tst %3,#0x0c\n" \
index += 2; " bne 2b\n" \
} " tst %3,#2\n" \
if (len & 0x01) { " ldrneh r0,[%1,%2]\n" \
dest[index] = ioread8(fifo); " strneh r0,[%0],#2\n" \
index += 1; " tst %3,#1\n" \
} " ldrneb r0,[%1,%2]\n" \
} else if ((0x01 & (unsigned long) dest) == 0) { " strneb r0,[%0],#1\n" \
if (len >= 2) { "3:\n" \
ioread16_rep(fifo, dest, len >> 1); : "+r"(pDst) : "r"(pRegs), "i"(DAVINCI_MMCDRR), \
index = len & ~0x01; "r"(cnt) : "r0", "r1", "r2", "r3");
}
if (len & 0x01) #define DAVINCI_MMCSD_WRITE_FIFO(pDst, pRegs, cnt) asm( \
dest[index] = ioread8(fifo); " cmp %3,#16\n" \
} else { "1: ldmhsia %0!,{r0,r1,r2,r3}\n" \
ioread8_rep(fifo, dest, len); " strhs r0,[%1,%2]\n" \
} " strhs r1,[%1,%2]\n" \
} " strhs r2,[%1,%2]\n" \
" strhs r3,[%1,%2]\n" \
static void davinci_mmc_write_fifo(struct mmc_davinci_host *host, " beq 3f\n" \
u16 len, const u8 *src) " subhs %3,%3,#16\n" \
{ " cmp %3,#16\n" \
void __iomem *fifo = host->base + DAVINCI_MMCDXR; " bhs 1b\n" \
u16 index = 0; " tst %3,#0x0c\n" \
"2: ldrne r0,[%0],#4\n" \
dev_dbg(mmc_dev(host->mmc), "TX fifo %p count %d buf %p\n", " strne r0,[%1,%2]\n" \
fifo, len, src); " subne %3,%3,#4\n" \
" tst %3,#0x0c\n" \
if (likely((0x03 & (unsigned long) src) == 0)) { " bne 2b\n" \
if (len >= 4) { " tst %3,#2\n" \
iowrite32_rep(fifo, src + index, len >> 2); " ldrneh r0,[%0],#2\n" \
index = len & ~0x03; " strneh r0,[%1,%2]\n" \
} " tst %3,#1\n" \
if (len & 0x02) { " ldrneb r0,[%0],#1\n" \
iowrite16(*(u16 *)&src[index], fifo); " strneb r0,[%1,%2]\n" \
index += 2; "3:\n" \
} : "+r"(pDst) : "r"(pRegs), "i"(DAVINCI_MMCDXR), \
if (len & 0x01) { "r"(cnt) : "r0", "r1", "r2", "r3");
iowrite8(src[index], fifo);
index += 1;
}
} else if ((0x01 & (unsigned long) src) == 0) {
if (len >= 2) {
iowrite16_rep(fifo, src + index, len >> 1);
index = len & ~0x01;
}
if (len & 0x01)
iowrite8(src[index], fifo);
} else {
iowrite8_rep(fifo, src, len);
}
}
/* PIO only */ /* PIO only */
static void mmc_davinci_sg_to_buf(struct mmc_davinci_host *host) static void mmc_davinci_sg_to_buf(struct mmc_davinci_host *host)
...@@ -321,11 +307,11 @@ static void davinci_fifo_data_trans(struct mmc_davinci_host *host, int n) ...@@ -321,11 +307,11 @@ static void davinci_fifo_data_trans(struct mmc_davinci_host *host, int n)
host->buffer_bytes_left -= n; host->buffer_bytes_left -= n;
host->bytes_left -= n; host->bytes_left -= n;
if (host->data_dir == DAVINCI_MMC_DATADIR_WRITE) if (host->data_dir == DAVINCI_MMC_DATADIR_WRITE) {
davinci_mmc_write_fifo(host, n, p); DAVINCI_MMCSD_WRITE_FIFO(p, host->base, n);
else } else {
davinci_mmc_read_fifo(host, n, p); DAVINCI_MMCSD_READ_FIFO(p, host->base, n);
}
host->buffer = p; host->buffer = p;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment