[coreboot] ACPI S3

Jordan Crouse jordan at cosmicpenguin.net
Wed Nov 12 23:03:36 CET 2008

Marc Jones wrote:
> ----- Original Message ----
>> From: Rudolf Marek <r.marek at assembler.cz>
>> To: "Feng, Libo" <Libo.Feng at amd.com>
>> Cc: coreboot at coreboot.org
>> Sent: Wednesday, November 12, 2008 1:38:39 PM
>> Subject: Re: [coreboot] ACPI S3
>> Feng, Libo napsal(a):
>>> Hi, all,
>>> I am trying to implement the ACPI S3 on coreboot. I have some questions:
>> Hi, I have posted some experimental version year ago. It is quite tricky to get 
>> it working correctly because coreboot overwrittes lot of memory.
>> Here is the patch:
>> http://www.coreboot.org/pipermail/coreboot/2008-January/028787.html
>> Worked for K8T890 and K8 DDR revE
>> Here is described in the steps what needs to be done:
>> http://www.coreboot.org/pipermail/coreboot/2008-September/038539.html
>>> 1. Where is the proper place to check the sleep type in the power register? 
>> Now I check it just prior to disabling the cache as RAM, for not ruining the 
>> RAM.
>> Problem is that you need to setup again some devices which are not setup by OS. 
>> Like memory controller DDR and chipset low level stuff.
>> ACPI allows to wakeup in state like fresh boot, therefore I just let coreboot 
>> run again and then jump not to payload but to previously saved waking vector.
>> Problem only is not to overwrite the memory. I solved that by instructing the 
>> kernel not to use the low memory at all. Except one page for the trampoline code 
>> from your mail.
> Did you do that with e820 ( via the coreboot table)? I think you could reserve the stack area with E820. That would at least give back some of the memory.

That is a good idea.  There might also be some ACPI rules about where 
the stack can be on a resuming BIOS - I'm not sure what traditional 
BIOSes do for that.  The only other x86 firmware I'm aware of is OFW on 
the OLPC, and he manages to make it through the entire resume with just 
registers.  Hopefully we don't need too much stack - the quicker we can 
resume (and the fewer functions we have to call) the happier we will be.

>>> 2. How to jump into the wakeup_start in x86_64/kernel/acpi/wakeup.S? The code 
>> is in real mode, how does coreboot jump from the protected mode to the entry? In 
>> my case, the wakeup_start points to the physical address 0x2000, from there some 
>> real mode code reside. How to jump to the code. 
>> There is reset vector in some DSDT table. Check mine original patch.
> The real vm86 think code in either real_mode_switch_call_* should be a good example.

The jump back to the OS should be as generic as possible, since every 
platform will eventually need it.


More information about the coreboot mailing list