<?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のトピックiMX8QM SPI dynamically switching master and slave mode for same controller</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/iMX8QM-SPI-dynamically-switching-master-and-slave-mode-for-same/m-p/1533238#M196031</link>
    <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;We have Android11_2.2.0 BSP(5.10.35) running on our custom hardware (imx8qm based).&lt;/P&gt;&lt;P&gt;We have SPI0 connected to a SPI slave, and also to a SPI master with different chip selects CS0 and CSI respectively.&lt;/P&gt;&lt;P&gt;We have validated individually, that SPI controller(lpspi0) works in master and slave mode dynamically. Is it possible to configure same controller as both master and slave at different instance? So far from the dts it looks like either the controller is configured as master or slave at boot time using dts. But we want to have a usecase something like device boots as SPI in master mode, later SPI switches to slave mode. Or just switch the modes at runtime between slave/master mode.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From the reference module, it looks like doable with the register settings. Please let me know&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lpspi0_cfg1.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/195911iE5F3E9ECAC2E1B33/image-size/large?v=v2&amp;amp;px=999" role="button" title="lpspi0_cfg1.png" alt="lpspi0_cfg1.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Oct 2022 08:00:09 GMT</pubDate>
    <dc:creator>Nishal</dc:creator>
    <dc:date>2022-10-06T08:00:09Z</dc:date>
    <item>
      <title>iMX8QM SPI dynamically switching master and slave mode for same controller</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8QM-SPI-dynamically-switching-master-and-slave-mode-for-same/m-p/1533238#M196031</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;We have Android11_2.2.0 BSP(5.10.35) running on our custom hardware (imx8qm based).&lt;/P&gt;&lt;P&gt;We have SPI0 connected to a SPI slave, and also to a SPI master with different chip selects CS0 and CSI respectively.&lt;/P&gt;&lt;P&gt;We have validated individually, that SPI controller(lpspi0) works in master and slave mode dynamically. Is it possible to configure same controller as both master and slave at different instance? So far from the dts it looks like either the controller is configured as master or slave at boot time using dts. But we want to have a usecase something like device boots as SPI in master mode, later SPI switches to slave mode. Or just switch the modes at runtime between slave/master mode.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From the reference module, it looks like doable with the register settings. Please let me know&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lpspi0_cfg1.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/195911iE5F3E9ECAC2E1B33/image-size/large?v=v2&amp;amp;px=999" role="button" title="lpspi0_cfg1.png" alt="lpspi0_cfg1.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 08:00:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8QM-SPI-dynamically-switching-master-and-slave-mode-for-same/m-p/1533238#M196031</guid>
      <dc:creator>Nishal</dc:creator>
      <dc:date>2022-10-06T08:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: iMX8QM SPI dynamically switching master and slave mode for same controller</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8QM-SPI-dynamically-switching-master-and-slave-mode-for-same/m-p/1535981#M196250</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/194975"&gt;@Nishal&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;I hope you are doing well.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;In&amp;nbsp;spi-fsl-lpspi driver, there is no mechanism to change between slave and master once it has been probed. it can be only decided by dts by declaring the property "&lt;STRONG&gt;spi-slave&lt;/STRONG&gt;".&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Yes, you can change between master and slave modes using the register setting in&amp;nbsp;Configuration Register 1 (CFGR1) ( bit : 0), but before editing this register you have to disable LPSPI module MEN ( bit :0) in Control Register(CR).&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Thanks &amp;amp; Regards&lt;/DIV&gt;
&lt;DIV&gt;Sanket Parekh&lt;/DIV&gt;</description>
      <pubDate>Wed, 12 Oct 2022 04:53:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8QM-SPI-dynamically-switching-master-and-slave-mode-for-same/m-p/1535981#M196250</guid>
      <dc:creator>Sanket_Parekh</dc:creator>
      <dc:date>2022-10-12T04:53:48Z</dc:date>
    </item>
  </channel>
</rss>

