summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jiang <scott.jiang.linux@gmail.com>2011-12-07 14:53:30 -0500
committerSonic Zhang <sonic.zhang@analog.com>2013-05-13 16:26:27 +0800
commitd4d4f903773e0e5540baa00157585de25a542ba6 (patch)
tree4d4b4bd66d747838a8a9ecf539fda92307f5e070
parente76276df74f60eeb3c28418971bbe8cd6fc736e5 (diff)
downloadu-boot-imx-d4d4f903773e0e5540baa00157585de25a542ba6.zip
u-boot-imx-d4d4f903773e0e5540baa00157585de25a542ba6.tar.gz
u-boot-imx-d4d4f903773e0e5540baa00157585de25a542ba6.tar.bz2
bfin: discard invalid data and clear RXS in bf5xx spi driver
There may be dirty data in RDBR, so we should discard invalid data. This operation also clears RXS bit in STAT register. Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
-rw-r--r--drivers/spi/bfin_spi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/spi/bfin_spi.c b/drivers/spi/bfin_spi.c
index 0fa131b..a9a4d92 100644
--- a/drivers/spi/bfin_spi.c
+++ b/drivers/spi/bfin_spi.c
@@ -248,6 +248,8 @@ void spi_release_bus(struct spi_slave *slave)
static int spi_pio_xfer(struct bfin_spi_slave *bss, const u8 *tx, u8 *rx,
uint bytes)
{
+ /* discard invalid data and clear RXS */
+ read_SPI_RDBR(bss);
/* todo: take advantage of hardware fifos */
while (bytes--) {
u8 value = (tx ? *tx++ : CONFIG_BFIN_SPI_IDLE_VAL);