Cannot wakeup from standby

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

astahl
Posts: 3
Joined: Mon Apr 30, 2018 3:13 pm

Cannot wakeup from standby

Wed May 02, 2018 2:04 pm

Hi!

We've a custom board which runs the following versions:
- at91bootstrap 3.8.8
- u-boot 2017.03
- Linux 4.4.57

I've made some adjustments according to our hardware, but nothing related to power management or clock generation. I've configured some IOs as wakeup source.
When I issue "echo mem > /sys/power/standby" the system goes to sleep and the power consumption drops. However, I cannot wake up the system. Power consumption increases a bit but the system hangs and needs a reset.

When I downgrade to at91bootstrap 3.7.2 and u-boot 2015.01 everything works just fine. With at91bootstrap 3.8.8 and u-boot 2015.01, same failure as above. So I think at91bootstrap 3.8.8 is configuring something that prevents the system from correct wakeup.

I have "printk-ed" the registers from PMC (which I think they are relevant) in function at91_pm_suspend(...) but I can't see any difference between booting with 3.8.8 versus 3.7.2.
However I could track don the problem (by bit-banging an IO) to the function at91_pm_suspend_in_sram(...) in file pm_suspend.S. The system hangs when restoring the saved_mckr (i.e. switching the master clock back to PLLA).

Any solutions to this or any ideas what to check next?
blue_z
Location: USA
Posts: 1703
Joined: Thu Apr 19, 2007 10:15 pm

Re: Cannot wakeup from standby

Thu May 03, 2018 11:01 pm

astahl wrote:We've a custom board which runs the following versions:
- at91bootstrap 3.8.8
- u-boot 2017.03
- Linux 4.4.57
Since you're posting here and using AT91Bootstrap, presumably your board has a Microchip/Atmel SoC?
Care to reveal which one?

astahl wrote:When I downgrade to at91bootstrap 3.7.2 and u-boot 2015.01 everything works just fine. With at91bootstrap 3.8.8 and u-boot 2015.01, same failure as above. So I think at91bootstrap 3.8.8 is configuring something that prevents the system from correct wakeup.
For completeness you need to test the AT91Bootstrap 3.7.2 and U-Boot 2017.03 combination.

Why did you choose those specific versions?

Regards
astahl
Posts: 3
Joined: Mon Apr 30, 2018 3:13 pm

Re: Cannot wakeup from standby

Fri May 04, 2018 12:12 pm

blue_z wrote:Since you're posting here and using AT91Bootstrap, presumably your board has a Microchip/Atmel SoC?
Care to reveal which one?
Of course you need to know this, sorry. It is a SAMA5D31A-CU.
blue_z wrote:For completeness you need to test the AT91Bootstrap 3.7.2 and U-Boot 2017.03 combination.
I had an AT91Bootstrap 3.7.2 binary available, but this only reads 512kB from flash when loading u-boot (my u-boot 2017-03 binary is slightly larger).
But for completeness I just compiled AT91Bootstrap 3.7.2 with a larger CONFIG_IMG_SIZE and tested it with U-Boot 2017.03. With this combination wakeup works just fine
blue_z wrote:Why did you choose those specific versions?
If I remember correctly, linux4sam_4.7 was the latest version as I started development for this board. Last year I moved to linux4sam_5.5. (for DRM support and better power management ) From there I've moved on to the mentioned version (maybe to go on with the latest available versions)

Regards
blue_z
Location: USA
Posts: 1703
Joined: Thu Apr 19, 2007 10:15 pm

Re: Cannot wakeup from standby

Fri May 04, 2018 11:41 pm

astahl wrote:From there I've moved on to the mentioned version (maybe to go on with the latest available versions)
The latest available version of AT91Bootstrap is now 3.8.10 as of 21 March 2018. You could test that release version or a git pull in case a fix has already been applied.

You could try to find the commit that broke the code.
There have been 8 releases (excluding alpha and release candidates) between the "good" 3.7.2 and the "broken" 3.8.8 at https://github.com/linux4sam/at91bootstrap/releases.
Use a binary search to select and test to find the earliest release that is broken. Then do a full source-code compare with the preceding "good" version, i.e.

Code: Select all

diff -pruN at91bootstrap.good at91bootstrap.bad > patch
(Be sure to first 'make distclean' in each source-code directory.)
Review the patch file for possible candidate files, and then inspect the file history at the github for the specific commit(s).

Regards
astahl
Posts: 3
Joined: Mon Apr 30, 2018 3:13 pm

Re: Cannot wakeup from standby

Fri May 18, 2018 9:20 am

Problem solved.

There was a change in DRAM initialisation between 3.8.6 and 3.8.7 which I did not took into account in my board setup code.

Thanks for your advice!

Return to “LINUX”

Who is online

Users browsing this forum: No registered users and 1 guest