This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335x board will not suspend

Other Parts Discussed in Thread: AM3352

We have a board design based on the AM3352 which will not attempt Suspend/Resume.

Kernel is from TI Processor SDK 2.0.1

No PMIC

128 MB LPDDR

At this point we are TFTP booting, MLO and u-boot loaded from SPI flash.

sysfs shows NO suspend states supported:

# cat /sys/power/state
[  312.734418] ################## I'm inside state_show() ##################

None of the Suspend states are enabled.

I see that the wakeup M3 processor firmware is being loaded:

[    7.482907]  remoteproc0: wkup_m3 is available
[    7.487444]  remoteproc0: Note: remoteproc is still under development and considered experimental.
[    7.496446]  remoteproc0: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed.
[    7.509990] ################## I'm inside ti_emif_push_sram() ##################
[    7.517631] ### got np_pool okay ###
[    7.521243] ### got pdev okay ###
[    7.524584] ti_emif_sram 4c000000.emif: Unable to get sram pool for ocmcram
[    7.532994] oprofile: using arm/armv7
[    7.537522] ip_tables: (C) 2000-2006 Netfilter Core Team
[    7.543025] Initializing XFRM netlink socket
[    7.547423] NET: Registered protocol family 17
[    7.551937] NET: Registered protocol family 15
[    7.556982] Key type dns_resolver registered
[    7.561737] omap_voltage_late_init: Voltage driver support not added
[    7.569039] ################## I'm inside am33xx_pm_probe() ##################
[    7.576321] ################## I'm inside ti_emif_copy_pm_function_table() ##################
[    7.584935] PM: am33xx_prepare_push_sram_idle: EMIF function copy failed
[    7.592065] ThumbEE CPU extension supported.
[    7.596392] Registering SWP/SWPB emulation handler
[    7.604675] ################## I'm inside am33xx_pm_probe() ##################
[    7.612049] ################## I'm inside ti_emif_copy_pm_function_table() ##################
[    7.620633] PM: am33xx_prepare_push_sram_idle: EMIF function copy failed
[    7.627415]  remoteproc0: powering up wkup_m3
[    7.633433]  remoteproc0: Booting fw image am335x-pm-firmware.elf, size 219803
[    7.641160]  remoteproc0: remote processor wkup_m3 is now up
[    7.641185] wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x191
[    7.654820] omap_rtc 44e3e000.rtc: setting system clock to 2000-01-01 22:24:34 UTC (946765474)
[    7.670077] Freeing unused kernel memory: 244K (c06d3000 - c0710000)
Starting logging: OK
Populating /dev using udev: [    7.795390] udevd[680]: starting version 3.1.5
[    7.819720] random: udevd urandom read with 12 bits of entropy available
[    8.221814] ################## I'm inside am33xx_pm_probe() ##################
[    8.229213] ################## I'm inside ti_emif_copy_pm_function_table() ##################
[    8.237811] PM: am33xx_prepare_push_sram_idle: EMIF function copy failed
done
Initializing random number generator... done.
Starting haveged: OK
Starting network...
Starting nginx...
ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519
Starting sshd: OK
/etc/init.d/S93-am335x-pm-firmware-load: line 4: can't create /sys/devices/ocp.2/44d00000.wkup_m3/firmware/am335x-pm-firmware.bin/loading: nonexistent directory
/etc/init.d/S93-am335x-pm-firmware-load: line 5: can't create /sys/devices/ocp.2/44d00000.wkup_m3/firmware/am335x-pm-firmware.bin/data: nonexistent directory
/etc/init.d/S93-am335x-pm-firmware-load: line 6: can't create /sys/devices/ocp.2/44d00000.wkup_m3/firmware/am335x-pm-firmware.bin/loading: nonexistent directory

Welcome to Our-Board
our-board login: [  246.247103] random: nonblocking pool is initialized

The last lines are from an init script that I believe used to be how the firmware was loaded, or maybe just an alternate way so I'm thinking they can be ignored, but I include them in case I'm mistaken.

I think this is the best clue:

[    7.524584] ti_emif_sram 4c000000.emif: Unable to get sram pool for ocmcram

This results in there not being a memory handle for one of the on chip SRAM memories to be used to store the EMIF settings prior to Suspend/Resume. Because of that it never populates the suspend function ptr table or sets and suspend states as valid (I believe).

I traced a little ways deeper as can be seen by my kernel prints, but I'm hoping someone can point me where to look for the cause of the problem.

It sounds like a device tree problem, but I don't see anything different WRT the emif entity.

BTW I found a patch that I may need to support the LPDDR properly, but I expect that to only come into play once I get it to suspend.

I also see that there is no sram driver listed for our board, whereas there is for the BBB and the EVM boards, where suspend is working.

The compatible type listed in the DT is "mmio-sram", but the only realistic driver match I found is drivers/misc/sram.c, which is not getting compiled in my build.

Thanks for your help,

Paul

  • I got the SRAM driver to load by enabling the additional build flag

    CONFIG_SRAM

    which I thought was a supplanted by
    CONFIG_TI_EMIF_SRAM
    which I had already set.

    Now the supported suspend states are populated and it attempts suspend.

    # cat /sys/power/state
    freeze standby mem

    "freeze" may work, but it gives a write error at the end.
    "standby" seems to work fine.
    "mem" suspends, but will not wake up.

    # echo standby > /sys/power/state
    [ 55.867304] PM: Syncing filesystems ... done.
    [ 55.879341] Freezing user space processes ... (elapsed 0.001 seconds) done.
    [ 55.887566] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
    [ 55.896292] Suspending console(s) (use no_console_suspend to debug)
    [ 55.904128] PM: suspend of devices complete after 0.920 msecs
    [ 55.904682] PM: late suspend of devices complete after 0.537 msecs
    [ 55.905509] PM: noirq suspend of devices complete after 0.806 msecs
    [ 55.905520] PM: Successfully put all powerdomains to target state
    [ 55.905520] PM: Wakeup source UART
    [ 55.920326] PM: noirq resume of devices complete after 14.737 msecs
    [ 55.920859] PM: early resume of devices complete after 0.407 msecs
    [ 55.921589] PM: resume of devices complete after 0.708 msecs
    [ 55.968000] Restarting tasks ... done.

    On the EVM I see "mem" works, but "standby" does not wake up.

    Best Regards,
    Paul
  • Hi,

    This is the PM user guide: processors.wiki.ti.com/.../Linux_Core_Power_Management_User's_Guide_(v4.1)

    I think the main point is that Suspend/Resume requires that both VDD_MPU and VDD_CORE are lowered to 0.95V. In your initial post you mention that you don't have a PMIC, so I don't see how this can be done on your board.
  • Yes lowering VDD_MPU and VDD_CORE cannot be done on our board.
    But I expect that this would mean only that our leakage current will be higher for power domains that are not shut off.
    And we should still be able to get auto clock gating to take effect.

    The kernel traces sound like standby is mostly working.

    Can you tell me what commit ID or tag in git.ti.com/.../ti-linux-kernel corresponds to the kernel in the TI Processor SDK 2.0.1, which is called linux-4.1.13+gitAUTOINC+8dc66170d9-g8dc6617, but that's not exactly a commit ID.

    Best Regards,
    Paul

  • I have asked the factory team to help on this.
  • Hi Paul,

    The kernel git repository, branch and commit id can be found below:
    Based on Version: 4.1.13
    URL: git://git.ti.com/processor-sdk/processor-sdk-linux.git
    Branch: processor-sdk-linux-02.00.01
    Commit ID: 1e47a17a48619ae05e05d5438c33362b741c133f

    You can get more info from the below locations:
    processors.wiki.ti.com/index.php
    ti-processor-sdk-linux-am335x-evm-02.00.01.07/docs/software_manifest.htm

    Let me know if you have other questions regarding power management.

    Regards,
    Pavel
  • Hi Pavel,

    I have Suspend/Resume working now, but I am still trying to understand the TI kernel repositories.

    $ git clone git://git.ti.com/processor-sdk/processor-sdk-linux.git processor-sdk-linux
    $ cd processor-sdk-linux
    $ git checkout remotes/origin/processor-sdk-linux-02.00.01
    $
    $ git log --pretty=oneline -5 --decorate
    8dc66170d9c7e365e723dd3f515f0446b2b9c7bd (HEAD, origin/processor-sdk-linux-02.00.01) ti_config_fragments/connectivity.cfg: enable
    c6be75e88c8ed4f4d84c437a0b1d3bff23c4ecb0 ARM: keystone: dts: add gbe and 10gbe netcp cpts bindings
    daf66906ffe073c9477529de0df777d608460ab4 net: netcp: add support of cpts
    bb4a61a0a01693bd80a9265521046c3466507d3a net: netcp: cpts: introduce keystone netcp cpts software module
    bc96cc3eb6f29a29996a816444d293d6dfff8df6 ARM: dts: k2e: add device binding for crypto accelerator
    $
    $ git show 1e47a17a48619ae05e05d5438c33362b741c133f
    fatal: bad object 1e47a17a48619ae05e05d5438c33362b741c133f

    I am assuming that commit 8dc66170d9c7e36... is equivalent to commit 1e47a17a48619ae0... , but I'd feel better if the published commit was at the top, or at least in the particular SDK branch.

    Best Regards,
    Paul
  • I wasn't able to pull up the web page Yanko mentioned.  However, starting from the Proc SDK 2.00.01 release page, and clicking on the Software Manifest took me here:

    It has the following for "kernel-4.1.13":

    kernel-4.1.13-g8dc6617_4.1.13+git0+8dc66170d9-r22c_am335x_evm.ipk.

    The number I highlighted is the commit ID used in this release, which precisely matches what you showed.

  • Brad,

    Thanks!

    I think I saw the commit ID Pavel mentioned in connection with the TI Processor SDK version 2.0.1, but even I had previously seen the associated kernel referenced as 4.1.13+gitAUTOINC+8dc66170d9-g8dc6617. You have to admit that the amalgamation of text and pieces of hashes is not intuitively obvious. :-)

    Best Regards,
    Paul
  • >>I wasn't able to pull up the web page Yanko mentioned.

    I believe since that is a git page. In the past SDK's (latest ProcSDK1.03) not being very good at git command line, I've usually been able to sync the SDK version with the GIT tag as http

    >>Based on Version: 4.1.13

    So for this example (I think) you see the tag on gitweb at: http://git.ti.com/gitweb/?p=ti-linux-kernel/ti-linux-kernel.git;a=shortlog;h=1f2ce4a2e7aea3a2123b17aff62a80553df31e21 (and from here us non-GIT mortals can peruse files, get a full snapshot, etc)

    And the commit even matches Gitorious (though I have never had luck getting a good commit lost or tree with http in Gitorious)

    https://git.ti.com/ti-linux-kernel/ti-linux-kernel/commit/1f2ce4a

    Usually I can then sync this to the release notes: http://processors.wiki.ti.com/index.php/Processor_SDK_Linux_Kernel_Release_Notes

    But not happening for this version:

    Based on Version: 4.1.18
    URL: git://git.ti.com/processor-sdk/processor-sdk-linux.git
    Branch: processor-sdk-linux-02.00.02
    Commit ID: bbe8cfc1daae684faa5d82c2479fbcf9e9498641

    Maybe the release notes are out of sync?

    Because this tag does show up in gitweb:

    http://git.ti.com/gitweb/?p=ti-linux-kernel/ti-linux-kernel.git;a=shortlog;h=83fdace666f72dbfc4a7681a04e3689b61dae3b9

    and even matched Gitorious

    Did something change going mainline?

  • Joe G. said:
    Based on Version: 4.1.18
    URL: git://git.ti.com/processor-sdk/processor-sdk-linux.git
    Branch: processor-sdk-linux-02.00.02
    Commit ID: bbe8cfc1daae684faa5d82c2479fbcf9e9498641

    I like the cgit interface better for looking at the commit history in a browser:

    http://git.ti.com/cgit/cgit.cgi/processor-sdk/processor-sdk-linux.git/log/?h=processor-sdk-linux-02.00.02

    If you click that first commit you'll see it matches with the commit ID from the release notes which matches the commit ID from the software manifest which matches the commit ID from running "git log" within the SDK itself (ignoring the "unshallow" commit).

    It looks to me like a mistake was made on the Release Notes page for Proc SDK 2.00.01:

    The kernel git repository, branch and commit id can be found below:
    Based on Version: 4.1.13
    URL: git://git.ti.com/processor-sdk/processor-sdk-linux.git
    Branch: processor-sdk-linux-02.00.01
    Commit ID: 1e47a17a48619ae05e05d5438c33362b741c133f

    In particular, that commit ID does not even show up in the tree!  If instead I go to the actual SDK and run "git log" and then ignore the "unshallow" commit I see the top commit is 8dc66170d9c7e365e723dd3f515f0446b2b9c7bd.  That also matches with the Software Manifest: kernel-4.1.13-g8dc6617.  That also matches the top commit here:

    http://git.ti.com/cgit/cgit.cgi/processor-sdk/processor-sdk-linux.git/log/?h=processor-sdk-linux-02.00.01

    So bottom line here is that the release notes were wrong for Proc SDK 2.00.01.  Given that it's already in the "history" I don't think there's anything we need to fix here.

  • Hi Paul,

    I had the same problem with Suspend/Resume, StandBy works fine but when the board enter in deepSleep mode, I am not able to wake it up.

    How did you manage to solve that issue?

    Best Regards,

    Achille

  • Have you rebuilt the M3 firmware using the patch mentioned here:

    processors.wiki.ti.com/.../Debugging_AM335x_Suspend-Resume_Issues

    I've seen many resume issues fixed by that patch. If that does not fix your issue, then you may have a hardware issue.
  • Hi,
    This patch is already in firmware code that i downloaded here git.ti.com/.../ti-v4.1.y. I am using AM437x-sk may be the problem is in dts file.
  • This thread pertains to AM335x. Please start a new thread.