Arm Platforms 16.05 onwards supports System Suspend to RAM.
To test this functionality:
The PL031 RTC can be programmed to generate an interrupt after a set time, which will be used to wake the system from suspend. The PL031 RTC driver is supported in the `latest-armlt' kernel. Note that the kernel will need to be built with the `CONFIG_RTC_DRV_PL031' config flag set, which is already enabled by default in the Arm Reference Platforms deliverables.
`latest-armlt'
`CONFIG_RTC_DRV_PL031'
Linaro OpenEmbedded LAMP 16.04 was used to test this functionality.
First identify the correct RTC `sysfs' interface:
`sysfs'
$ grep /sys/class/rtc/rtc*/name
This should list `pl031' and if found determine whether that corresponds to `rtc0' or `rtc1' etc.
`pl031'
`rtc0'
`rtc1'
Next initiate the suspend and resume sequence:
/* Set the wakeup alarm for 30s */ # echo +30 > /sys/class/rtc/rtc0/wakealarm /* Suspend system to RAM */ # echo -n mem > /sys/power/state
You should see suspend state messages and then no further activity on the console until wakeup. Once the wakeup alarm ticks you will see messages about CPUs being brought back up and the console will start working again.
Note: If you have an Ubuntu or Debian filesystem you can use the `rtcwake' utility to suspend and resume with a single command:
`rtcwake'
# rtcwake -d /dev/rtc0 -s 30 -m mem