linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ECSPI Slave on i.M8M Mini with DMA
@ 2021-06-18 16:58 Adam Ford
  2021-06-30  9:34 ` Peng Fan
  0 siblings, 1 reply; 3+ messages in thread
From: Adam Ford @ 2021-06-18 16:58 UTC (permalink / raw)
  To: linux-spi, NXP Linux Team; +Cc: Charles Stevens

To the NXP team,

I noticed the spi-imx driver has a function called spi_imx_can_dma()
which returns false if the SPI is configured as a slave, so the dma
cannot be used in slave mode.

Section 10.1.2.7 "DMA" of the The 8MM Ref manual, Rev 3, shows there
are a few conditions that can trigger the DMA.  Of them, two are
RXFIFO data request and RXFIFO full.  The block diagram in that
section shows it can retrieve data with DMA

However, in section 10.1.4 "Applications" of the same document, it
shows the optional DMA configurations are only in the SPI master
configuration and not the SPI slave configuration.

The ECSPIx_DMAREG documentation (section 10.1.5.6) states "The ECSPI
sends out DMA requests when the appropriate FIFO conditions are
matched." Unfortunately it doesn't explicitly state whether that's
only for master or available in either master or slave mode.

Can someone tell me if DMA is available when SPI is configured as a slave?

thank you,

adam

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: ECSPI Slave on i.M8M Mini with DMA
  2021-06-18 16:58 ECSPI Slave on i.M8M Mini with DMA Adam Ford
@ 2021-06-30  9:34 ` Peng Fan
  2021-07-05  7:16   ` Clark Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Peng Fan @ 2021-06-30  9:34 UTC (permalink / raw)
  To: Adam Ford, linux-spi, dl-linux-imx, Clark Wang; +Cc: Charles Stevens

> Subject: ECSPI Slave on i.M8M Mini with DMA

Clark may help on this.

Regards,
Peng.

> 
> To the NXP team,
> 
> I noticed the spi-imx driver has a function called spi_imx_can_dma() which
> returns false if the SPI is configured as a slave, so the dma cannot be used in
> slave mode.
> 
> Section 10.1.2.7 "DMA" of the The 8MM Ref manual, Rev 3, shows there are a
> few conditions that can trigger the DMA.  Of them, two are RXFIFO data
> request and RXFIFO full.  The block diagram in that section shows it can
> retrieve data with DMA
> 
> However, in section 10.1.4 "Applications" of the same document, it shows the
> optional DMA configurations are only in the SPI master configuration and not
> the SPI slave configuration.
> 
> The ECSPIx_DMAREG documentation (section 10.1.5.6) states "The ECSPI
> sends out DMA requests when the appropriate FIFO conditions are matched."
> Unfortunately it doesn't explicitly state whether that's only for master or
> available in either master or slave mode.
> 
> Can someone tell me if DMA is available when SPI is configured as a slave?
> 
> thank you,
> 
> adam

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: ECSPI Slave on i.M8M Mini with DMA
  2021-06-30  9:34 ` Peng Fan
@ 2021-07-05  7:16   ` Clark Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Clark Wang @ 2021-07-05  7:16 UTC (permalink / raw)
  To: Adam Ford, Peng Fan, linux-spi, dl-linux-imx; +Cc: Charles Stevens

[-- Attachment #1: Type: text/plain, Size: 2516 bytes --]

Hi Adam,

Sorry for the late response.

Due to Freescale errata ERR003775 "eCSPI: Burst completion by Chip Select (SS) 
signal in Slave mode is not functional" burst size must be set exactly to the 
size of the transfer.
This leads us to send data only through the 4bytes per word (bpw) mode. If you 
want to send data with mode of 1 or 2bpw, it has high risk. Because:
1. The order of each word needs to be swapped before sending and after 
receiving.
2. When dealing with the last unaligned byte, data may be lost.

At the same time, after sending more than 512 bytes continuously, we observed 
that the slave sent a word of 0 data.
Therefore, the current eCSPI slave data transmission and reception in one 
burst is limited to 512 bytes.

The DMA mode leads to 4bpw limitation, while the data swap and the limitation 
of up to 512 bytes of data in one frame make DMA mode inefficient.
Based on the above limitations, we do not support the eCSPI slave DMA mode.

Best Regards,
Clark Wang

> -----Original Message-----
> From: Peng Fan <peng.fan@nxp.com>
> Sent: Wednesday, June 30, 2021 17:35
> To: Adam Ford <aford173@gmail.com>; linux-spi <linux-
> spi@vger.kernel.org>; dl-linux-imx <linux-imx@nxp.com>; Clark Wang
> <xiaoning.wang@nxp.com>
> Cc: Charles Stevens <charles.stevens@logicpd.com>
> Subject: RE: ECSPI Slave on i.M8M Mini with DMA
>
> > Subject: ECSPI Slave on i.M8M Mini with DMA
>
> Clark may help on this.
>
> Regards,
> Peng.
>
> >
> > To the NXP team,
> >
> > I noticed the spi-imx driver has a function called spi_imx_can_dma()
> > which returns false if the SPI is configured as a slave, so the dma
> > cannot be used in slave mode.
> >
> > Section 10.1.2.7 "DMA" of the The 8MM Ref manual, Rev 3, shows there
> > are a few conditions that can trigger the DMA.  Of them, two are
> > RXFIFO data request and RXFIFO full.  The block diagram in that
> > section shows it can retrieve data with DMA
> >
> > However, in section 10.1.4 "Applications" of the same document, it
> > shows the optional DMA configurations are only in the SPI master
> > configuration and not the SPI slave configuration.
> >
> > The ECSPIx_DMAREG documentation (section 10.1.5.6) states "The ECSPI
> > sends out DMA requests when the appropriate FIFO conditions are
> matched."
> > Unfortunately it doesn't explicitly state whether that's only for
> > master or available in either master or slave mode.
> >
> > Can someone tell me if DMA is available when SPI is configured as a slave?
> >
> > thank you,
> >
> > adam

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 9583 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-05  7:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-18 16:58 ECSPI Slave on i.M8M Mini with DMA Adam Ford
2021-06-30  9:34 ` Peng Fan
2021-07-05  7:16   ` Clark Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).