[coreboot] [PATCH] wip - suspend/resume for AMD famF revF CPUs (socket AM2)

Rudolf Marek r.marek at assembler.cz
Wed Apr 8 00:51:12 CEST 2009

Hash: SHA1

Hi all,

Here is yet another WIP. I need bit help to solve some issues:

1) include file mess in CAR

In src/southbridge/via/k8t890/k8t890_early_car.c I'm not able to include the nb
header file. There is a NVRAM base with #define. Now I just duplicated the macro.

The reason why it does not go is in the rest of k8t890.h because of prototype
for writeback function. Eventually we might get rid of writeback...

2) src/northbridge/amd/amdk8/exit_from_self.c

I'm not able to do: ctrl[i].f2->path.pci.devfn

Compiler complains dont know why. I solved it like:

ctrl[i].node_id + 0x18) << 3) | 0x2

Not ideal but works

3) I have an idea how to do the realmode memory reservation for coreboot. I
simply made RSDP table much larger (this table stays below 1MB).

during resume I copy there simple trampoline which turns off PE and do the ljmp
to waking vector.
Unfortunately this does not work for some reason. I believe the CS base of GDT
is invalid perhaps I should there base not zero?

The code should execute like this:

set GDT
set LDT
jmp ebx -> to code inside the variable jump_to_wakeup. because I cannot do the
direct ljmp $0x0008,%0 because rsdp space address is run-time.

So inside the jump_to_wakeup I load CS with the new GDT value and jump to the
lowmem where I put the simple code:

 movl  %cr0,%eax
andb  $0xfe,al
movl  %eax,%cr0
jmp far waking vector

It is bit hard to follow but please have a look to a patch.

Here is some real example:

Trying to find the wakeup vector ...

Looking on 000f9560 for valid checksum

Checksum 1 passed

RSDP found at 000f9560

RSDT found at 1bff0424 ends at 1bff0464

FADT found at 1bff0e62

FACS found at 1bff0480

OS waking vector is 0001a000

The RSDP is at 000f9560 spare memory at: 000f9584


ea 0 0 0 1a

ea 84 95 f 0 8 0
(CPU resets here)

As I have written I believe that problem is in selector 0x8 which has base 0 and
limit 64KB perhaps it should have base f0000 to fit the location of the low table?

Hope it is more clear -> I need sleep. Looking forward for suggestions. Oh btw
even without this 3) Windows 7 and Linux S3 mode works (I put the trampoline to
last bytes of first 4KB).


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: s3_stuff_2.patch
Type: text/x-diff
Size: 36702 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20090408/a772bccb/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: s3_stuff_2.patch.sig
Type: application/octet-stream
Size: 72 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20090408/a772bccb/attachment.obj>

More information about the coreboot mailing list