mci: mmci: Fix read FIFO handling
According to the Linux kernel and the qemu code, the MMCIFIFOCNT contains
the remaining number of words to read, excluding those that are already in
the FIFO. So the current number of bytes in the FIFO is
host_remain - (readl(base + MMCIFIFOCNT) << 2).

Also writing to MMCIDATACTRL will reset the read counter. As a result,
MCI_DATABLOCKEND is never set and read_bytes() waits forever.

With this change, SD-Card support on qemu vexpress works correctly.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent a1109d7 commit faf2ec64e7442fda2e2330c0df047bcd902c5927
@Michael Olbrich Michael Olbrich authored on 2 Sep 2016
Sascha Hauer committed on 5 Sep 2016
Showing 1 changed file
View
drivers/mci/mmci.c