<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: iMX6q SPI slave problem in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/iMX6q-SPI-slave-problem/m-p/491545#M78887</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this link &lt;A href="http://lkml.iu.edu/hypermail/linux/kernel/1509.3/01176.html" title="http://lkml.iu.edu/hypermail/linux/kernel/1509.3/01176.html"&gt;Linux-Kernel Archive: [PATCH v2 8/8] spi: imx: Add support for SPI Slave mode for imx53 and imx6 chips&amp;nbsp; &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: medium;"&gt;It mentions that&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: medium;"&gt;2. Due to Freescale errata ERR003775 "eCSPI: Burst completion by Chip&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: medium;"&gt;Select (SS) signal in Slave mode is not functional" burst size must&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: medium;"&gt;be set exactly to the size of the transfer. This limit SPI transaction&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: medium;"&gt;with maximum 2^12 bits.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: medium;"&gt;Is it true that I can only transfer 512bytes in a single transaction?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: medium;"&gt;Thanks a lot!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 06 Feb 2016 15:46:27 GMT</pubDate>
    <dc:creator>raymondman</dc:creator>
    <dc:date>2016-02-06T15:46:27Z</dc:date>
    <item>
      <title>iMX6q SPI slave problem</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6q-SPI-slave-problem/m-p/491544#M78886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on SPI slave mode on iMX6q with the Linux kernel 3.0.35_4.1.0 and have already applied the patch from &lt;A href="https://community.nxp.com/docs/DOC-97380"&gt;i.MX6 ESPI slave mode support patch based on rel_imx_3.0.35_4.1.0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The burst length is set to 31.&lt;/P&gt;&lt;P&gt;A single SPI transfer is 2kB of a test pattern from 0x00 to 0xff repeatedly is used to test the SPI transfer.&lt;/P&gt;&lt;P&gt;If SPI clock is 18MHz, iMX6 receives incorrect data starting from 256bytes, or 64x32bits (the fifo size). Starting from 257th bytes, it should repeat 0x00 to 0xff. The received data may be of the following patterns,&lt;/P&gt;&lt;P&gt;256: 14 15 16 17 18 19 1a 1b&lt;/P&gt;&lt;P&gt;256: 0c 0d 0e 0f 10 11 12 13&lt;/P&gt;&lt;P&gt;256: 08 09 0a 0b 0c 0d 0e 0f&lt;/P&gt;&lt;P&gt;If SPI clock is ~1MHz, the error starts at a later position,&lt;/P&gt;&lt;P&gt;776: 00 03 77 2c a1 49 88 92&lt;/P&gt;&lt;P&gt;776: bf 3f c0 40 c1 41 c2 42&lt;/P&gt;&lt;P&gt;1036: c1 41 c2 42 36 60 e0 89&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does It mean that iMX6 is not fast enough to handle the incoming SPI data due to OS latency? Can anyone share experience how fast the SPI clock iMX6q can support? Or Do I need to modify the configuration?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also refer to the below link to add DMA support&lt;/P&gt;&lt;P&gt;&lt;A href="http://linux-kernel.2935.n7.nabble.com/PATCH-V1-spi-imx-add-dma-support-for-ecspi-td803732.html" title="http://linux-kernel.2935.n7.nabble.com/PATCH-V1-spi-imx-add-dma-support-for-ecspi-td803732.html"&gt;Linux Kernel - [PATCH V1] spi: imx: add dma support for ecspi&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below are debug messages to show the workflow of the DMA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sdma_control&lt;/P&gt;&lt;P&gt;sdma_config_channel&lt;/P&gt;&lt;P&gt;sdma_disable_channel&lt;/P&gt;&lt;P&gt;sdma_config_ownership&lt;/P&gt;&lt;P&gt;sdma_get_pc&lt;/P&gt;&lt;P&gt;peripheral_type=7&lt;/P&gt;&lt;P&gt;IMX_DMATYPE_CSPI&lt;/P&gt;&lt;P&gt;sdma_set_chan_private_data&lt;/P&gt;&lt;P&gt;sdma_load_context&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: load_address = 683&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: wml = 0x00000001&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: shp_addr = 0x02008000&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: per_addr = 0x00000000&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: event_mask0 = 0x00000001&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: event_mask1 = 0x00000000&lt;/P&gt;&lt;P&gt;sdma_set_context_reg&lt;/P&gt;&lt;P&gt;sdma_run_channel&lt;/P&gt;&lt;P&gt;RX dma config OK&lt;/P&gt;&lt;P&gt;sdma_control&lt;/P&gt;&lt;P&gt;sdma_config_channel&lt;/P&gt;&lt;P&gt;sdma_disable_channel&lt;/P&gt;&lt;P&gt;sdma_config_ownership&lt;/P&gt;&lt;P&gt;sdma_get_pc&lt;/P&gt;&lt;P&gt;peripheral_type=7&lt;/P&gt;&lt;P&gt;IMX_DMATYPE_CSPI&lt;/P&gt;&lt;P&gt;sdma_set_chan_private_data&lt;/P&gt;&lt;P&gt;sdma_load_context&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: load_address = 747&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: wml = 0x00000020&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: shp_addr = 0x02008004&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: per_addr = 0x00000000&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: event_mask0 = 0x00000001&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: event_mask1 = 0x00000000&lt;/P&gt;&lt;P&gt;sdma_set_context_reg&lt;/P&gt;&lt;P&gt;sdma_run_channel&lt;/P&gt;&lt;P&gt;TX dma config OK&lt;/P&gt;&lt;P&gt;spi_imx_transfer&lt;/P&gt;&lt;P&gt;sdma_prep_slave_sg chan_id=1 sg_len=1, dir=2 flags=3&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: setting up 1 entries for channel 2.&lt;/P&gt;&lt;P&gt;setting up 1 entries for channel 2.&lt;/P&gt;&lt;P&gt;sdma_load_context&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: load_address = 683&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: wml = 0x00000001&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: shp_addr = 0x02008000&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: per_addr = 0x00000000&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: event_mask0 = 0x00000001&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: event_mask1 = 0x00000000&lt;/P&gt;&lt;P&gt;sdma_set_context_reg&lt;/P&gt;&lt;P&gt;sdma_run_channel&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: entry 0: count: 8 dma: 0x00000000&amp;nbsp; intr&lt;/P&gt;&lt;P&gt;sdma_prep_slave_sg chan_id=0 sg_len=1, dir=1 flags=3&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: setting up 1 entries for channel 1.&lt;/P&gt;&lt;P&gt;setting up 1 entries for channel 1.&lt;/P&gt;&lt;P&gt;sdma_load_context&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: load_address = 747&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: wml = 0x00000020&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: shp_addr = 0x02008004&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: per_addr = 0x00000000&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: event_mask0 = 0x00000001&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: event_mask1 = 0x00000000&lt;/P&gt;&lt;P&gt;sdma_set_context_reg&lt;/P&gt;&lt;P&gt;sdma_run_channel&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: entry 0: count: 8 dma: 0x00000000&amp;nbsp; intr&lt;/P&gt;&lt;P&gt;sdma_tx_submit&lt;/P&gt;&lt;P&gt;sdma_assign_cookie&lt;/P&gt;&lt;P&gt;sdma_enable_channel channel=1&lt;/P&gt;&lt;P&gt;sdma_tx_submit&lt;/P&gt;&lt;P&gt;sdma_assign_cookie&lt;/P&gt;&lt;P&gt;sdma_enable_channel channel=2&lt;/P&gt;&lt;P&gt;sdma_issue_pending&lt;/P&gt;&lt;P&gt;sdma_issue_pending&lt;/P&gt;&lt;P&gt;spidev spi0.0: DMA transfer timeout&lt;/P&gt;&lt;P&gt;sdma_control&lt;/P&gt;&lt;P&gt;sdma_disable_channel&lt;/P&gt;&lt;P&gt;sdma_control&lt;/P&gt;&lt;P&gt;sdma_disable_channel&lt;/P&gt;&lt;P&gt;Transfer end&lt;/P&gt;&lt;P&gt;07 65 55 13 50 29 05 c4 spidev_message&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems DMA cannot receive any interrupt.&lt;/P&gt;&lt;P&gt;I can run mxc_sdma_test from Freescale which does memory-to-memory DMA transfer successfully. During the process, sdma_int_handler() is called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can anyone advise what's wrong with the DMA of my case? How can I check if SDMA can support the DMA transfer from/to ECSPI? In imx-sdma.c, I can see the following line to get the firmware name. Where is this firmware stored? I am using Yocto/Dora root filesystem image downloaded from &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://boundarydevices.com/yocto-dora-release-mx6/" rel="nofollow"&gt;https://boundarydevices.com/yocto-dora-release-mx6/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If the firmware is not correct, where can I download the one supporting ECSPI DMA?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;fwname = kasprintf(GFP_KERNEL, "imx/sdma/sdma-%s-to%d.bin",&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;cpu_name, to_version);&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additional information:&lt;/P&gt;&lt;P&gt;Try 2 sets of configuration&lt;/P&gt;&lt;P&gt;1)&lt;/P&gt;&lt;P&gt;ECSPI1_CONREG= 0x01f000e1&lt;/P&gt;&lt;P&gt;ECSPI1_CONFREG= 0x00000000&lt;/P&gt;&lt;P&gt;ECSPI1_DMAREG= 0x81020020&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)&lt;/P&gt;&lt;P&gt;ECSPI1_CONREG= 0x01F10001&lt;/P&gt;&lt;P&gt;ECSPI1_CONFREG= 0x00000000&lt;/P&gt;&lt;P&gt;ECSPI1_DMAREG= &lt;SPAN style="line-height: 1.5;"&gt;0x008300A0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While booting up the system, I can see sdma_int_handler() is called.&lt;/P&gt;&lt;P&gt;sdma_request_channel&lt;/P&gt;&lt;P&gt;sdma_set_channel_priority&lt;/P&gt;&lt;P&gt;sdma_config_ownership&lt;/P&gt;&lt;P&gt;sdma_set_channel_priority&lt;/P&gt;&lt;P&gt;sdma_add_scripts&lt;/P&gt;&lt;P&gt;sdma_get_firmware&lt;/P&gt;&lt;P&gt;sdma_load_script&lt;/P&gt;&lt;P&gt;sdma_run_channel&lt;/P&gt;&lt;P&gt;sdma_int_handler&lt;/P&gt;&lt;P&gt;sdma_add_scripts&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: loaded firmware 1.1&lt;/P&gt;&lt;P&gt;imx-sdma imx-sdma: initialized&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Feb 2016 05:35:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6q-SPI-slave-problem/m-p/491544#M78886</guid>
      <dc:creator>raymondman</dc:creator>
      <dc:date>2016-02-06T05:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6q SPI slave problem</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6q-SPI-slave-problem/m-p/491545#M78887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this link &lt;A href="http://lkml.iu.edu/hypermail/linux/kernel/1509.3/01176.html" title="http://lkml.iu.edu/hypermail/linux/kernel/1509.3/01176.html"&gt;Linux-Kernel Archive: [PATCH v2 8/8] spi: imx: Add support for SPI Slave mode for imx53 and imx6 chips&amp;nbsp; &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: medium;"&gt;It mentions that&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: medium;"&gt;2. Due to Freescale errata ERR003775 "eCSPI: Burst completion by Chip&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: medium;"&gt;Select (SS) signal in Slave mode is not functional" burst size must&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: medium;"&gt;be set exactly to the size of the transfer. This limit SPI transaction&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: medium;"&gt;with maximum 2^12 bits.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: medium;"&gt;Is it true that I can only transfer 512bytes in a single transaction?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: medium;"&gt;Thanks a lot!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Feb 2016 15:46:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6q-SPI-slave-problem/m-p/491545#M78887</guid>
      <dc:creator>raymondman</dc:creator>
      <dc:date>2016-02-06T15:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6q SPI slave problem</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6q-SPI-slave-problem/m-p/491546#M78888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi raymond&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is right:&lt;/P&gt;&lt;P&gt;slave mode with unspecified burst length cannot be supported due to this issue.&lt;/P&gt;&lt;P&gt;The burst length should always be specified with the BURST_LENGTH parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also it may be useful to look at&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/message/482332"&gt;Re: imx6 SPI in DMA mode sometime throws "I/O Error in DMA RX"&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;igor&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 00:44:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6q-SPI-slave-problem/m-p/491546#M78888</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2016-02-08T00:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6q SPI slave problem</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6q-SPI-slave-problem/m-p/491547#M78889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi igor,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;That means I may send 16kb or more if imx6 is used as spi master like the author in&amp;nbsp; the thread. But as slave mode, I can transmit or receive 512kbytes (the maximum burst lenght) in a single transfer, right?&lt;/P&gt;&lt;P&gt;The sdma firmware 1.1 should be working for spi slave mode using DMA, right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 05:13:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6q-SPI-slave-problem/m-p/491547#M78889</guid>
      <dc:creator>raymondman</dc:creator>
      <dc:date>2016-02-08T05:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6q SPI slave problem</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6q-SPI-slave-problem/m-p/491548#M78890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi igor,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I set the packet size to 256Bytes (the fifo size) and burst_legnth to 7FF. It seems sometimes DMA can work but the received data is not correct. There are still chances that DMA timeout.&lt;/P&gt;&lt;P&gt;If using PIO, the data can be received correctly. Do you have more hints?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 07:29:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6q-SPI-slave-problem/m-p/491548#M78890</guid>
      <dc:creator>raymondman</dc:creator>
      <dc:date>2016-02-08T07:29:24Z</dc:date>
    </item>
  </channel>
</rss>

