Does PSCI work on iMX7D?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Does PSCI work on iMX7D?

986 Views
jaripeltonen
Contributor IV

Hello,

I'm working on a device that has iMX7D on it. I would need to have PSCI integrated for it so that I could get the processor cores to the low power mode.

I would like to know whether iMX7D supports PSCI / whether PSCI has been verified to be working on iMX7D?

If PSCI is supported, which U-Boot and Kernel versions contain PSCI support for iMX7D?

If there are any iMX7 & PSCI specific integration documents or guidelines to share, I would appreciate if you'd share such documents.

Thanks & best regards,

Jari Peltonen

Labels (2)
Tags (2)
0 Kudos
3 Replies

810 Views
jaripeltonen
Contributor IV

Hi,

Thanks for your comments!

I would still like to know whether there's a specific U-Boot and/or Kernel version from which onwards PSCI is supported for iMX7?

I am currently trying to get PSCI functionality working for an iMX7D based device, my U-Boot is based on branch "2018.11+fslc" and Kernel is based on branch "4.19.x+fslc", both are fetched from Freescale Github.

I've done modifications both in U-Boot and Kernel side and I can see PSCI specific messages on the trace log during boot.

When I try to enable "Deep Sleep" (echo mem > /sys/power/state), my SW reports e.g. following;

[ 204.051195] PM: suspend entry (deep)
[ 204.054841] PM: Syncing filesystems ... done.
[ 204.089906] Freezing user space processes ... (elapsed 0.002 seconds) done.
[ 204.099226] OOM killer disabled.
[ 204.102595] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
[ 204.112082] Suspending console(s) (use no_console_suspend to debug)
[ 204.214777] PM: suspend devices took 0.100 seconds
[ 204.231623] Disabling non-boot CPUs ...
[ 204.310491] Retrying again to check for CPU kill
[ 204.310523] CPU1 killed.
[ 204.312275] Enabling non-boot CPUs ...
[ 204.313757] CPU1 is up
[ 204.399057] mmc0: queuing unknown CIS tuple 0x01 (3 bytes)
[ 204.409474] mmc0: queuing unknown CIS tuple 0x1a (5 bytes)
[ 204.414087] mmc0: queuing unknown CIS tuple 0x1b (8 bytes)
[ 204.415025] mmc0: queuing unknown CIS tuple 0x14 (0 bytes)
[ 204.424152] PM: resume devices took 0.100 seconds
[ 204.473425] OOM killer enabled.
[ 204.476602] Restarting tasks ... done.
[ 204.483206] PM: suspend exit

But during the "Deep Sleep" period it still draws a lot of current (29mA).

Another obsevation is that when I enabled PSCI_CHECKER and it is run during boot, it reports;

[ 2.870803] psci_checker: PSCI checker started using 2 CPUs
[ 2.876406] psci_checker: Starting hotplug tests
[ 2.881171] psci_checker: Trying to turn off and on again all CPUs
[ 2.967112] psci_checker: Trying to turn off and on again group 0 (CPUs 0-1)
[ 3.053635] psci_checker: Hotplug tests passed OK
[ 3.058511] psci_checker: Starting suspend tests (10 cycles per state)
[ 3.066328] psci_checker: CPU 0 entering suspend cycles, states 1 through 1
[ 3.066394] psci_checker: CPU 1 entering suspend cycles, states 1 through 1
[ 3.073436] psci_checker: Failed to suspend CPU 0: error -1 (requested state 1, cycle 0)
[ 3.080499] psci_checker: Failed to suspend CPU 1: error -1 (requested state 1, cycle 0)
[ 3.088665] psci_checker: Failed to suspend CPU 0: error -1 (requested state 1, cycle 1)
[ 3.096703] psci_checker: Failed to suspend CPU 1: error -1 (requested state 1, cycle 1)
[ 3.104844] psci_checker: Failed to suspend CPU 0: error -1 (requested state 1, cycle 2)
[ 3.113006] psci_checker: Failed to suspend CPU 1: error -1 (requested state 1, cycle 2)
[ 3.121183] psci_checker: Failed to suspend CPU 0: error -1 (requested state 1, cycle 3)
[ 3.129293] psci_checker: Failed to suspend CPU 1: error -1 (requested state 1, cycle 3)
[ 3.137384] psci_checker: Failed to suspend CPU 0: error -1 (requested state 1, cycle 4)
[ 3.145533] psci_checker: Failed to suspend CPU 1: error -1 (requested state 1, cycle 4)
[ 3.153662] psci_checker: Failed to suspend CPU 0: error -1 (requested state 1, cycle 5)
[ 3.161819] psci_checker: Failed to suspend CPU 1: error -1 (requested state 1, cycle 5)
[ 3.169954] psci_checker: Failed to suspend CPU 0: error -1 (requested state 1, cycle 6)
[ 3.178121] psci_checker: Failed to suspend CPU 1: error -1 (requested state 1, cycle 6)
[ 3.186198] psci_checker: Failed to suspend CPU 0: error -1 (requested state 1, cycle 7)
[ 3.194347] psci_checker: Failed to suspend CPU 1: error -1 (requested state 1, cycle 7)
[ 3.202491] psci_checker: Failed to suspend CPU 0: error -1 (requested state 1, cycle 8)
[ 3.210645] psci_checker: Failed to suspend CPU 1: error -1 (requested state 1, cycle 8)
[ 3.218782] psci_checker: Failed to suspend CPU 0: error -1 (requested state 1, cycle 9)
[ 3.226890] psci_checker: Failed to suspend CPU 1: error -1 (requested state 1, cycle 9)
[ 3.367143] [<c01545ec>] (kthread_stop) from [<c10693d0>] (psci_checker+0x358/0x46c)
[ 3.380593] [<c1069078>] (psci_checker) from [<c0103370>] (do_one_initcall+0x90/0x32c)
[ 3.515784] psci_checker: CPU 0 suspend test results: success 0, shallow states 0, errors 10
[ 3.649465] [<c01545ec>] (kthread_stop) from [<c10693d0>] (psci_checker+0x358/0x46c)
[ 3.662913] [<c1069078>] (psci_checker) from [<c0103370>] (do_one_initcall+0x90/0x32c)
[ 3.798129] psci_checker: CPU 1 suspend test results: success 0, shallow states 0, errors 10
[ 3.806877] psci_checker: 20 error(s) encountered in suspend tests
[ 3.813155] psci_checker: PSCI checker completed

So, both of these examples indicate that something is wrong inmy configuration.

Based on the log messages, are you able to give me any advice on why this happens and where to fix it?

Thanks & best regards,

Jari

0 Kudos

810 Views
jaripeltonen
Contributor IV

Hello,

Sending this new message as I haven't heard from you in a while...

If you have any advice to share or comment regarding this topic, please let me know!

The main questions still remain:

- is PSCI method verified on iMX7?

- is there any document describing the steps needed to implement the PSCI support in an iMX7 based custom project?

Additional questions regarding current consumption optimization;

- is PSCI supposed to do automatically the needed tricks to optimize current consumption when entering Deep Sleep (e.g. turning off PMIC voltage outputs)

- or should I implement a specific power-down entry sequence that turns off the PMIC voltage outputs that are not needed during Deep Sleep?

Best regards,

Jari

0 Kudos

810 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello Jari,

Let me try to clarify MX7 secure versus non-secure boot.

 

We boot the mainline kernel in non-secure mode. In this case it brings up the secondary CPU via PSCI method.

 

In U-boot mainline we have two targets for mx7dsabresd:

mx7dsabresd_defconfig that boots in non-secure mode (used to boot a mainline kernel)

mx7dsabresd_secure_defconfig that boots in secure mode (used to boot a NXP kernel)

Please read this thread:

https://www.mail-archive.com/search?l=linux-kernel@vger.kernel.org&q=subject:%22Re%5C%3A+%5C%5BPATCH...

It shows  patch submission to support mx7d suspend/resume and the discussion as to why the i.MX kernel maintainer preferred the PSCI mechanism.

 

In this thread you can see the related files in arch/arm/mach-imx.

regards

0 Kudos