lkml.org 
[lkml]   [2022]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v6 1/2] spi: Add spi driver for Sunplus SP7021
Date
> > > > > > +       if (xfer->tx_buf)
> > > > > > + dma_unmap_single(dev, xfer->tx_dma, xfer->len, DMA_TO_DEVICE);
> > > > > > + if (xfer->rx_buf)
> > > > > > + dma_unmap_single(dev, xfer->rx_dma, xfer->len,
> > > > > > + DMA_FROM_DEVICE);
> > > > >
> > > > > Why can't you use SPI core DMA mapping code?
> > > >
> > > > I didn't find the SPI core DMA mapping code for single maping.
> > > > The method currently used is the general DMA single-map code usage method.
> > >
> > > Why do you need single page mapping?
> > > What's wrong with SG mapping that SPI core provides?
> >
> > SP7021 SPI slave dma only supports single dma in one trigger.
> > It is not suitable for using SG mapping.
> > If the length of the transfer is larger than the length of the
> > SG-mapping, Slave-mode will get error in the transfer.
>
> Same story for SPI DesignWare on Intel Medfield, where no SG transfers are supported by hardware.
> Nevertheless, the DMA driver takes care of this and on each interrupt recharges a channel to continue.
> Why can't the same be implemented here?
>
>
I think it should work in master. spi master must actively send clk and date to slave device.
And yes, in the "master" mode it can handle SG-DMA on each interrupt.
But if working in "slave" mode, the master will not know the state of the slave. Slaves work on interrupt and recharge channels.
When master send clk and date in the same time. It may lose data and errors occur


\
 
 \ /
  Last update: 2022-01-24 04:28    [W:0.845 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site