<?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 LS102xA I2C Bus Recovery in Layerscape</title>
    <link>https://community.nxp.com/t5/Layerscape/LS102xA-I2C-Bus-Recovery/m-p/669820#M2487</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Hello,&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;I am developing a device using the TQMLS102xA module by TQ. My device integrates with several slave devices over a hot-swappable i2c bus, and there are circumstances where an i2c slave device will lock the i2c bus, preventing any writes/reads to any device on the bus.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/thread/316813#comment-882281"&gt;This comment&lt;/A&gt;&amp;nbsp;suggests that the i2c bus recovery functionality can be added to the kernel i2c driver (I believe the LS102xa uses the drivers/i2c/busses/i2c-imx.c i2c implementation).&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;However,&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;a) The linked patch discussion suggests that it will not perform the bus recovery on the LS1021A. Is this correct? Is there any other way of performing the recovery when using an LS1021A?&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;b) How can we trigger this bus recovery function from the userspace application using the i2c?&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Thanks&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Jul 2017 12:42:07 GMT</pubDate>
    <dc:creator>mbend</dc:creator>
    <dc:date>2017-07-14T12:42:07Z</dc:date>
    <item>
      <title>LS102xA I2C Bus Recovery</title>
      <link>https://community.nxp.com/t5/Layerscape/LS102xA-I2C-Bus-Recovery/m-p/669820#M2487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Hello,&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;I am developing a device using the TQMLS102xA module by TQ. My device integrates with several slave devices over a hot-swappable i2c bus, and there are circumstances where an i2c slave device will lock the i2c bus, preventing any writes/reads to any device on the bus.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/thread/316813#comment-882281"&gt;This comment&lt;/A&gt;&amp;nbsp;suggests that the i2c bus recovery functionality can be added to the kernel i2c driver (I believe the LS102xa uses the drivers/i2c/busses/i2c-imx.c i2c implementation).&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;However,&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;a) The linked patch discussion suggests that it will not perform the bus recovery on the LS1021A. Is this correct? Is there any other way of performing the recovery when using an LS1021A?&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;b) How can we trigger this bus recovery function from the userspace application using the i2c?&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Thanks&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jul 2017 12:42:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Layerscape/LS102xA-I2C-Bus-Recovery/m-p/669820#M2487</guid>
      <dc:creator>mbend</dc:creator>
      <dc:date>2017-07-14T12:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: LS102xA I2C Bus Recovery</title>
      <link>https://community.nxp.com/t5/Layerscape/LS102xA-I2C-Bus-Recovery/m-p/669821#M2488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;a)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;1) The stuck situation with SCL HIGH.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Stop condition terminates a transfer and can be used to abort it as well.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Therefore if SDA LOW then master should generate pulses on SCL and look for SDA HIGH. As soon as the SDA line will be returned to high level the master can generate STOP condition for abort of transfer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Usually for this goal the I2C pins should be reconfigured to general open-drain outputs. The software generates pulses on SCL line, look for SDA HIGH and generate STOP condition. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;However some devices expect different sequence. For example see please the RESET sequence for Atmel EEPROM (User's Manual of Atmel AT24C01A/02/04/08/16).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;MEMORY RESET: After an interruption in protocol, power loss or system reset, any 2-wire part can be reset by following these steps:&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10.0pt;"&gt; Clock up to 9 cycles.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10.0pt;"&gt; Look for SDA high in each cycle while SCL is high.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10.0pt;"&gt; Create a start condition.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;NXP Reference Manuals for QorIQ processors recommends the following command sequence for &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Generation of SCL when SDA low&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10.0pt;"&gt; Disable the I2C module and set the master bit by setting &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;IBCR&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt;"&gt; to 0x20&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10.0pt;"&gt; Enable the I2C module by setting &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;IBCR&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt;"&gt; to 0xA0&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10.0pt;"&gt; Read the &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;IBDR&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10.0pt;"&gt; Return the I2C module to slave mode by setting &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;IBCR&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt;"&gt; to 0x80&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;2) The stuck situation with SCL LOW.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;If a slave can't receive or transmit another complete byte of data until it has performed some other function, for example servicing an internal interrupt, it can hold the clock line SCL LOW to force the master into a wait state. Data transfer then continues when the slave is ready for another byte of data and releases clock line SCL (Section 7 of I2C-bus specification).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;You cannot recover with this situation. The owner of SCL line should release line SCL.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;b)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Customers usually use a timer for detection of I2C hanging.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;For example, SMB bus is similar to the I2C bus. The I2C Specification recommends 35ms for SMB bus.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jul 2017 04:42:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Layerscape/LS102xA-I2C-Bus-Recovery/m-p/669821#M2488</guid>
      <dc:creator>Pavel</dc:creator>
      <dc:date>2017-07-17T04:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: LS102xA I2C Bus Recovery</title>
      <link>https://community.nxp.com/t5/Layerscape/LS102xA-I2C-Bus-Recovery/m-p/669822#M2489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a similar situation on a custom LS1046A design.&lt;/P&gt;&lt;P&gt;The I2C controller 1 (which has no possibilities to reconfigure the I/Os to GPIO) stuck after an asynchronous reset during a I2C cycle with SDA = low and SCL = high.&lt;/P&gt;&lt;P&gt;I can't power cycle the slave device that caused this, because it is connected to an external power supply.&lt;/P&gt;&lt;P&gt;The recommended sequence to generate clock cycle does not work for unknown reason.&lt;/P&gt;&lt;P&gt;Is there another possibility to create some clock pulses on the SCL line to help the slave device to finish its cycle and to release the SDA line?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regrads,&lt;/P&gt;&lt;P&gt;Detlef&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2019 14:09:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Layerscape/LS102xA-I2C-Bus-Recovery/m-p/669822#M2489</guid>
      <dc:creator>detlef_wolf</dc:creator>
      <dc:date>2019-12-02T14:09:34Z</dc:date>
    </item>
  </channel>
</rss>

