<?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: Put the imx8dxl A35 in suspend mode via imx-atf in Other NXP Products</title>
    <link>https://community.nxp.com/t5/Other-NXP-Products/Put-the-imx8dxl-A35-in-suspend-mode-via-imx-atf/m-p/2103885#M28748</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/247079"&gt;@hojames2025&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;In Linux, the resume address is&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;&lt;SPAN&gt;phys_addr_t&lt;/SPAN&gt;&lt;SPAN&gt; pa_cpu_resume = &lt;/SPAN&gt;&lt;SPAN&gt;__pa_symbol&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;(cpu_resume)&lt;/EM&gt;&lt;/STRONG&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;__pa_symbol&lt;/STRONG&gt; will convert symbolic virtual addresses in kernel code to physical addresses.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;//arch/arm64/include/asm/memory.h
#define __pa_symbol(x)		__phys_addr_symbol(RELOC_HIDE((unsigned long)(x), 0))

#define __phys_addr_symbol(x)	__pa_symbol_nodebug(x)
#define __pa_symbol_nodebug(x)	__kimg_to_phys((phys_addr_t)(x))
#define __kimg_to_phys(addr)	((addr) - kimage_voffset)

kimage_voffset
--------------

The offset between the kernel virtual and physical mappings. Used to
translate virtual to physical addresses.&lt;/LI-CODE&gt;
&lt;P&gt;If you want to make the resume work, you need to give correct physical address of&amp;nbsp; cpu_resume function.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Zhiming&lt;/P&gt;</description>
    <pubDate>Mon, 26 May 2025 00:55:28 GMT</pubDate>
    <dc:creator>Zhiming_Liu</dc:creator>
    <dc:date>2025-05-26T00:55:28Z</dc:date>
    <item>
      <title>Put the imx8dxl A35 in suspend mode via imx-atf</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/Put-the-imx8dxl-A35-in-suspend-mode-via-imx-atf/m-p/2095176#M28576</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HW: imx8dxl&lt;/P&gt;&lt;P&gt;ATF: imx-atf &amp;lt; lf-6.12.3-1.0.0&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Our requirement is ,&lt;/P&gt;&lt;P&gt;&amp;lt;1&amp;gt;, config the pad as wake up source.&lt;/P&gt;&lt;P&gt;&amp;lt;2&amp;gt;, put the A35 core in suspend mode.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For &amp;lt;1&amp;gt;, we can use the corresponding sc-fw APIs and it seems no issue.&lt;/P&gt;&lt;P&gt;For &amp;lt;2&amp;gt;, there is some issue.&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;We tried to use the some psci call&amp;nbsp;(imx_psci_call(regx0, regx1, .... regx4)) like below to put the A35 in suspend state:&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;power_state&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;psci_make_powerstate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;PSTATE_TYPE_POWERDOWN&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; imx&lt;/SPAN&gt;&lt;SPAN&gt;_psci_call&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;IMX_PSCI_CPU_SUSPEND_AARCH64&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;power_state&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;The reason we used 'PSTATE_TYPE_POWERDOWN" was, I checked the code in "&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;imx_validate_power_state()", it only deals&amp;nbsp;PSTATE_TYPE_POWERDOWN.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;We also added some debug code in&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;imx_domain_suspend() of&amp;nbsp;&lt;SPAN&gt;&amp;lt;plat\imx\imx8dxl\imx8dxl_psci.c&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;Then we found out the below if branch (in&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;imx_domain_suspend()&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;) for setting the suspend did not enter:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;is_local_state_retn&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;target_state&lt;/SPAN&gt;&lt;SPAN&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;pwr_domain_state&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;MPIDR_AFFLVL1&lt;/SPAN&gt;&lt;SPAN&gt;])) {&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please give some comment on this?&lt;/P&gt;&lt;P&gt;What parameters shall we use for the psci call?&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2025 06:03:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/Put-the-imx8dxl-A35-in-suspend-mode-via-imx-atf/m-p/2095176#M28576</guid>
      <dc:creator>hojames2025</dc:creator>
      <dc:date>2025-05-12T06:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: Put the imx8dxl A35 in suspend mode via imx-atf</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/Put-the-imx8dxl-A35-in-suspend-mode-via-imx-atf/m-p/2096807#M28608</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;You are calling imx-atf right? imx_psci_call is a function I can consider as a kind of smc call?For IMX_PSCI_CPU_SUSPEND_AARCH64,&amp;nbsp; what is the definition of this function id?&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Zhiming&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2025 00:44:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/Put-the-imx8dxl-A35-in-suspend-mode-via-imx-atf/m-p/2096807#M28608</guid>
      <dc:creator>Zhiming_Liu</dc:creator>
      <dc:date>2025-05-14T00:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: Put the imx8dxl A35 in suspend mode via imx-atf</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/Put-the-imx8dxl-A35-in-suspend-mode-via-imx-atf/m-p/2096867#M28612</link>
      <description>&lt;P&gt;Hello Zhiming,&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;Yes, we are calling imx-atf services.&lt;BR /&gt;The imx_psci_call()&amp;nbsp;is some&amp;nbsp;kind of smc call.&lt;BR /&gt;prototype: imx_psci_call(regx0, regx1, .... regx4).&lt;/P&gt;&lt;P&gt;For&amp;nbsp;IMX_PSCI_CPU_SUSPEND_AARCH64,&lt;BR /&gt;the value is 0xC4000001 (PSCI_CPU_SUSPEND_AARCH64)&lt;/P&gt;&lt;P&gt;Sorry I did not make it clear,&lt;BR /&gt;all the &lt;SPAN&gt;functions&amp;nbsp;&lt;/SPAN&gt;I am using are from:&lt;BR /&gt;imx-atf\include\lib\psci\psci.h&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2025 02:52:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/Put-the-imx8dxl-A35-in-suspend-mode-via-imx-atf/m-p/2096867#M28612</guid>
      <dc:creator>hojames2025</dc:creator>
      <dc:date>2025-05-14T02:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: Put the imx8dxl A35 in suspend mode via imx-atf</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/Put-the-imx8dxl-A35-in-suspend-mode-via-imx-atf/m-p/2096956#M28613</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/247079"&gt;@hojames2025&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;For the Linux suspend, linux is using&amp;nbsp;&lt;SPAN&gt;PSCI_SYSTEM_SUSPEND_AARCH64 as function id and the imx-atf is optimized for this. The&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;PLAT_MAX_PWR_LVL in&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;psci_system_suspend let the&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;imx_domain_suspend&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;run the third if branch. So if you want to let&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;imx_domain_suspend enter second if branch , you need to check the&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;suspend function and make sure that&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;state is OFF state. The default&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;state is&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;RETENTION state. You could try to modify the&amp;nbsp;plat/imx/imx8dx/include/platform_def.h, define&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;PLAT_MAX_PWR_LVL as&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;MPIDR_AFFLVL1.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Zhiming&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2025 07:54:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/Put-the-imx8dxl-A35-in-suspend-mode-via-imx-atf/m-p/2096956#M28613</guid>
      <dc:creator>Zhiming_Liu</dc:creator>
      <dc:date>2025-05-14T07:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: Put the imx8dxl A35 in suspend mode via imx-atf</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/Put-the-imx8dxl-A35-in-suspend-mode-via-imx-atf/m-p/2103577#M28743</link>
      <description>&lt;P&gt;Hello&amp;nbsp;Zhiming,&lt;/P&gt;&lt;P&gt;Thanks for the information, it's very helpful.&lt;BR /&gt;Now we are using the same function id (PSCI_SYSTEM_SUSPEND_AARCH64),&lt;BR /&gt;We can see it enters expected code branch, and if we active the wakeup source, the wakeup function (imx_domain_suspend_finish()) in imx-atf is called.&lt;/P&gt;&lt;P&gt;But we have another question regarding the &lt;FONT color="#FF0000"&gt;entrypoint&lt;/FONT&gt; parameter (the resume address).&lt;/P&gt;&lt;P&gt;We are making the psci call like below.&lt;BR /&gt;imx_psci_call(PSCI_SYSTEM_SUSPEND_AARCH64, &lt;FONT color="#FF0000"&gt;entrypoint&lt;/FONT&gt;,0,0,0);&lt;/P&gt;&lt;P&gt;How can we set the &lt;FONT color="#FF0000"&gt;entrypoint&lt;/FONT&gt; here ?&lt;BR /&gt;Can we use&amp;nbsp;&amp;nbsp;&lt;FONT color="#FF0000"&gt;__builtin_return_address(0)&lt;/FONT&gt;&amp;nbsp; or a normal function pointer?&lt;BR /&gt;It does not work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is our understanding correct?&lt;BR /&gt;Could you please give some comments or some example code about this?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2025 13:25:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/Put-the-imx8dxl-A35-in-suspend-mode-via-imx-atf/m-p/2103577#M28743</guid>
      <dc:creator>hojames2025</dc:creator>
      <dc:date>2025-05-23T13:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: Put the imx8dxl A35 in suspend mode via imx-atf</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/Put-the-imx8dxl-A35-in-suspend-mode-via-imx-atf/m-p/2103885#M28748</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/247079"&gt;@hojames2025&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;In Linux, the resume address is&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;&lt;SPAN&gt;phys_addr_t&lt;/SPAN&gt;&lt;SPAN&gt; pa_cpu_resume = &lt;/SPAN&gt;&lt;SPAN&gt;__pa_symbol&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;(cpu_resume)&lt;/EM&gt;&lt;/STRONG&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;__pa_symbol&lt;/STRONG&gt; will convert symbolic virtual addresses in kernel code to physical addresses.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;//arch/arm64/include/asm/memory.h
#define __pa_symbol(x)		__phys_addr_symbol(RELOC_HIDE((unsigned long)(x), 0))

#define __phys_addr_symbol(x)	__pa_symbol_nodebug(x)
#define __pa_symbol_nodebug(x)	__kimg_to_phys((phys_addr_t)(x))
#define __kimg_to_phys(addr)	((addr) - kimage_voffset)

kimage_voffset
--------------

The offset between the kernel virtual and physical mappings. Used to
translate virtual to physical addresses.&lt;/LI-CODE&gt;
&lt;P&gt;If you want to make the resume work, you need to give correct physical address of&amp;nbsp; cpu_resume function.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Zhiming&lt;/P&gt;</description>
      <pubDate>Mon, 26 May 2025 00:55:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/Put-the-imx8dxl-A35-in-suspend-mode-via-imx-atf/m-p/2103885#M28748</guid>
      <dc:creator>Zhiming_Liu</dc:creator>
      <dc:date>2025-05-26T00:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: Put the imx8dxl A35 in suspend mode via imx-atf</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/Put-the-imx8dxl-A35-in-suspend-mode-via-imx-atf/m-p/2104008#M28751</link>
      <description>&lt;P&gt;Hello&amp;nbsp;Zhiming,&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;We understood it requires physical address as resume address (the entrypoint parameter).&lt;BR /&gt;Actually, the resume address here is physical address (it's under bare mental, without mmu on).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So,&amp;nbsp;if the resume address has already been physical,&lt;BR /&gt;do we need any other special operation at this resume handler?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;For example, do we need to do EL level change stuff, re-initialize the power mode/clock of the prephreials or someting else?&lt;BR /&gt;(I suppose the imx-atf/scu handles all these before jumping to the resume addr)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We put some very simple code in the resume handler,&lt;BR /&gt;(write strings in the LPUARTz TX buff to observe)&lt;BR /&gt;but it seems it does not jump to this resume address&lt;BR /&gt;(or maybe we need more 'resume operation', the writing to LPUARTx does not work yet, but the jumping works?).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Mon, 26 May 2025 03:30:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/Put-the-imx8dxl-A35-in-suspend-mode-via-imx-atf/m-p/2104008#M28751</guid>
      <dc:creator>hojames2025</dc:creator>
      <dc:date>2025-05-26T03:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: Put the imx8dxl A35 in suspend mode via imx-atf</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/Put-the-imx8dxl-A35-in-suspend-mode-via-imx-atf/m-p/2104143#M28755</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/247079"&gt;@hojames2025&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;All needed operations like&amp;nbsp;&lt;SPAN&gt;restore&lt;/SPAN&gt; clocks,&amp;nbsp;&lt;SPAN&gt;prephreials and GIC are in&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;imx_domain_suspend_finish(&lt;/SPAN&gt;&lt;SPAN&gt;plat/imx/imx8dxl/imx8dxl_psci.c). For the resume address(ep-&amp;gt;pc), the ATF just set it into&amp;nbsp;CTX_ELR_EL3 register. If this address is not correct, the jump is invalid. Please check and verify the address.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Zhiming&lt;/P&gt;</description>
      <pubDate>Mon, 26 May 2025 07:07:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/Put-the-imx8dxl-A35-in-suspend-mode-via-imx-atf/m-p/2104143#M28755</guid>
      <dc:creator>Zhiming_Liu</dc:creator>
      <dc:date>2025-05-26T07:07:51Z</dc:date>
    </item>
  </channel>
</rss>

