Skip to content
Snippets Groups Projects
Commit 65c57550 authored by Bo Shen's avatar Bo Shen Committed by Albert ARIBAUD
Browse files

spi: atmel: add WDRBT bit to avoid receive overrun


The atmel at91sam9x5 series spi has feature to avoid receive overren

Using the patch to enable it

Signed-off-by: default avatarBo Shen <voice.shen@atmel.com>
Acked-by: default avatarAndreas Bießmann <andreas.devel@googlemail.com>
Signed-off-by: default avatarAndreas Bießmann <andreas.devel@googlemail.com>
parent 9bfc2368
No related branches found
No related tags found
No related merge requests found
...@@ -92,6 +92,9 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs, ...@@ -92,6 +92,9 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
as->slave.cs = cs; as->slave.cs = cs;
as->regs = regs; as->regs = regs;
as->mr = ATMEL_SPI_MR_MSTR | ATMEL_SPI_MR_MODFDIS 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); | ATMEL_SPI_MR_PCS(~(1 << cs) & 0xf);
spi_writel(as, CSR(cs), csrx); spi_writel(as, CSR(cs), csrx);
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#define ATMEL_SPI_MR_PCSDEC (1 << 2) #define ATMEL_SPI_MR_PCSDEC (1 << 2)
#define ATMEL_SPI_MR_FDIV (1 << 3) #define ATMEL_SPI_MR_FDIV (1 << 3)
#define ATMEL_SPI_MR_MODFDIS (1 << 4) #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_LLB (1 << 7)
#define ATMEL_SPI_MR_PCS(x) (((x) & 15) << 16) #define ATMEL_SPI_MR_PCS(x) (((x) & 15) << 16)
#define ATMEL_SPI_MR_DLYBCS(x) ((x) << 24) #define ATMEL_SPI_MR_DLYBCS(x) ((x) << 24)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment