<?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 The HW_SSP_CTRL0_RUN bit is not cleared after first write to SPI-NOR memory (i.MX278) in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/The-HW-SSP-CTRL0-RUN-bit-is-not-cleared-after-first-write-to-SPI/m-p/1485524#M192246</link>
    <description>&lt;P&gt;&lt;SPAN class=""&gt;Please find more detailed explanation of the problem.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Setup:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN class=""&gt;&lt;LI-PRODUCT title="iMX287" id="iMX287"&gt;&lt;/LI-PRODUCT&gt;SoC (rev. 1.2) with SSP2 used to read the boot device (SPI-NOR).&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;u-boot&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;HAB is supported (&lt;/SPAN&gt;&lt;A title="" href="https://u-boot.sb" target="_blank" rel="noopener noreferrer"&gt;u-boot.sb&lt;/A&gt;&lt;SPAN class=""&gt; built with combining u-boot.{bin|ivt|sig|dtb}. However, there are some HAB events displayed on the console and most of all the device is not "locked" (fuses are not touched).&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN class=""&gt;Reproduction steps:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN class=""&gt;Perform some busy looping to heat up the device (die temperature to 70 deg C - measured with LRADC ch9 and ch8) and reset (with u-boot reset command) it all the time (the u-boot's bootcmd command is properly adjusted)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;It takes around 10 minutes of continuous restarts to observe the issue&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN class=""&gt;Problem:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN class=""&gt;The device hangs (sporadically) when SPI-NOR memory is accessed for the first time in u-boot (to read envs)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;It looks like the only previous user of SSP2 is the BOOT ROM of &lt;LI-PRODUCT title="iMX287" id="iMX287"&gt;&lt;/LI-PRODUCT&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;By "hangs" - I mean the transmission via SSP2 is stopped. The &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN class=""&gt;HW_SSP_CTRL0_RUN&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN class=""&gt; bit (29) in &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN class=""&gt;HW_SSP_CTRL0 &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN class=""&gt;register is not cleared after the successful transmission. The sent command is 0x9F (CMD_READ_ID). The 0x9F is sent from imx287 SoC (I can read it from the oscilloscope). The clock and MOSI signals have the same shapes in both cases (no distortion).&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;Subsequent calling of `sf probe 2:0` causes the device to work correctly (it is unlocked and operates correctly).&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;The problem happens in PIO mode (not DMA) : &lt;/SPAN&gt;&lt;A title="" href="https://source.denx.de/u-boot/u-boot/-/blob/master/drivers/spi/mxs_spi.c#L125" target="_blank" rel="noopener noreferrer"&gt;https://source.denx.de/u-boot/u-boot/-/blob/master/drivers/spi/mxs_spi.c#L125&lt;/A&gt;&lt;SPAN class=""&gt; [*]&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN class=""&gt;Note:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN class=""&gt;I've found on the Internet similar issue: &lt;/SPAN&gt;&lt;A title="" href="https://community.nxp.com/t5/i-MX-Processors/About-SPI-I-F-control-for-MX28/td-p/447819" target="_blank" rel="noopener noreferrer"&gt;https://community.nxp.com/t5/i-MX-Processors/About-SPI-I-F-control-for-MX28/td-p/447819&lt;/A&gt;&lt;SPAN class=""&gt; but the recommendation was to use the code to wait for the result in busy waiting. Such code is already present in the u-boot used by me.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;In the thread above NXP's customer suggested to&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN class=""&gt; read&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;SPAN class=""&gt;HW_SSP_STATUS &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN class=""&gt;register to "unlock" the state of HW_SSP_CTRL0. Is this recommended?&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Questions to be answered:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN class=""&gt;I would like to know if the above problem is known - in other words if there is a possibility for the SSP2 controller to lock itself?&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;&lt;STRIKE&gt;Is reading the HW_SSP_STATUS register helping in preventing the locking&lt;/STRIKE&gt; &lt;STRIKE&gt;? &lt;/STRIKE&gt;-&amp;gt; This seems not to be the case, as on my setup reading it didn't "clear" the RUN bit.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;Can the BOOT ROM is some case leave the SSP2 controller in unstable condition?&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN class=""&gt;I've attached:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN class=""&gt;Dump of SSP2 registers just after the hang [*] (after the printf statement).&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;Dump of AHB_to_APBH registers just after the hang [*]&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN class=""&gt;Interesting observation:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN class=""&gt;The SSP2 works with 40MHz clock. Reducing this frequency to 26.6 MHz causes this error to not be apparent anymore.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
    <pubDate>Wed, 06 Jul 2022 15:28:52 GMT</pubDate>
    <dc:creator>lmajewski</dc:creator>
    <dc:date>2022-07-06T15:28:52Z</dc:date>
    <item>
      <title>The HW_SSP_CTRL0_RUN bit is not cleared after first write to SPI-NOR memory (i.MX278)</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/The-HW-SSP-CTRL0-RUN-bit-is-not-cleared-after-first-write-to-SPI/m-p/1485524#M192246</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;Please find more detailed explanation of the problem.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Setup:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN class=""&gt;&lt;LI-PRODUCT title="iMX287" id="iMX287"&gt;&lt;/LI-PRODUCT&gt;SoC (rev. 1.2) with SSP2 used to read the boot device (SPI-NOR).&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;u-boot&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;HAB is supported (&lt;/SPAN&gt;&lt;A title="" href="https://u-boot.sb" target="_blank" rel="noopener noreferrer"&gt;u-boot.sb&lt;/A&gt;&lt;SPAN class=""&gt; built with combining u-boot.{bin|ivt|sig|dtb}. However, there are some HAB events displayed on the console and most of all the device is not "locked" (fuses are not touched).&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN class=""&gt;Reproduction steps:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN class=""&gt;Perform some busy looping to heat up the device (die temperature to 70 deg C - measured with LRADC ch9 and ch8) and reset (with u-boot reset command) it all the time (the u-boot's bootcmd command is properly adjusted)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;It takes around 10 minutes of continuous restarts to observe the issue&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN class=""&gt;Problem:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN class=""&gt;The device hangs (sporadically) when SPI-NOR memory is accessed for the first time in u-boot (to read envs)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;It looks like the only previous user of SSP2 is the BOOT ROM of &lt;LI-PRODUCT title="iMX287" id="iMX287"&gt;&lt;/LI-PRODUCT&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;By "hangs" - I mean the transmission via SSP2 is stopped. The &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN class=""&gt;HW_SSP_CTRL0_RUN&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN class=""&gt; bit (29) in &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN class=""&gt;HW_SSP_CTRL0 &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN class=""&gt;register is not cleared after the successful transmission. The sent command is 0x9F (CMD_READ_ID). The 0x9F is sent from imx287 SoC (I can read it from the oscilloscope). The clock and MOSI signals have the same shapes in both cases (no distortion).&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;Subsequent calling of `sf probe 2:0` causes the device to work correctly (it is unlocked and operates correctly).&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;The problem happens in PIO mode (not DMA) : &lt;/SPAN&gt;&lt;A title="" href="https://source.denx.de/u-boot/u-boot/-/blob/master/drivers/spi/mxs_spi.c#L125" target="_blank" rel="noopener noreferrer"&gt;https://source.denx.de/u-boot/u-boot/-/blob/master/drivers/spi/mxs_spi.c#L125&lt;/A&gt;&lt;SPAN class=""&gt; [*]&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN class=""&gt;Note:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN class=""&gt;I've found on the Internet similar issue: &lt;/SPAN&gt;&lt;A title="" href="https://community.nxp.com/t5/i-MX-Processors/About-SPI-I-F-control-for-MX28/td-p/447819" target="_blank" rel="noopener noreferrer"&gt;https://community.nxp.com/t5/i-MX-Processors/About-SPI-I-F-control-for-MX28/td-p/447819&lt;/A&gt;&lt;SPAN class=""&gt; but the recommendation was to use the code to wait for the result in busy waiting. Such code is already present in the u-boot used by me.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;In the thread above NXP's customer suggested to&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN class=""&gt; read&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;SPAN class=""&gt;HW_SSP_STATUS &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN class=""&gt;register to "unlock" the state of HW_SSP_CTRL0. Is this recommended?&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Questions to be answered:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN class=""&gt;I would like to know if the above problem is known - in other words if there is a possibility for the SSP2 controller to lock itself?&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;&lt;STRIKE&gt;Is reading the HW_SSP_STATUS register helping in preventing the locking&lt;/STRIKE&gt; &lt;STRIKE&gt;? &lt;/STRIKE&gt;-&amp;gt; This seems not to be the case, as on my setup reading it didn't "clear" the RUN bit.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;Can the BOOT ROM is some case leave the SSP2 controller in unstable condition?&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN class=""&gt;I've attached:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN class=""&gt;Dump of SSP2 registers just after the hang [*] (after the printf statement).&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;Dump of AHB_to_APBH registers just after the hang [*]&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN class=""&gt;Interesting observation:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN class=""&gt;The SSP2 works with 40MHz clock. Reducing this frequency to 26.6 MHz causes this error to not be apparent anymore.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Wed, 06 Jul 2022 15:28:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/The-HW-SSP-CTRL0-RUN-bit-is-not-cleared-after-first-write-to-SPI/m-p/1485524#M192246</guid>
      <dc:creator>lmajewski</dc:creator>
      <dc:date>2022-07-06T15:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: The HW_SSP_CTRL0_RUN bit is not cleared after first write to SPI-NOR memory (i.MX278)</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/The-HW-SSP-CTRL0-RUN-bit-is-not-cleared-after-first-write-to-SPI/m-p/1485526#M192247</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;I've debugged more thoroughly the AHB-to-APBH DMA state for the Channel 2 (SSP2).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;The dump of its registers can be found in the file attached in the above file - those are the next instruction after the SSP2 PIO transfer hangs.&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;HW_SSP_STATUS:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;(gdb) p/x *0x80014100&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;$3 = 0xe00c0020&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Here we do have set the: `ssp_dmareq` and `ssp_dmaend` signals&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;The same signals are visible on the APBH debug registers:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;HW_APBH_CH2_DEBUG1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;(gdb) p/x *0x80004230&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;$15 = 0x90a00000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;HW_APBH_CH2_DEBUG2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;(gdb) p/x *0x80004240&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;$16 = 0x0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;In the CH2_DEBUG1 register the "REQ" [bit31] and "END" [bit28] are set. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Please correct my understanding - does this mean that the SSP2 IP block first requested&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;DMA CMD/DATA and then (immediately?) signaled the END of this transfer?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Other IP blocks have the CHX_DEBUG1 as 0xb0a0_0000 (REQ, KICK,END) or just 0x00a0_0000 (IDLE, no operation).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;I also assume the WR|RD_FIFO_EMPTY are correctly set to indicate that nothing has left for the transfer?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2022 15:35:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/The-HW-SSP-CTRL0-RUN-bit-is-not-cleared-after-first-write-to-SPI/m-p/1485526#M192247</guid>
      <dc:creator>lmajewski</dc:creator>
      <dc:date>2022-07-06T15:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: The HW_SSP_CTRL0_RUN bit is not cleared after first write to SPI-NOR memory (i.MX278)</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/The-HW-SSP-CTRL0-RUN-bit-is-not-cleared-after-first-write-to-SPI/m-p/1515541#M194611</link>
      <description>&lt;P&gt;The imx28 datascheet:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.nxp.com/docs/en/data-sheet/IMX28CEC.pdf" target="_blank"&gt;https://www.nxp.com/docs/en/data-sheet/IMX28CEC.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;in point "3.5.14.4 SPI AC Timing" recommends using SPI CLK frequency (for SSP2) not higher than 20 MHz. In my application 40 MHz was set (as it is also present on the Linux kernel DTS - for example for imx28-evk.dts)&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2022 10:42:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/The-HW-SSP-CTRL0-RUN-bit-is-not-cleared-after-first-write-to-SPI/m-p/1515541#M194611</guid>
      <dc:creator>lmajewski</dc:creator>
      <dc:date>2022-09-01T10:42:45Z</dc:date>
    </item>
  </channel>
</rss>

