]> git.sur5r.net Git - u-boot/commitdiff
spi: atmel: add WDRBT bit to avoid receive overrun
authorBo Shen <voice.shen@atmel.com>
Sun, 19 Aug 2012 20:32:22 +0000 (20:32 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Sat, 1 Sep 2012 15:06:14 +0000 (17:06 +0200)
The atmel at91sam9x5 series spi has feature to avoid receive overren

Using the patch to enable it

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Acked-by: Andreas Bießmann <andreas.devel@googlemail.com>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
drivers/spi/atmel_spi.c
drivers/spi/atmel_spi.h

index 83ef8e8b193c9c9e30e760a4c8d40afc08ed8cce..c7a51f7f39a368bdec2b368e470e6386d8228760 100644 (file)
@@ -92,6 +92,9 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
        as->slave.cs = cs;
        as->regs = regs;
        as->mr = ATMEL_SPI_MR_MSTR | ATMEL_SPI_MR_MODFDIS
+#if defined(CONFIG_AT91SAM9X5)
+                       | ATMEL_SPI_MR_WDRBT
+#endif
                        | ATMEL_SPI_MR_PCS(~(1 << cs) & 0xf);
        spi_writel(as, CSR(cs), csrx);
 
index 8b69a6d2159c4213bbb5d1567dd463f4dda92f32..057de9adee6e44bb60154adc543d3b19a6f9aaa3 100644 (file)
@@ -26,6 +26,7 @@
 #define ATMEL_SPI_MR_PCSDEC            (1 << 2)
 #define ATMEL_SPI_MR_FDIV              (1 << 3)
 #define ATMEL_SPI_MR_MODFDIS           (1 << 4)
+#define ATMEL_SPI_MR_WDRBT             (1 << 5)
 #define ATMEL_SPI_MR_LLB               (1 << 7)
 #define ATMEL_SPI_MR_PCS(x)            (((x) & 15) << 16)
 #define ATMEL_SPI_MR_DLYBCS(x)         ((x) << 24)