<?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: imx93 high frequency SPI in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/imx93-high-frequency-SPI/m-p/1836089#M221846</link>
    <description>&lt;P&gt;I think the second one is more easier to implement. The mcu like as a SPI device. You could write a driver for it. You could write the control code in the driver. Add it in the device tree like other spi device.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Mar 2024 07:30:18 GMT</pubDate>
    <dc:creator>jimmychan</dc:creator>
    <dc:date>2024-03-27T07:30:18Z</dc:date>
    <item>
      <title>imx93 high frequency SPI</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx93-high-frequency-SPI/m-p/1834854#M221751</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to interface an external microcontroller to an iMX93 som module. I need to use the SPI at minimum 20-25MHz frequency.&amp;nbsp;I am considering two operating possibilities:&lt;/P&gt;&lt;P&gt;The first would be to have the SPI of the imx93-som as slave; the microcontroller sends a block of data after it samples them, the som accumulates them in a buffer, and the high level software empties the buffer when it needs to (no more frequently than 100 times per second). This would be the preferred solution.&lt;/P&gt;&lt;P&gt;The second would be to use the SPI as master from the som; the microcontroller accumulates the data in itself and the som empties it at regular intervals. We like this solution less because we would have to control the SPI directly from the application instead of simply reading a buffer.&lt;/P&gt;&lt;P&gt;Which solution do you think would be easier to implement? Do you know how can i do it? I attach the actual device tree, i tryed to configure the SPI in slave mode&amp;nbsp;but i do not know which command i need to use to interact with it or how to test it.&lt;/P&gt;&lt;P&gt;I am using the kernel version 6.1.22, the configuration has not been touched.&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;P&gt;Lorenzo&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2024 19:17:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx93-high-frequency-SPI/m-p/1834854#M221751</guid>
      <dc:creator>LorenzoSpadaro</dc:creator>
      <dc:date>2024-03-25T19:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: imx93 high frequency SPI</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx93-high-frequency-SPI/m-p/1836089#M221846</link>
      <description>&lt;P&gt;I think the second one is more easier to implement. The mcu like as a SPI device. You could write a driver for it. You could write the control code in the driver. Add it in the device tree like other spi device.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 07:30:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx93-high-frequency-SPI/m-p/1836089#M221846</guid>
      <dc:creator>jimmychan</dc:creator>
      <dc:date>2024-03-27T07:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: imx93 high frequency SPI</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx93-high-frequency-SPI/m-p/1841393#M222176</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying the second way.&lt;/P&gt;&lt;P&gt;I have implemented the DTB in order to use the micro as SPI master. I am using spidev driver. I noticed that a can send max 8 bytes per time, if i send more the transaction is divided in blocks of 8 bytes each; here an example (there is aliasing because the clk freq is high, but they are 8 bytes transfer (32 bytes in total):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DS1Z_QuickPrint1.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/272227i9AE1FF590D70B963/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DS1Z_QuickPrint1.png" alt="DS1Z_QuickPrint1.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;DS1Z_QuickPrint1.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This is my device tree configuration:&lt;BR /&gt;&lt;BR /&gt;file imx93.dtsi:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;  lpspi3: spi@42550000 {
    #address-cells = &amp;lt;1&amp;gt;;
    #size-cells = &amp;lt;0&amp;gt;;
    compatible = "fsl,imx93-spi", "fsl,imx7ulp-spi";
    reg = &amp;lt;0x42550000 0x10000&amp;gt;;
    interrupts = &amp;lt;GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH&amp;gt;;
    clocks = &amp;lt;&amp;amp;clk IMX93_CLK_LPSPI3_GATE&amp;gt;,
    &amp;lt;&amp;amp;clk IMX93_CLK_BUS_WAKEUP&amp;gt;;
    clock-names = "per", "ipg";
    status = "disabled";
};&lt;/LI-CODE&gt;&lt;P&gt;file ucm-imx93.dts:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;&amp;amp;lpspi3 {
    pinctrl-names = "default", "sleep";
    pinctrl-0 = &amp;lt;&amp;amp;pinctrl_lpspi3&amp;gt;;
    pinctrl-1 = &amp;lt;&amp;amp;pinctrl_lpspi3&amp;gt;;
    fsl,spi-num-chipselects = &amp;lt;1&amp;gt;;
    cs-gpios = &amp;lt;&amp;amp;gpio2 8 GPIO_ACTIVE_LOW&amp;gt;;
    status = "okay";
    spidev0: spidev@0 {
      reg = &amp;lt;0&amp;gt;;
      compatible = "rohm,dh2228fv";
      spi-max-frequency = &amp;lt;20000000&amp;gt;;
      status = "okay";
    };
};&lt;/LI-CODE&gt;&lt;P&gt;I tryed to add DMA in order to avoid this problem:&lt;/P&gt;&lt;P&gt;file ucm-imx93.dts:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;&amp;amp;lpspi3 {
    pinctrl-names = "default", "sleep";
    pinctrl-0 = &amp;lt;&amp;amp;pinctrl_lpspi3&amp;gt;;
    pinctrl-1 = &amp;lt;&amp;amp;pinctrl_lpspi3&amp;gt;;
    fsl,spi-num-chipselects = &amp;lt;1&amp;gt;;
    cs-gpios = &amp;lt;&amp;amp;gpio2 8 GPIO_ACTIVE_LOW&amp;gt;;
    status = "okay";
    dmas = &amp;lt;&amp;amp;edma2 12 0 0&amp;gt;, &amp;lt;&amp;amp;edma2 13 0 1&amp;gt;;
    dma-names = "tx","rx";
    spidev0: spidev@0 {
      reg = &amp;lt;0&amp;gt;;
      compatible = "rohm,dh2228fv";
      spi-max-frequency = &amp;lt;20000000&amp;gt;;
      status = "okay";
    };
};&lt;/LI-CODE&gt;&lt;P&gt;but with the two code lines for the DMA, the SPI does not work anymore.&lt;/P&gt;&lt;P&gt;Do you know which the error can be in the device tree that cause the SPI not to work with DMA?&lt;/P&gt;&lt;P&gt;Is the delay problem fixable with the DMA? In case, do you know another way to fix it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lorenzo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2024 15:41:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx93-high-frequency-SPI/m-p/1841393#M222176</guid>
      <dc:creator>LorenzoSpadaro</dc:creator>
      <dc:date>2024-04-05T15:41:39Z</dc:date>
    </item>
  </channel>
</rss>

