Patchwork [U-Boot,2/4] spi: atmel: add WDRBT bit to avoid receive overrun

login
register
mail settings
Submitter Bo Shen
Date Aug. 20, 2012, 6:32 a.m.
Message ID <1345444344-31340-2-git-send-email-voice.shen@atmel.com>
Download mbox | patch
Permalink /patch/178688/
State Accepted
Commit 65c575506d60a70385e9751072a6bc2c5694ec38
Delegated to: Andreas Bießmann
Headers show

Comments

Bo Shen - Aug. 20, 2012, 6:32 a.m.
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>
---
 drivers/spi/atmel_spi.c |    3 +++
 drivers/spi/atmel_spi.h |    1 +
 2 files changed, 4 insertions(+)
Andreas Bießmann - Aug. 21, 2012, 11:11 a.m.
Dear Bo Shen,

On 20.08.2012 08:32, Bo Shen wrote:
> 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>

Mike, will you take this patch?

Best regards

Andreas Bießmann
> ---
>  drivers/spi/atmel_spi.c |    3 +++
>  drivers/spi/atmel_spi.h |    1 +
>  2 files changed, 4 insertions(+)
> 
> diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c
> index 83ef8e8..c7a51f7 100644
> --- a/drivers/spi/atmel_spi.c
> +++ b/drivers/spi/atmel_spi.c
> @@ -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);
>  
> diff --git a/drivers/spi/atmel_spi.h b/drivers/spi/atmel_spi.h
> index 8b69a6d..057de9a 100644
> --- a/drivers/spi/atmel_spi.h
> +++ b/drivers/spi/atmel_spi.h
> @@ -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)
>
Mike Frysinger - Aug. 21, 2012, 6:56 p.m.
On Tuesday 21 August 2012 07:11:18 Andreas Bießmann wrote:
> On 20.08.2012 08:32, Bo Shen wrote:
> > 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>
> 
> Mike, will you take this patch?

for SoC drivers, sometimes i'll help review, but i'd expect it to be merged 
through the respective architecture tree.  i've only been sheriffing the spi 
core changes.
-mike
Bo Shen - Aug. 24, 2012, 9:46 a.m.
Hi Andreas,

On 8/22/2012 2:56, Mike Frysinger wrote:
> On Tuesday 21 August 2012 07:11:18 Andreas Bießmann wrote:
>> On 20.08.2012 08:32, Bo Shen wrote:
>>> 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>
>>
>> Mike, will you take this patch?
>
> for SoC drivers, sometimes i'll help review, but i'd expect it to be merged
> through the respective architecture tree.  i've only been sheriffing the spi
> core changes.

If no problem, please take this patch?

> -mike
>
Andreas Bießmann - Aug. 27, 2012, 10:46 a.m.
Dear Mike Frysinger,

On 21.08.2012 20:56, Mike Frysinger wrote:
> On Tuesday 21 August 2012 07:11:18 Andreas Bießmann wrote:
>> On 20.08.2012 08:32, Bo Shen wrote:
>>> 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>
>>
>> Mike, will you take this patch?
> 
> for SoC drivers, sometimes i'll help review, but i'd expect it to be merged 
> through the respective architecture tree.  i've only been sheriffing the spi 
> core changes.

Ah, OK. So I'll take this one. I think this is a fix for a change
provided before MW close so this should go into this release.

Best regards

Andreas Bießmann

Patch

diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c
index 83ef8e8..c7a51f7 100644
--- a/drivers/spi/atmel_spi.c
+++ b/drivers/spi/atmel_spi.c
@@ -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);
 
diff --git a/drivers/spi/atmel_spi.h b/drivers/spi/atmel_spi.h
index 8b69a6d..057de9a 100644
--- a/drivers/spi/atmel_spi.h
+++ b/drivers/spi/atmel_spi.h
@@ -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)