<?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>i.MX ProcessorsのトピックRe: Control SPI SS_CTL for single burst operation.</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Control-SPI-SS-CTL-for-single-burst-operation/m-p/159945#M3100</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I ran into this late last week after I figured out how to correctly set BURST_LENGTH.&amp;nbsp; Here is my understanding so far.&amp;nbsp; It appears from the data sheet (which contains a very round about description) and what I have observed, that burst length 31:20 allows you to only control the width in bits of the first word, after that any additional words specified are 32 bits in length. It allows you to specify a transfer of any arbitrary bit length in a single burst from 1 to 4096 bits.&amp;nbsp; The control over the first word allows you to handle cases where your entire burst length is not a multiple of 32 bit words.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you have defined the first word to be 32 bits,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6; color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; line-height: 1.5em;"&gt;ctrl_reg |= (0x1F &amp;lt;&amp;lt; 20)&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;gt;&amp;nbsp; n = BL + 1, 32 = 0x1F+1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6; color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6; color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; line-height: 1.5em;"&gt;With no additional words [31:25] cleared.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6; color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6; color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; line-height: 1.5em;"&gt;So now the controller is going to shift out all 32 bits because that is what you told it todo.&amp;nbsp; That's why you needed to populated your txbuf with 4 bytes. &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For my device I want to send a 1 byte command and then get back 4 bytes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so I set the first word to be 8 bits&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;&amp;nbsp; ctrl_reg |= (7&amp;lt;&amp;lt; 20) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt; then specify the remaining 32 bit words in [31:25].&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;ctrl_reg |= (1 &amp;lt;&amp;lt; 25)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for RXIFIFO; since it is now one continuous transfer (in regard to cs), it doesn't appear to advance the RX fifo until all 32 bits are shifted in.&amp;nbsp; If you look at the driver spi_imx.c you'll see that it uses a different routine for reading rx fifo based on bpw.&amp;nbsp; So if your set up for 8 bpw then its not going to populate your buffer correctly.&amp;nbsp; Temporarily you can set it up to use the spi_imx_buf_rx_u32 for your example (being careful to make sure your buffer is in increments of 32 bit words).&amp;nbsp; For a more permanent solution the driver needs to take this into account when cs_change = 0, and make sure it properly maps the 32 bit values from each rxfifo read into the transfer based on whatever bpw the spi transaction has specified.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this explains what your seeing. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 28 Jul 2013 15:59:03 GMT</pubDate>
    <dc:creator>jeffreycoffman</dc:creator>
    <dc:date>2013-07-28T15:59:03Z</dc:date>
    <item>
      <title>Control SPI SS_CTL for single burst operation.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Control-SPI-SS-CTL-for-single-burst-operation/m-p/159942#M3097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, all.&lt;/P&gt;&lt;P&gt;Please understand that my english is not good enough.&lt;/P&gt;&lt;P&gt;I'm currently working with the i.MX53 EVK.&lt;/P&gt;&lt;P&gt;I'm having some trouble with the ECSPI.&lt;/P&gt;&lt;P&gt;My SPI device requires the CS/SS pin to be held low for the length of the SPI burst.&lt;/P&gt;&lt;P&gt;I thought that it is not a proper way to change bits_per_word value,&lt;/P&gt;&lt;P&gt;because normal burst read size is more than 32-bits.&lt;/P&gt;&lt;P&gt;I found a way to control SS waveform in ECSPI config register.&lt;/P&gt;&lt;P&gt;So, i comment out the code to set ss_ctl bit, as shown below.&lt;/P&gt;&lt;P&gt;/* mxc_spi.c */&lt;/P&gt;&lt;P&gt;void mxc_spi_chipselect(struct spi_device *spi, int is_active)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; .....&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (spi_ver_def == &amp;amp;spi_ver_2_3) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; .....&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; if (spi-&amp;gt;mode &amp;amp; SPI_CS_HIGH) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; config_reg |=&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ((((1 &amp;lt;&amp;lt; (spi-&amp;gt;chip_select &amp;amp; MXC_CSPICTRL_CSMASK)) &amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; spi_ver_def-&amp;gt;mode_mask) | cs_value) &amp;lt;&amp;lt; spi_ver_def-&amp;gt;ss_pol_shift);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; } else&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; config_reg |=&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ((~((1 &amp;lt;&amp;lt; (spi-&amp;gt;chip_select &amp;amp; MXC_CSPICTRL_CSMASK)) &amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; spi_ver_def-&amp;gt;mode_mask) &amp;amp; cs_value) &amp;lt;&amp;lt; spi_ver_def-&amp;gt;ss_pol_shift);&lt;/P&gt;&lt;P&gt;#if 0 /* single burst transfer */&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; config_reg |=&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (((1 &amp;lt;&amp;lt; (spi-&amp;gt;chip_select &amp;amp; MXC_CSPICTRL_CSMASK)) &amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; spi_ver_def-&amp;gt;mode_mask) &amp;lt;&amp;lt; spi_ver_def-&amp;gt;ss_ctrl_shift);&lt;/P&gt;&lt;P&gt;#endif&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; __raw_writel(0, master_drv_data-&amp;gt;base + MXC_CSPICTRL);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; __raw_writel(ctrl_reg, master_drv_data-&amp;gt;base + MXC_CSPICTRL);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; __raw_writel(config_reg, MXC_CSPICONFIG + master_drv_data-&amp;gt;ctrl_addr);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; .....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code for SPI burst read in my SPI device driver. (master mode, bits_per_word:8)&lt;/P&gt;&lt;P&gt;/* my_spi.c */&lt;/P&gt;&lt;P&gt;void&amp;nbsp;my_spi_read_burst(unsigned char reg, unsigned char *buf, int size)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; int ret;&lt;/P&gt;&lt;P&gt;&amp;nbsp; u8 tmp_buf[2];&lt;/P&gt;&lt;P&gt;&amp;nbsp; struct spi_message msg;&lt;/P&gt;&lt;P&gt;&amp;nbsp; struct spi_transfer msg_xfer;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; spi_message_init(&amp;amp;msg);&lt;/P&gt;&lt;P&gt;&amp;nbsp; memset(&amp;amp;msg_xfer, 0, sizeof(msg_xfer));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; msg_xfer.tx_buf = tmp_buf;&lt;/P&gt;&lt;P&gt;&amp;nbsp; msg_xfer.len = 2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; tmp_buf[0] = MY_SPI_CHIP_ADDR;&lt;/P&gt;&lt;P&gt;&amp;nbsp; tmp_buf[1] = reg;&lt;/P&gt;&lt;P&gt;&amp;nbsp; spi_message_add_tail(&amp;amp;msg_xfer, &amp;amp;msg);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; ret = spi_sync(my_spi_ptr-&amp;gt;spi_ptr, &amp;amp;msg);&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (ret)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; printk("spi_sync error\n");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; spi_message_init(&amp;amp;msg);&lt;/P&gt;&lt;P&gt;&amp;nbsp; memset(&amp;amp;msg_xfer, 0, sizeof(msg_xfer));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;msg_xfer.tx_buf = buf;&lt;/P&gt;&lt;P&gt;&amp;nbsp; msg_xfer.rx_buf = buf;&lt;/P&gt;&lt;P&gt;&amp;nbsp; msg_xfer.len = size;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; buf[0] = (MY_SPI_CHIP_ADDR | 0x1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; spi_message_add_tail(&amp;amp;msg_xfer, &amp;amp;msg);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ret = spi_sync(my_spi_ptr-&amp;gt;spi_ptr, &amp;amp;msg);&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (ret)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; printk("spi_sync error\n");}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately it does not work. Am I missing something?&lt;/P&gt;&lt;P&gt;Read operation is infinitely waiting for transfer completion in mxc_spi_transfer function.&lt;/P&gt;&lt;P&gt;The reason is as shown below.&lt;/P&gt;&lt;P&gt;static irqreturn_t mxc_spi_isr(int irq, void *dev_id)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; struct mxc_spi *master_drv_data = dev_id;&lt;/P&gt;&lt;P&gt;&amp;nbsp; irqreturn_t ret = IRQ_NONE;&lt;/P&gt;&lt;P&gt;&amp;nbsp; unsigned int status;&lt;/P&gt;&lt;P&gt;&amp;nbsp; int fifo_size;&lt;/P&gt;&lt;P&gt;&amp;nbsp; unsigned int pass_counter;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; fifo_size = master_drv_data-&amp;gt;spi_ver_def-&amp;gt;fifo_size;&lt;/P&gt;&lt;P&gt;&amp;nbsp; pass_counter = fifo_size;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Read the interrupt status register to determine the source */&lt;/P&gt;&lt;P&gt;&amp;nbsp; status = __raw_readl(master_drv_data-&amp;gt;stat_addr);&lt;/P&gt;&lt;P&gt;&amp;nbsp; do {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; u32 rx_tmp = &amp;nbsp;__raw_readl(master_drv_data-&amp;gt;base + MXC_CSPIRXDATA);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; if (master_drv_data-&amp;gt;transfer.rx_buf)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; master_drv_data-&amp;gt;transfer.rx_get(master_drv_data, rx_tmp);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; (master_drv_data-&amp;gt;transfer.count)--;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; (master_drv_data-&amp;gt;transfer.rx_count)--; &amp;nbsp;&amp;lt;-------- rx_count is 386&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ret = IRQ_HANDLED;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; if (pass_counter-- == 0) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; status = __raw_readl(master_drv_data-&amp;gt;stat_addr); &amp;nbsp;&amp;lt;-------- status is 0x80 (RR is 0), &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;exit a while loop immediately&lt;/P&gt;&lt;P&gt;&amp;nbsp; } while (status &amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (1 &amp;lt;&amp;lt; (MXC_CSPISTAT_RR + master_drv_data-&amp;gt;spi_ver_def-&amp;gt;int_status_dif)));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (master_drv_data-&amp;gt;transfer.rx_count)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; return ret; &amp;nbsp;&amp;lt;-------- rx_count is 385, return from the function and no more interrupt.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (master_drv_data-&amp;gt;transfer.count) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; if (master_drv_data-&amp;gt;transfer.tx_buf) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; u32 count = (master_drv_data-&amp;gt;transfer.count &amp;gt; fifo_size) ?&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fifo_size : master_drv_data-&amp;gt;transfer.count;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; master_drv_data-&amp;gt;transfer.rx_count = count;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; spi_put_tx_data(master_drv_data-&amp;gt;base, count, master_drv_data);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; } else {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; complete(&amp;amp;master_drv_data-&amp;gt;xfer_done); &amp;nbsp;&amp;lt;-------- Never reached&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; return ret;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Please advise me.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jun 2011 08:42:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Control-SPI-SS-CTL-for-single-burst-operation/m-p/159942#M3097</guid>
      <dc:creator>CHOIHYONGEUN</dc:creator>
      <dc:date>2011-06-29T08:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: Control SPI SS_CTL for single burst operation.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Control-SPI-SS-CTL-for-single-burst-operation/m-p/159943#M3098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you ever figure this out?&amp;nbsp; I have the same issue on an i.MX6 quad, I set SS_CTL for single burst and clear SMC as described in the data sheet and still see the CS toggling between bursts.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jul 2013 23:59:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Control-SPI-SS-CTL-for-single-burst-operation/m-p/159943#M3098</guid>
      <dc:creator>jeffreycoffman</dc:creator>
      <dc:date>2013-07-24T23:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Control SPI SS_CTL for single burst operation.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Control-SPI-SS-CTL-for-single-burst-operation/m-p/159944#M3099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My Spi devices require also no toggling between bursts. I made some changes in mxc_spi.c for mx53 .Now my device accept opcode and reister address and replay with regset value.But somehow the spi_write_then_read function doesnt get the same value ,I observe on the osciloscope ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //--------------------- change begin-----------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (spi-&amp;gt;single_CS == 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ctrl_reg &amp;amp;= ~(spi_ver_def-&amp;gt;smc) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; config_reg &amp;amp;= ~((((1 &amp;lt;&amp;lt; (spi-&amp;gt;chip_select &amp;amp; MXC_CSPICTRL_CSMASK)) &amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; spi_ver_def-&amp;gt;mode_mask) &amp;lt;&amp;lt; spi_ver_def-&amp;gt;ss_ctrl_shift));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; master_drv_data-&amp;gt;usedma =0 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ctrl_reg |= (0x1F &amp;lt;&amp;lt; 20);// burstlen =32bits &amp;lt;= bit =CR[31:20]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //------------------------change end------------------------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __raw_writel(ctrl_reg, master_drv_data-&amp;gt;base + MXC_CSPICTRL);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __raw_writel(config_reg,MXC_CSPICONFIG + master_drv_data-&amp;gt;ctrl_addr);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Added waveform:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/skins/images/07C13B7BCFE679E95A046C66BEEAE724/responsive_peak/images/image_not_found.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But normally I should write&amp;nbsp; txbuf[0]=0x13 ,txbuf[1]=0x1d&amp;nbsp;&amp;nbsp; expected result from device =0x81&lt;/P&gt;&lt;P&gt;But it works when I put txbuf0= dummy=0x0 txbuf1=dummy=0x0 txbuf2=0x1d txbuf3=0x13&amp;nbsp; 32 bits into buffer .&lt;/P&gt;&lt;P&gt;I think rxFIFO capturing is also starts end ends with cs edges ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Jul 2013 10:38:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Control-SPI-SS-CTL-for-single-burst-operation/m-p/159944#M3099</guid>
      <dc:creator>yektaayduk</dc:creator>
      <dc:date>2013-07-27T10:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: Control SPI SS_CTL for single burst operation.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Control-SPI-SS-CTL-for-single-burst-operation/m-p/159945#M3100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I ran into this late last week after I figured out how to correctly set BURST_LENGTH.&amp;nbsp; Here is my understanding so far.&amp;nbsp; It appears from the data sheet (which contains a very round about description) and what I have observed, that burst length 31:20 allows you to only control the width in bits of the first word, after that any additional words specified are 32 bits in length. It allows you to specify a transfer of any arbitrary bit length in a single burst from 1 to 4096 bits.&amp;nbsp; The control over the first word allows you to handle cases where your entire burst length is not a multiple of 32 bit words.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you have defined the first word to be 32 bits,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6; color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; line-height: 1.5em;"&gt;ctrl_reg |= (0x1F &amp;lt;&amp;lt; 20)&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;gt;&amp;nbsp; n = BL + 1, 32 = 0x1F+1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6; color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6; color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; line-height: 1.5em;"&gt;With no additional words [31:25] cleared.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6; color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6; color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; line-height: 1.5em;"&gt;So now the controller is going to shift out all 32 bits because that is what you told it todo.&amp;nbsp; That's why you needed to populated your txbuf with 4 bytes. &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For my device I want to send a 1 byte command and then get back 4 bytes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so I set the first word to be 8 bits&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;&amp;nbsp; ctrl_reg |= (7&amp;lt;&amp;lt; 20) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt; then specify the remaining 32 bit words in [31:25].&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;ctrl_reg |= (1 &amp;lt;&amp;lt; 25)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for RXIFIFO; since it is now one continuous transfer (in regard to cs), it doesn't appear to advance the RX fifo until all 32 bits are shifted in.&amp;nbsp; If you look at the driver spi_imx.c you'll see that it uses a different routine for reading rx fifo based on bpw.&amp;nbsp; So if your set up for 8 bpw then its not going to populate your buffer correctly.&amp;nbsp; Temporarily you can set it up to use the spi_imx_buf_rx_u32 for your example (being careful to make sure your buffer is in increments of 32 bit words).&amp;nbsp; For a more permanent solution the driver needs to take this into account when cs_change = 0, and make sure it properly maps the 32 bit values from each rxfifo read into the transfer based on whatever bpw the spi transaction has specified.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this explains what your seeing. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Jul 2013 15:59:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Control-SPI-SS-CTL-for-single-burst-operation/m-p/159945#M3100</guid>
      <dc:creator>jeffreycoffman</dc:creator>
      <dc:date>2013-07-28T15:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: Control SPI SS_CTL for single burst operation.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Control-SPI-SS-CTL-for-single-burst-operation/m-p/159946#M3101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;&amp;nbsp; &amp;nbsp;It is possible to get operations as shown on the Figure 24-8 (SPI Burst While SS_CTL[3:0] is Clear)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt; of the i.MX53 RM (Rev. 2, 6/2012), but&amp;nbsp;the description under the figure is not fully correct.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;"The maximum length of a single SPI burst is defined in the BURST LENGTH field of the ECSPI_CONREG &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;control register". Really the maximum length of the single SPI burst is defined by FIFO. When FIFO is &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;underflowed (empty) the SS is negated.&amp;nbsp;&amp;nbsp;ECSPIx_PERIODREG may be used to setup delays between&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt; SPI transfers.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Yuri.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jul 2017 07:51:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Control-SPI-SS-CTL-for-single-burst-operation/m-p/159946#M3101</guid>
      <dc:creator>Yuri</dc:creator>
      <dc:date>2017-07-18T07:51:00Z</dc:date>
    </item>
  </channel>
</rss>

