mbox series

[0/5] spi: uniphier: Introduce DMA transfer mode

Message ID 1577149107-30670-1-git-send-email-hayashi.kunihiko@socionext.com
Headers show
Series spi: uniphier: Introduce DMA transfer mode | expand

Message

Kunihiko Hayashi Dec. 24, 2019, 12:58 a.m. UTC
This series introduces DMA transfer mode into UniPhier SPI driver.
This only supports UniPhier XDMAC implemented in the SoC.

The DMA transfer mode uses FIFO threshold as a trigger to start DMA transfer,
however, the FIFO is limited to one word width due to alignment restiction
of the DMA controller.

Kunihiko Hayashi (5):
  spi: uniphier: Fix FIFO threshold
  spi: uniphier: Change argument of irq functions to private structure
  spi: uniphier: Add handle_err callback function
  spi: uniphier: Add SPI_LOOP to the capabilities
  spi: uniphier: Add DMA transfer mode support

 drivers/spi/spi-uniphier.c | 261 +++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 241 insertions(+), 20 deletions(-)

-- 
2.7.4

Comments

Mark Brown Dec. 25, 2019, 6:01 p.m. UTC | #1
On Tue, Dec 24, 2019 at 09:58:26AM +0900, Kunihiko Hayashi wrote:
> Add SPI_LOOP to the capabilities to support loopback mode.


>  	master->min_speed_hz = DIV_ROUND_UP(clk_rate, SSI_MAX_CLK_DIVIDER);

> -	master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LSB_FIRST;

> +	master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LSB_FIRST |

> +			    SPI_LOOP;


I'd expect to see a matching change that configures the hardware
in loopback mode when the driver is in SPI_MODE?  There's nothing
in the existing driver.
Kunihiko Hayashi Dec. 26, 2019, 1:55 a.m. UTC | #2
Hi Mark,
Thanks for your comment.

On Wed, 25 Dec 2019 18:01:42 +0000 <broonie@kernel.org> wrote:
> On Tue, Dec 24, 2019 at 09:58:26AM +0900, Kunihiko Hayashi wrote:

> > Add SPI_LOOP to the capabilities to support loopback mode.

> 

> >  	master->min_speed_hz = DIV_ROUND_UP(clk_rate, SSI_MAX_CLK_DIVIDER);

> > -	master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LSB_FIRST;

> > +	master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LSB_FIRST |

> > +			    SPI_LOOP;

> 

> I'd expect to see a matching change that configures the hardware

> in loopback mode when the driver is in SPI_MODE?  There's nothing

> in the existing driver.


I see. When doing loopback test using spi-loopback-test.c, I thought
'loop_req=1' option was needed, however, the controller doesn't need it.
We can ignore this patch.

Thank you,

---
Best Regards,
Kunihiko Hayashi