Suspend / Resume on the imx6sl-evk?

cancel
Showing results for 
Search instead for 
Did you mean: 

Suspend / Resume on the imx6sl-evk?

1,728 Views
Contributor II

I am attempting to use suspend / resume on the imx6sl-evk.  Thus far, I am able to get it to enter suspend using the Freescale imx-linux  kernel and using pm-suspend or 'echo mem > /sys/power/state'.  However, I am completely unable to resume.  I have attempted to use the UART as a wakeup source via 'echo enabled > /sys/class/tty/ttymxc0/power/wakeup' (and a few of the other various paths that seem to lead to the same place as far as I am able to ascertain), however the device does not resume on wakeup.  I've also tried adding the following patch:

 

[PATCHv4 2/2] ARM: imx: Add wake functionality to GPIO | Linux | Kernel

 

Adding the GPIOs for the buttons on the top of the board does not appear to work (though adding some debug prints showed that it IS registering them, and I can no longer echo them to /sys/class/gpio/export, as they're in use.)

 

I haven't had a chance to test with anything else yet, but has anyone else had any success at all with resuming from suspend on the imx6sl, specifically the eval board?

 

For reference, find attached my .config, strace of pm-suspend and PM_DEBUG=true of pm-suspend

Original Attachment has been moved to: imx-linux-config.zip

Original Attachment has been moved to: strace-pm-suspend.txt.zip

Original Attachment has been moved to: pm-suspend-debug.txt.zip

Labels (3)
0 Kudos
6 Replies

107 Views
NXP TechSupport
NXP TechSupport

Hi trycatch,

to enter different system level low power modes:

echo mem > /sys/power/state

echo standby > /sys/power/state

To wake up system from low power modes:

enable wake up source first, USB device, debug uart or RTC etc.

can be used as wakeup source, below is the example of uart wakeup and rtc wakeup:

echo enabled > /sys/devices/platform/imx-uart.'x'/tty/ttymxc'x'/power/wakeup; Here 'x' is

your debug uart's index;

echo +x > /sys/class/rtc/rtc0/wakealarm; RTC will wake up system after x seconds.

To test this mode automatically, please refer to unit tests (imx-test package in ltib)

script in /unit_tests/suspend_auto.sh

Best regards

chip

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos

107 Views
Contributor II

Hi igorpadykov

I should have specified, I've tried both methods, 'pm-suspend' and just echoing the different power modes (mem / standby) to /sys/power/state.  I get the same results both ways.

I don't have '/sys/devices/platform/imx-uart.'x'/tty/ttymxc'x'/power/wakeup', the full path to my uart tty is '/sys/devices/soc0/soc.0/2000000.aips-bus/2000000.spba-bus/2020000.serial/tty/ttymxc0'.  Using that path instead of the symlinked path '/sys/class/tty/ttymxc0/power/wakeup' doesn't produce any different results, unfortunately.

Using the rtc wakealarm does not seem to be able to bring the device back either.  I'm not sure why this isn't working as I've enabled suspend capability in my kernel config.  Thoughts / suggestions?

0 Kudos

107 Views
NXP TechSupport
NXP TechSupport

Hi trycatch,

I would suggest try latest kernel and

imx-test package (rtcwakeup.c, autorun-rtc.sh)

L3.10.17_1.0.0_IMX6QDLS_BUNDLE

Best regards

chip

0 Kudos

107 Views
Contributor II

Extracting the unit tests out and running it on my image:

# ./rtcwakeup.out -v -d rtc0 -m mem -s 20

offset  = -86400

systime = Wed May 28 21:23:59 2014

rtctime = Wed May 28 21:23:59 2014

alarm 0, sys_time 1401312239, rtc_time 1401398639, seconds 20

rtcwakeup.out: wakeup from "mem" using rtc0 at Thu May 29 21:24:20 2014


The board never wakes up.

# ./autorun-rtc.sh

IMX6

Checking for devnode: /dev/rtc0

autorun-rtc.sh: PASS devnode found: /dev/rtc0

Running test case: ./rtctest.out --no-periodic

     RTC Driver Test Example.

Counting 5 update (1/sec) interrupts from reading /dev/rtc0:

It appears to hang here.  It would appear something is wrong with rtc0?  I based my build off of the defconfig, so I'm not sure why this would be a problem...


Before manually setting the rtc wakeup time:


# cat /proc/driver/rtc

rtc_time : 00:02:25

rtc_date : 1970-01-01

alrm_time  : 00:00:00

alrm_date  : 1970-01-01

alarm_IRQ  : no

alrm_pending : no

update IRQ enabled : no

periodic IRQ enabled   : no

periodic IRQ frequency : 1

max user IRQ frequency : 64

24hr  : yes

I've discovered the hwclock is not being maintained across reboots, for some reason.  I set the sys time to the hwclock:

# hwclock --systohc

# hwclock

Wed May 28 21:40:33 2014  -0.737537 seconds

Then check the driver again:

# cat /proc/driver/rtc

rtc_time : 21:40:45

rtc_date : 2014-05-28

alrm_time  : 00:00:00

alrm_date  : 1970-01-01

alarm_IRQ  : no

alrm_pending : no

update IRQ enabled : no

periodic IRQ enabled   : no

periodic IRQ frequency : 1

max user IRQ frequency : 64

24hr  : yes

Then set a wakeup time again:

# echo +30 > /sys/class/rtc/rtc0/wakealar

# cat /proc/driver/rtc

rtc_time : 21:49:09

rtc_date : 2014-05-28

alrm_time  : 21:49:20

alrm_date  : 2014-05-28

alarm_IRQ  : yes

alrm_pending : no

update IRQ enabled : no

periodic IRQ enabled   : no

periodic IRQ frequency : 1

max user IRQ frequency : 64

24hr  : yes

Put the device to sleep, and it never comes back...  thoughts?



0 Kudos

107 Views
NXP TechSupport
NXP TechSupport

Hi trycatch,

please try precompiled ready Demo images

L3.10.17_1.0.0_IMX6SL_BUNDLE : Source Code Download Steps Documentation and Demo Images.

Regarding RTC, please look at Table 8 "Known Issues and Workarounds for i.MX 6SoloLite EVK"

i.MX_6SoloLite_EVK_Linux_Release_Notes.pdf included to that package.

Best regards

chip

0 Kudos

107 Views
Contributor II

Hi chipexpert,

When I attempt to boot the imx kernel images listed there:

U-Boot 2013.04 (Apr 05 2014 - 09:15:24)

CPU:   Freescale i.MX6SL rev1.0 at 396 MHz

CPU:   Temperature 24 C, calibration data: 0x5ba52f5f

Reset cause: POR

Board: MX6SLEVK

I2C:   ready

DRAM:  1 GiB

MMC:   FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2

*** Warning - bad CRC, using default environment

In:    serial

Out:   serial

Err:   serial

Found PFUZE100! deviceid=10,revid=11

mmc1 is current device

Net:   FEC [PRIME]

Warning: FEC using MAC address from net device

Normal Boot

Hit any key to stop autoboot:  0

mmc1 is current device

mmc1 is current device

reading boot.scr

** Unable to read file boot.scr **

reading uImage

5260936 bytes read in 263 ms (19.1 MiB/s)

Booting from mmc ...

reading imx6sl-evk.dtb

19834 bytes read in 22 ms (879.9 KiB/s)

## Booting kernel from Legacy Image at 80800000 ...

   Image Name:   Linux-3.10.17-1.0.0_ga+g232293e

   Image Type:   ARM Linux Kernel Image (uncompressed)

   Data Size:    5260872 Bytes = 5 MiB

   Load Address: 10008000

   Entry Point:  10008000

   Verifying Checksum ... OK

## Flattened Device Tree blob at 83000000

   Booting using the fdt blob at 0x83000000

   Loading Kernel Image ... data abort

    MAYBE you should read doc/README.arm-unaligned-accesses

pc : [<bff93a68>]          lr : [<bff70f2c>]

sp : bfc6b9d0  ip : 00000000     fp : 00000000

r10: 80d04688  r9 : 00000000     r8 : bfc6bf38

r7 : 80800000  r6 : 00000000     r5 : bfc6ba14  r4 : 10008000

r3 : 00000000  r2 : 00504648     r1 : 80800040  r0 : 10008000

Flags: Nzcv  IRQs off  FIQs off  Mode SVC_32

Resetting CPU ...

resetting ...

0 Kudos