<?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: How to detect reset source in imx8qm in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/How-to-detect-reset-source-in-imx8qm/m-p/956067#M142829</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi mrigendra&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one can try to change in function imx_system_reset()..&lt;BR /&gt;{&amp;nbsp;&amp;nbsp; &amp;nbsp;sc_pm_reboot(ipc_handle, SC_PM_RESET_TYPE_COLD);..&lt;/P&gt;&lt;P&gt;for example to sc_pm_reboot(SC_IPC_CH, SC_PM_RESET_TYPE_WARM);&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://source.codeaurora.org/external/imx/imx-atf/tree/plat/imx/common/imx8_psci.c?h=imx_4.14.98_2.0.0_ga" title="https://source.codeaurora.org/external/imx/imx-atf/tree/plat/imx/common/imx8_psci.c?h=imx_4.14.98_2.0.0_ga"&gt;imx8_psci.c\common\imx\plat - imx-atf - i.MX ARM Trusted firmware&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"sc_pm_reset_type_t" can be found in&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://source.codeaurora.org/external/imx/imx-atf/tree/plat/imx/common/include/sci/svc/pm/sci_pm_api.h?h=imx_4.14.98_2.0.0_ga" title="https://source.codeaurora.org/external/imx/imx-atf/tree/plat/imx/common/include/sci/svc/pm/sci_pm_api.h?h=imx_4.14.98_2.0.0_ga"&gt;sci_pm_api.h\pm\svc\sci\include\common\imx\plat - imx-atf - i.MX ARM Trusted firmware&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;BR /&gt;igor&lt;BR /&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>Fri, 07 Jun 2019 06:12:04 GMT</pubDate>
    <dc:creator>igorpadykov</dc:creator>
    <dc:date>2019-06-07T06:12:04Z</dc:date>
    <item>
      <title>How to detect reset source in imx8qm</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-detect-reset-source-in-imx8qm/m-p/956066#M142828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Recently I needed to implement a function for our imx8qm board, which need to know the reset cause/reason/source.&lt;/P&gt;&lt;P&gt;This function is required to be in uboot as well as kernel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For this reason I tried using sc firmware apis, like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sc_pm_reset_reason((sc_ipc_t)ipcHndl, reason);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but in uboot and in kernel, even after I issue reset(uboot) or reboot(kernel) the return value from this function is always 0, i.e. POR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the version file of my sc-firmware source,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NXP i.MX System Controller Firmware&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;--------------------------------------------&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Git repo: ssh://git@bitm-us-cdc01.sw.nxp.com:7999/bitbucket/imx/imx-sc-firmware.git&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Branch name: imx_4.14.78_1.0.0_ga&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Build version: 3008&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Commit ID: 0x01f1cd7df&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Build date: Feb 28 2019&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Build time: 11:15:30&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. So how or what we need to do in order to get correct reset source?&lt;/P&gt;&lt;P&gt;2. In uboot do we need to implement a watchdog driver that is based on scfw?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2019 11:09:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-detect-reset-source-in-imx8qm/m-p/956066#M142828</guid>
      <dc:creator>mrigendra_chaub</dc:creator>
      <dc:date>2019-06-06T11:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to detect reset source in imx8qm</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-detect-reset-source-in-imx8qm/m-p/956067#M142829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi mrigendra&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one can try to change in function imx_system_reset()..&lt;BR /&gt;{&amp;nbsp;&amp;nbsp; &amp;nbsp;sc_pm_reboot(ipc_handle, SC_PM_RESET_TYPE_COLD);..&lt;/P&gt;&lt;P&gt;for example to sc_pm_reboot(SC_IPC_CH, SC_PM_RESET_TYPE_WARM);&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://source.codeaurora.org/external/imx/imx-atf/tree/plat/imx/common/imx8_psci.c?h=imx_4.14.98_2.0.0_ga" title="https://source.codeaurora.org/external/imx/imx-atf/tree/plat/imx/common/imx8_psci.c?h=imx_4.14.98_2.0.0_ga"&gt;imx8_psci.c\common\imx\plat - imx-atf - i.MX ARM Trusted firmware&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"sc_pm_reset_type_t" can be found in&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://source.codeaurora.org/external/imx/imx-atf/tree/plat/imx/common/include/sci/svc/pm/sci_pm_api.h?h=imx_4.14.98_2.0.0_ga" title="https://source.codeaurora.org/external/imx/imx-atf/tree/plat/imx/common/include/sci/svc/pm/sci_pm_api.h?h=imx_4.14.98_2.0.0_ga"&gt;sci_pm_api.h\pm\svc\sci\include\common\imx\plat - imx-atf - i.MX ARM Trusted firmware&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;BR /&gt;igor&lt;BR /&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>Fri, 07 Jun 2019 06:12:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-detect-reset-source-in-imx8qm/m-p/956067#M142829</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2019-06-07T06:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to detect reset source in imx8qm</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-detect-reset-source-in-imx8qm/m-p/956068#M142830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Igor&lt;/P&gt;&lt;P&gt;kernel version:&amp;nbsp;&lt;STRONG style="color: #51626f; background-color: #ffffff; border: 0px; font-weight: bold;"&gt;4.14.78&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;uboot version : U-Boot 2018.03&lt;STRONG style="color: #51626f; background-color: #ffffff; border: 0px; font-weight: bold;"&gt;-34664-g91acfdb46d-dirty&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First thing I did was your suggestion but that doesnot change reset reason.&lt;/P&gt;&lt;P&gt;even this call does not do anything, because this is never called/reached,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;void reset_cpu(ulong addr)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; puts("SCI reboot request");&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; sc_pm_reboot(SC_IPC_CH, SC_PM_RESET_TYPE_COLD);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; while (1)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; putc('.');&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;reset command comes from this file reset.c&lt;/P&gt;&lt;P&gt;this is the function&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; puts ("resetting...\n");&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; udelay (50000); /* wait 50 ms */&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; disable_interrupts();&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; reset_misc(); /*call goes to armv8 fwcall.c PSCI reset and never returns*/&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; reset_cpu(0);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; /*NOTREACHED*/&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; return 0;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I think sc_pm_reboot never gets called and system gets&amp;nbsp;&lt;STRONG&gt;psci&amp;nbsp;&lt;/STRONG&gt;reset via&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;fwcall.c&lt;SPAN&gt;&amp;nbsp; file's&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;void __noreturn __efi_runtime psci_system_reset(void)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I comment out misc_reset, I get dots in while loop.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;....................................&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;that means &lt;STRONG&gt;sc_pm_reboot&lt;/STRONG&gt; never worked and this while loop starts executing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you clarify what is to be done to get&amp;nbsp;&lt;STRONG&gt;sc_pm_reboot()&lt;/STRONG&gt; function working ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Jun 2019 08:54:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-detect-reset-source-in-imx8qm/m-p/956068#M142830</guid>
      <dc:creator>mrigendra_chaub</dc:creator>
      <dc:date>2019-06-16T08:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to detect reset source in imx8qm</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-detect-reset-source-in-imx8qm/m-p/956069#M142831</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;Did you able to get the reset reason from the linux system using system controller API's.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if so, could you comment the steps?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Vinothkumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Nov 2019 10:45:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-detect-reset-source-in-imx8qm/m-p/956069#M142831</guid>
      <dc:creator>vinothkumareswa</dc:creator>
      <dc:date>2019-11-29T10:45:18Z</dc:date>
    </item>
  </channel>
</rss>

