<?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: Error using LPSPI with DMA in i.MX8QXP-MEK board in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Error-using-LPSPI-with-DMA-in-i-MX8QXP-MEK-board/m-p/1567023#M198528</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/201299"&gt;@Dhruvit&lt;/a&gt;, we checked and there is not another device-tree node using this SPI. But we managed to get the communication working; seems to be a signal issue in our hardware.&lt;BR /&gt;&lt;BR /&gt;Thanks and sorry for the late reply!&lt;/P&gt;</description>
    <pubDate>Thu, 08 Dec 2022 18:21:00 GMT</pubDate>
    <dc:creator>guilhermes</dc:creator>
    <dc:date>2022-12-08T18:21:00Z</dc:date>
    <item>
      <title>Error using LPSPI with DMA in i.MX8QXP-MEK board</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Error-using-LPSPI-with-DMA-in-i-MX8QXP-MEK-board/m-p/1507032#M193913</link>
      <description>&lt;P&gt;Hello NXP team,&lt;BR /&gt;&lt;BR /&gt;I've been trying to set up &lt;FONT color="#000080"&gt;lpspi0&lt;/FONT&gt; in a i.MX8QXP-MEK (CPU + BaseBoard) connected to a SLB9670 TPM2.0 device thorough the Arduino Header port in the BB (J29) with DMA. Device was correctly detected, but I've been having DMA setup problems, and spi config is switching to PIO:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;root@imx8qxpc0mek:~# dmesg | grep spi
[    1.464934] fsl_lpspi 5a000000.spi: spi_register_controller error.
[    1.479991] spi-nor spi0.0: mt35xu512aba (65536 Kbytes)
[    3.087588] fsl_lpspi 5a000000.spi: dma setup error -19, use pio
[    3.103069] tpm_tis_spi spi1.0: 2.0 TPM (device-id 0x1B, rev-id 22)
root@imx8qxpc0mek:~# dmesg | grep tpm
[    3.103069] tpm_tis_spi spi1.0: 2.0 TPM (device-id 0x1B, rev-id 22)
[    3.115911] tpm tpm0: A TPM error (256) occurred attempting the self test
[    3.127689] tpm tpm0: starting up the TPM manually
​&lt;/LI-CODE&gt;&lt;P&gt;Distro is set up with release LF5.10.72_2.2.0 &lt;EM&gt;(hardnott),&lt;/EM&gt; though I have seen the same issue in&amp;nbsp;release LF5.15.32_2.0.0 (&lt;EM&gt;kirkstone&lt;/EM&gt;) as well. Both set up according to the&amp;nbsp;IMXLXYOCTOUG document. Default linux-imx kernel &amp;amp;&amp;nbsp;&lt;FONT color="#008000"&gt;fsl-lpspi.c&lt;/FONT&gt; driver source as well.&lt;BR /&gt;&lt;BR /&gt;DMA config for &lt;FONT color="#000080"&gt;lpspi0&lt;/FONT&gt; was set up following the device tree file &lt;FONT color="#008000"&gt;imx8-ss-dma.dtsi&lt;/FONT&gt;. Only difference is the assigned clock rate, from 20 MHz to 60 MHz:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;	lpspi0: spi@5a000000 {
		//compatible = "fsl,imx7ulp-spi", "fsl,imx8qxp-spi";
		compatible = "fsl,imx7ulp-spi";
		reg = &amp;lt;0x5a000000 0x10000&amp;gt;;
		#address-cells = &amp;lt;1&amp;gt;;
		#size-cells = &amp;lt;0&amp;gt;;
		interrupts = &amp;lt;GIC_SPI 336 IRQ_TYPE_LEVEL_HIGH&amp;gt;;
		interrupt-parent = &amp;lt;&amp;amp;gic&amp;gt;;
		clocks = &amp;lt;&amp;amp;spi0_lpcg 0&amp;gt;,
			 &amp;lt;&amp;amp;spi0_lpcg 1&amp;gt;;
		clock-names = "per", "ipg";
		assigned-clocks = &amp;lt;&amp;amp;clk IMX_SC_R_SPI_0 IMX_SC_PM_CLK_PER&amp;gt;;
		assigned-clock-rates = &amp;lt;60000000&amp;gt;;
		//assigned-clock-rates = &amp;lt;20000000&amp;gt;;
		power-domains = &amp;lt;&amp;amp;pd IMX_SC_R_SPI_0&amp;gt;;
		dma-names = "tx","rx";
		dmas = &amp;lt;&amp;amp;edma2 1 0 0&amp;gt;, &amp;lt;&amp;amp;edma2 0 0 1&amp;gt;;
		status = "disabled";
	};&lt;/LI-CODE&gt;&lt;P&gt;And for the actual device node itself, in &lt;FONT color="#008000"&gt;imx8x-mek.dtsi&lt;/FONT&gt;:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;&amp;amp;lpspi0 {
	#address-cells = &amp;lt;1&amp;gt;;
	#size-cells = &amp;lt;0&amp;gt;;
 	fsl,spi-num-chipselects = &amp;lt;1&amp;gt;;
 	pinctrl-names = "default";
	pinctrl-0 = &amp;lt;&amp;amp;pinctrl_lpspi0 &amp;amp;pinctrl_lpspi0_cs&amp;gt;;	
 	cs-gpios = &amp;lt;&amp;amp;lsio_gpio1 8 GPIO_ACTIVE_LOW&amp;gt;;
	status = "okay"; 
 	tpm: slb9670@0 {
 		reg = &amp;lt;0&amp;gt;;
	 	//compatible = "infineon,slb9670", "tcg,tpm_tis-spi";
		compatible = "infineon,slb9670";	
	 	spi-max-frequency = &amp;lt;2000000&amp;gt;;
 		status = "okay";	
    };
	spidev0: spi@0 { 
		reg = &amp;lt;0&amp;gt;;
		compatible = "rohm,dh2228fv", "spidev";
		spi-max-frequency = &amp;lt;1000000&amp;gt;;
		status = "disabled";
	};
};&lt;/LI-CODE&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Currently using CS as GPIO - as seem in the&amp;nbsp;&lt;/FONT&gt;&lt;SPAN&gt;&lt;FONT color="#000000"&gt;node for the NOR flash in &lt;FONT color="#008000"&gt;imx8qm-lpddr4-val-lpspi.dts&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#008000"&gt;,&lt;/FONT&gt; which has been working as expected. Changing the default assigned-clock-rate property to 60000000 was effective in achieving the desired up the clock line the the SPI slave (2[MHz]).&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#008000"&gt;&lt;FONT color="#000000"&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LPSPI0 bus activity between processor and SLB9670 device." style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/190416iE7451414069F9C76/image-size/large?v=v2&amp;amp;px=999" role="button" title="nxp-forum-001.png" alt="LPSPI0 bus activity between processor and SLB9670 device." /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;LPSPI0 bus activity between processor and SLB9670 device.&lt;/span&gt;&lt;/span&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;What could be the cause of the DMA error in this scenario?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 20:44:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Error-using-LPSPI-with-DMA-in-i-MX8QXP-MEK-board/m-p/1507032#M193913</guid>
      <dc:creator>guilhermes</dc:creator>
      <dc:date>2022-08-16T20:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: Error using LPSPI with DMA in i.MX8QXP-MEK board</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Error-using-LPSPI-with-DMA-in-i-MX8QXP-MEK-board/m-p/1515220#M194575</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/136564"&gt;@guilhermes&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Could you please check if there is another device-tree node using SPI gpio?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Dhruvit.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2022 05:11:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Error-using-LPSPI-with-DMA-in-i-MX8QXP-MEK-board/m-p/1515220#M194575</guid>
      <dc:creator>Dhruvit</dc:creator>
      <dc:date>2022-09-01T05:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: Error using LPSPI with DMA in i.MX8QXP-MEK board</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Error-using-LPSPI-with-DMA-in-i-MX8QXP-MEK-board/m-p/1567023#M198528</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/201299"&gt;@Dhruvit&lt;/a&gt;, we checked and there is not another device-tree node using this SPI. But we managed to get the communication working; seems to be a signal issue in our hardware.&lt;BR /&gt;&lt;BR /&gt;Thanks and sorry for the late reply!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 18:21:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Error-using-LPSPI-with-DMA-in-i-MX8QXP-MEK-board/m-p/1567023#M198528</guid>
      <dc:creator>guilhermes</dc:creator>
      <dc:date>2022-12-08T18:21:00Z</dc:date>
    </item>
  </channel>
</rss>

