[coreboot] [LinuxBIOS] Messing with CAR in a big way / S3 considerations

Rudolf Marek r.marek at assembler.cz
Sat Jan 12 22:39:13 CET 2008

Hash: SHA1

ron minnich wrote:
> Rudolf, many payloads start at 1 MB. I don't think we want to use CAR
> at that low address.

Maybe if you want to have CAR address = RAM address (to copy it to itself)
Just please choose TOPK - CAR_SIZE as it is now.

> What is the reason that we can't put all coreboot
> variables below 1MB?

Yes we can, but some parts are very messy including but not limited to:

1) stack segment for AP cpus, very ugly define, hardwired to 1MB when using
_RAMBASE lower then 1MB

2) Memory is cleared from zero to TOPK, which is bad.

> Just trying to understand s3 :-)

Before suspend phase:
Coreboot boots payload, it boots OS.

Suspend phase:
Linux will put to a ACPI table a waking vector address, and uses the value from
DSDT to write to SB value to activate the S3 sleep.

Resume phase: Coreboot runs as from coldboot except of taking memory from
self-refresh mode. No payload is to be loaded, only it is jumped back to OS.

What it needs:

It just needs not to mess with memory too much. We can reserve a region for
Coreboot say at 1MB-2MB (plus usual reserved regions like 0-4K and 960K-1MB)

I dont want to take all low memory because the entry point is in real mode and
the OS must have some memory bellow 1MB free.

We can put _RAMBASE at 8MB and reserve region from 8MB-9MB but no other memory
that is reserved should not be touched because it contains OS data ;)

(so no memory test for example ;)

There are parts of Coreboot which are messing too much with memory, like I
described in previous mails and this must be fixed. Easiest way how to avoid
non-std solutions and get instantly more memory is to escape to up 1MB of memory
or to any better place ;) I dont think it is wise to have for LB only 0 - 640KB
of RAM with lot of exceptions, lets use one continuous block in "higher" RAM.
ACPI says, reserved blocks can start at 8MB.

Problematic parts:

Secondary.S -  (the trampoline for AP CPUs)

lapic_cpu_init.c -  (it copies the Secondary.S to undefined place in low memory,
and AP cpu stack is handled badly when _RAMBASE is bellow 1MB)

wakeup.c (yeah mine implentation which jumps back to real mode, this must be
fixed, so no data at our reserved region of 0-4KB gets overwritten)

clear_init_ram.c (in AMD CAR)
 it just clears a lot of memory from ZERO instead of _RAMBASE to TOPK

Used CAR "memory/cache" should not be a problem, because it is not written back
to memory in any way.

So to sum it up. If we would isolate Coreboot writes to memory to those regions:




It would be nice, and just _RAMBASE - TOPK region could be reserved in memory
map, because it uses Coreboot when starting after resume. This memory region
could be claimed back to OS via ACPI memory hotplug, which I'm now
investigating. Reserving permanently 1MB of memory when using S3 would be also
possible because Asus BIOS takes 1MB at the end of memory for SMM and suspend too.

I hope it is now clear how it works ;) I just avoided in my experiments all
those stuff because I told linux to use 2MB-1024MB :) (my TOPK is 2048)

But now I really would like to get this solved too, because suspend to RAM now
works which is great leap because with proprietary BIOS I was unable to get it
working :)))


Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


More information about the coreboot mailing list