[coreboot] [PATCH] ASUS P2B ACPI sleep preparations
Tobias Diedrich
ranma+coreboot at tdiedrich.de
Mon Nov 29 21:53:48 CET 2010
Stefan Reinauer wrote:
> On 11/28/10 12:36 PM, Uwe Hermann wrote:
> > On Sat, Nov 27, 2010 at 12:02:46PM +0100, Tobias Diedrich wrote:
> >> Index: coreboot-svn-p2b/src/arch/i386/boot/acpi.c
> >> ===================================================================
> >> --- coreboot-svn-p2b.orig/src/arch/i386/boot/acpi.c 2010-11-27 11:48:28.000000000 +0100
> >> +++ coreboot-svn-p2b/src/arch/i386/boot/acpi.c 2010-11-27 11:48:41.000000000 +0100
> >> @@ -481,7 +481,7 @@
> >>
> >> static int acpi_is_wakeup(void)
> >> {
> >> - return (acpi_slp_type == 3);
> >> + return (acpi_slp_type == 3 || acpi_slp_type == 2);
> > Can this have negative effects for other ACPI-enabled chipsets/boards?
>
> Oh yeah this is not good. acpi_slp_type must be 3 for wakeup.
Wakeup can also be from S2 though. I assume the '3' is for S3
wakeup. Both are virtually identical though (acpi 4.0a, 15.1.2+15.1.3):
S2:
The S2 state is defined as a low wake latency sleep state. This
state is similar to the S1 sleeping state where
any context except for system memory may be lost. Additionally,
control starts from the processor’s reset
vector after the wake event.
S3:
The S3 state is defined as a low wake-latency sleep state. From
the software viewpoint, this state is
functionally the same as the S2 state. The operational difference is
that some Power Resources that may
have been left ON in the S2 state may not be available to the S3
state. As such, some devices may be in a
lower power state when the system is in S3 state than when the
system is in the S2 state. Similarly, some
device wake events can function in S2 but not S3.
> >> +#if CONFIG_HAVE_ACPI_RESUME == 1
> >> + reg = (inw(DEFAULT_PMBASE + PMCNTRL) >> 10) & 7;
> >> + switch (reg) {
> >> + case 1:
> >> + acpi_slp_type = 3;
> >> + break;
> >> + case 2:
> >> + case 3:
> >> + acpi_slp_type = 2;
> >> + break;
> >> + default:
> >> + acpi_slp_type = 5;
> >> + break;
> >> + }
> >> + printk(BIOS_INFO,
> >> + "%s: acpi_slp_type=%d!\n", __func__, acpi_slp_type);
> > I'd drop __func__ and make this a bit more userfriendly by wording it
> > something like "ACPI sleep type = %d" or similar.
>
> why do you need 2,3 and 5 for sleep types anyways?
5 is wake from soft-off or hardreset, 0 would be boot due to
soft-reset or hardreset. Wether hardreset looks like wake from
soft-off or looks like soft-reset may depend on hardware, on
i82371eb the PMCNTRL bits are default 0 which is equivalent to wake
from S5.
2 and 3 are because I'd like to pass on wether the wake was from S2
or S3. E.g. on wake from S2 sio init may not be needed since power
was not cut.
--
Tobias PGP: http://8ef7ddba.uguu.de
More information about the coreboot
mailing list