Suspend and resume OFW
The XO Laptop is designed to suspend and resume multiple times a second, to optimize power usage. These are the tests built into Open Firmware, the BIOS used in the XO, to test the basic suspend and resume functionality.
All tests are done at the Open Firmware prompt. This may be obtained by halting the boot operation with the ESC key. All command may be typed either on the keyboard or on a terminal connected to the processor serial port.
These tests start at the most basic, and build up, as needed when first debugging suspend/resume on a laptop. If you are trying to see if suspend/resume works on a laptop, skip right to the random EC wakeup tests, which exercise the system in the worst manner.
 Manual Wakeups
The first test is placing a system in suspend mode, then waking it using a manual interaction.
Enter suspend by typing:
And resume operation by pressing the power button. You should obtain an ok prompt again.
 RTC Wakeups
These are resumes which are triggered in a manner synchronous to the suspend operation. The laptop remains suspended for a small fixed period of time, then is woken up by a real time clock (RTC) timer in the VX855 companion chip. It prints the number of cycles run (in hexadecimal), then immediately suspends again. It may be exited by pressing any key.
Start this test by typing:
 EC Wakeups
These are resumes which are triggered by a system control interrupt (SCI) from the EC to the processor. Two methods are supported, one which is synchronous to MAIN_ON (SUSB#) going low and one which is not.
 Synchronous wakeup
In this test, the laptop is suspended, and is woken a fixed amount of time after MAIN_ON has entered the low state. The wakeup is an SCI from the EC. It prints the number of cycles run (in decimal), then immediately suspends again. It may be exited by pressing any key.
This test expects the stack to contain the requested delay in milliseconds (1 to 32768) Start this test by typing:
For example, to run a 20 ms recurring suspend/wakeup type:
ok d# 20 autowack-test
 Asynchronous wakeup
In this test an EC timer is set and then the laptop is suspended. When the timer expires an SCI from the EC is generated. It prints the number of cycles run (in decimal), reschedules the EC timer immediately suspends again. It may be exited by pressing any key.
This test expects the stack to contain the delay value. It is the number of milliseconds (0 - 2,147,483,648) in the future to issue a wakup after the timer set command is sent. The minimum delay value (0) is roughly 16 mS before the system enters suspend. Due to the fact that the timer is polled the exact wakeup time varies +/- from the set value slightly. This and the fact that the timer is not synced to MAIN_ON means that wakeups will be delivered at variable times around the set delay value.
We recommend a maximum delay value of roughly 20 - 30. Start this test by typing:
For example, to wake up approximately 30 ms in the future from the EC timer, type:
ok d# 30 wackup-test-ec
You can omit the d# command, and instead enter the time in hexadecimal.