[OLPC-devel] Thoughts on S3 resume.

Ronald G Minnich rminnich at lanl.gov
Thu Jul 27 00:39:00 EDT 2006


Tom had brought up some questions about S3 resume. In S3, memory is on 
but all else is off. The question is how to restart from this.

On ACPI systems, all this stuff is BIOS centric. I don't want to do 
that. ACPI is a very dangerous tool, given the AML interpreter. The 
dangers of ACPI viruses are well known and their use is a matter of time.

How I would want to do S3: make it linux-centric. NO AML interpreter.

To start S3, Linux saves state of universe to ram, Linux saves PCI 
config space to ram. Linux saves whatever it has to save to RAM. Linux 
would do much of what it does now for software suspend to disk, save for 
the 'save ram to disk' step.

Right before entering S3, Linux writes the string: "RESUME S3 
PC=0xDEADBEEF,PTE=00x1004000 S3 RESUME CHECKSUM" to address 0 or 
somewhere in page 0. Or, we could write something like:
(RESUME (STATE S3) (PC 0xdeadbeef) (PTE 0x1001000))CHECKSUM
since that can expand as needed. Either will work: 
comma-seperated-variables with = or s-expressions.

Linux then puts the hardware to S3.

On restart, linuxbios code turns on ram controller so that GX can talk 
to RAM again. LinuxBIOS does other minimal, but required, startup.

Here's where the power of an open source BIOS comes to our aid. We have 
complete control. We can add a step to the very early LinuxBIOS OLPC 
startup code to look for the S3 RESUME string.

Then we add a step to the OLPC ROMCC code. We check for the above string 
in page 0. If found, we copy and then zero out that string (so we don't 
get stuck in a loop), then we do what we need to do to re-enter Linux, 
and then Linux brings the system back up.

I think this S3 resume would be far faster than any resume based on AML 
bytecodes. The LinuxBIOS step would be very fast -- almost 100% of 
linuxbios would be bypassed. Linux could then very quickly bring the 
rest of the system back up.

Comments?

ron



More information about the Devel mailing list