<?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: imx6sx M4 - enabling/hard reset from linux in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/imx6sx-M4-enabling-hard-reset-from-linux/m-p/398019#M58467</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alejanro,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately I think don't you took time too fully understand my query and seem to have responded with example code rather than actually responding to the questions raised. I have&amp;nbsp; implemented something similar to your example (which I presume is for bare metal) as a kernel driver and a simple linux application (using mmap). From my testing with the kernel 3.14:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;copying to TCM causes a kernel hang&lt;/LI&gt;&lt;LI&gt;releasing the M4 reset "writel(readl(SRC_SCR) &amp;amp; ~(1&amp;lt;&amp;lt;4), SRC_SCR);" causes a kernel hang &lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a starting point could you reply to the questions in the initial email?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Jul 2015 06:17:53 GMT</pubDate>
    <dc:creator>mtx512</dc:creator>
    <dc:date>2015-07-12T06:17:53Z</dc:date>
    <item>
      <title>imx6sx M4 - enabling/hard reset from linux</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx6sx-M4-enabling-hard-reset-from-linux/m-p/398017#M58465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to get clarification on the enabling/resetting the M4&amp;nbsp; because its not documented in the reference manual. From what I understand the following bits can cause the M4 to reset using the SCR (20D8000h) register&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bit 3 - m4c_rst : M4 core reset&lt;/P&gt;&lt;P&gt;bit 4 - m4c_non_sclr_rst - Non-self-clearing SW reset for M4 core&lt;/P&gt;&lt;P&gt;bit 12 - m4p_rst : M4 platform reset&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the M4 isn't enabled from uboot via a bootaux, should it be possible to enable and reset the M4 (ie using bit 4 or bits 3+12) from a Linux application? From my testing with kernel 3.14:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. enabling the M4 (bit 22) + resetting using bit 3+12 has no effect&lt;/P&gt;&lt;P&gt;2. enabling the M4 (bit 22) + resetting using bit 4 causes the kernel to hang.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As side note I would also like to point out the M4 is poorly documented as the reference manual no has description on what the M4 does when a reset occurs. From the code examples it seems to jump to address 0x007F8000 where it expects a Vector Table to exist? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jul 2015 12:31:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx6sx-M4-enabling-hard-reset-from-linux/m-p/398017#M58465</guid>
      <dc:creator>mtx512</dc:creator>
      <dc:date>2015-07-09T12:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: imx6sx M4 - enabling/hard reset from linux</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx6sx-M4-enabling-hard-reset-from-linux/m-p/398018#M58466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is code from one of my peers&amp;nbsp; that enable the CM4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void m4_run_bin(unsigned char *bin, size_t size)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* M4 access for all peripherals on the bus */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; writel(0x77777777,&amp;nbsp; AIPS1_ON_BASE_ADDR );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; writel(0x77777777,&amp;nbsp; AIPS2_ON_BASE_ADDR );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; writel(0x77777777,&amp;nbsp; AIPS3_ON_BASE_ADDR );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* M4 Clock On */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; writel(readl(CCM_CCGR3) | (0x3&amp;lt;&amp;lt;2), CCM_CCGR3);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; memcpy(TCM, bin, size);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Enable M4 and Assert the soft reset */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; writel(readl(SRC_SCR) | (1&amp;lt;&amp;lt;22) | (1&amp;lt;&amp;lt;4), SRC_SCR);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Release the reset for M4 */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; writel(readl(SRC_SCR) &amp;amp; ~(1&amp;lt;&amp;lt;4), SRC_SCR);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to make sure in the CA9 that the clock of the M4 is enabled too.&lt;/P&gt;&lt;P&gt;The 0x007f8000 is a fixed memory where the vector table is looked for by the the CM4 when booting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alejandro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 20:55:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx6sx-M4-enabling-hard-reset-from-linux/m-p/398018#M58466</guid>
      <dc:creator>alejandrolozan1</dc:creator>
      <dc:date>2015-07-10T20:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: imx6sx M4 - enabling/hard reset from linux</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx6sx-M4-enabling-hard-reset-from-linux/m-p/398019#M58467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alejanro,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately I think don't you took time too fully understand my query and seem to have responded with example code rather than actually responding to the questions raised. I have&amp;nbsp; implemented something similar to your example (which I presume is for bare metal) as a kernel driver and a simple linux application (using mmap). From my testing with the kernel 3.14:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;copying to TCM causes a kernel hang&lt;/LI&gt;&lt;LI&gt;releasing the M4 reset "writel(readl(SRC_SCR) &amp;amp; ~(1&amp;lt;&amp;lt;4), SRC_SCR);" causes a kernel hang &lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a starting point could you reply to the questions in the initial email?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Jul 2015 06:17:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx6sx-M4-enabling-hard-reset-from-linux/m-p/398019#M58467</guid>
      <dc:creator>mtx512</dc:creator>
      <dc:date>2015-07-12T06:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: imx6sx M4 - enabling/hard reset from linux</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx6sx-M4-enabling-hard-reset-from-linux/m-p/398020#M58468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the M4 isn't enabled from uboot via a bootaux, should it be possible to enable and reset the M4 (ie using bit 4 or bits 3+12) from a Linux application?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This for sure can be done from Linux, but as far as I know it is not implemented.&lt;/P&gt;&lt;P&gt; You can develop a driver to achieve that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As side note I would also like to point out the M4 is poorly documented as the reference manual no has description on what the M4 does when a reset occurs. From the code examples it seems to jump to address 0x007F8000 where it expects a Vector Table to exist? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 0x007f8000 is a fixed memory where the vector table is looked for by the the CM4 when booting.&lt;/P&gt;&lt;P&gt;There is foudnd the initial SP and PC at vector 0 and vector 1 respectively.&amp;nbsp; Make sure that the clock is enabled before copying the TCM&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;/* M4 Clock On */&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; writel(readl(CCM_CCGR3) | (0x3&amp;lt;&amp;lt;2), CCM_CCGR3);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/Alejandro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 16:36:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx6sx-M4-enabling-hard-reset-from-linux/m-p/398020#M58468</guid>
      <dc:creator>alejandrolozan1</dc:creator>
      <dc:date>2015-07-13T16:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: imx6sx M4 - enabling/hard reset from linux</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx6sx-M4-enabling-hard-reset-from-linux/m-p/398021#M58469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As stated in my initial post I've tried implementing this as a kernel driver on 3.14 :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&lt;LI&gt;copying to TCM causes a kernel hang&lt;/LI&gt;&lt;LI&gt;releasing the M4 reset "writel(readl(SRC_SCR) &amp;amp; ~(1&amp;lt;&amp;lt;4), SRC_SCR);&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can this be tested by team? Furthermore after reviewing the 3.14 kernel source, there are a number of places in the code (while the kernel boots) where detection of a running M4 is used as a trigger for setting sharing of clocks, memory and power management. If I try to start the M4 after the kernel has booted then the kernel is unaware of this and that set-up won't occur. Therefore I'm not convinced the kernel can handle the enabling of the M4 after it boots because it can't keep track of it's state?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 17:23:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx6sx-M4-enabling-hard-reset-from-linux/m-p/398021#M58469</guid>
      <dc:creator>mtx512</dc:creator>
      <dc:date>2015-07-13T17:23:03Z</dc:date>
    </item>
  </channel>
</rss>

