[U-Boot] [PATCH v1 2/2] bfin: discard invalid data and clear RXS in bf5xx spi driver
Sonic Zhang
sonic.adi at gmail.com
Mon Mar 4 08:20:09 CET 2013
From: Scott Jiang <scott.jiang.linux at gmail.com>
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 at gmail.com>
Signed-off-by: Sonic Zhang <sonic.zhang at analog.com>
---
drivers/spi/bfin_spi.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/spi/bfin_spi.c b/drivers/spi/bfin_spi.c
index fff384a..1845e4f 100644
--- a/drivers/spi/bfin_spi.c
+++ b/drivers/spi/bfin_spi.c
@@ -250,6 +250,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);
--
1.7.0.4
More information about the U-Boot
mailing list