When ECSPI uses DMA, SCK will have a low level after every 16 pulses.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

When ECSPI uses DMA, SCK will have a low level after every 16 pulses.

909 Views
yongleili717
Contributor I

When using IMX6ul ECSPI by DMA, SCK will have a low level after every 16 pulses.Yellow is the SCK line,Linux kernel is 4.1.15.004下载1.5MHz轮询.png

There is such a description in the data sheet:

20.4.4.1.2 Master Mode with Wait States

     Wait states can be inserted between SPI bursts. This provides a way for software to slow down the SPI burst to meet the timing requirements of a slower SPI device.
    The following figure shows wait states inserted between SPI bursts.

pastedImage_3.png

In this case, the number of wait states is controlled by ECSPI_PERIODREG[SAMPLE PERIOD] and the wait states' clock source is selected by ECSPI_PERIODREG[CSRC]

20.4.4.1.3 Master Mode with SS_CTL[3:0] Control
      The SPI SS Control (SS_CTL[3:0]) controls whether the current operation is single burst or multiple bursts.

When the SPI SS Wave Form Select (SS_CTL[3:0]) is set, the current operation is multiple bursts transfer. When the SPI SS Wave Form Select (SS_CTL[3:0]) bit is cleared, the current operation is single burst transfer. A SPI burst can contains multiple words as defined in the BURST LENGTH field of the ECSPI_CONREG register.

pastedImage_2.png

In Figure 20-8, two 8-bit bursts in the TXFIFO have been combined and transmitted in one SPI burst. The maximum length of a single SPI burst is defined in the BURST LENGTH field of the ECSPI_CONREG control register. (Figure 20-8 corresponds to a BURST LENGTH of 8.) This provides a way for transferring a longer SPI burst by writing data into TXFIFO while the ECSPI is transmitting.

But I did not find the ECSPI_PERIODREG register definition in spi-imx.c.

thanks

Labels (2)
Tags (1)
0 Kudos
2 Replies

608 Views
igorpadykov
NXP Employee
NXP Employee

Hi 永磊 李

>But I did not find the ECSPI_PERIODREG register definition in spi-imx.c.

seems driver does not use this register, one can add its settings in spi_imx_probe() function or

in dts file using function of_property_read_u32() :

spi-imx.c\spi\drivers - linux-imx - i.MX Linux kernel 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

608 Views
yongleili717
Contributor I

Can I change the ECSPI_PERIODREG register to change the intermediate time interval?I don't know if this time is the time for the software to fill in the FIFO.

0 Kudos