X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=src%2Farch%2Fx86%2Fboot%2Facpi.c;h=f17e73e3f677f2e0cfa1726310ae9b5a349cfcce;hb=cb91e1525eb0b81f9bc2e24e3404d6a9efc1cce3;hp=caf860e6b6fdb3efea57190396d1485dcf9bbd07;hpb=ba48281faf75858481ed44181d68d5a8597834a4;p=coreboot.git diff --git a/src/arch/x86/boot/acpi.c b/src/arch/x86/boot/acpi.c index caf860e6b..f17e73e3f 100644 --- a/src/arch/x86/boot/acpi.c +++ b/src/arch/x86/boot/acpi.c @@ -31,6 +31,10 @@ #include #include #include +#include +#if CONFIG_COLLECT_TIMESTAMPS +#include +#endif u8 acpi_checksum(u8 *table, u32 length) { @@ -188,8 +192,6 @@ int acpi_create_madt_lapic_nmi(acpi_madt_lapic_nmi_t *lapic_nmi, u8 cpu, void acpi_create_madt(acpi_madt_t *madt) { -#define LOCAL_APIC_ADDR 0xfee00000ULL - acpi_header_t *header = &(madt->header); unsigned long current = (unsigned long)madt + sizeof(acpi_madt_t); @@ -472,8 +474,12 @@ void suspend_resume(void) /* If we happen to be resuming find wakeup vector and jump to OS. */ wake_vec = acpi_find_wakeup_vector(); - if (wake_vec) + if (wake_vec) { + /* Call mainboard resume handler first, if defined. */ + if (mainboard_suspend_resume) + mainboard_suspend_resume(); acpi_jump_to_wakeup(wake_vec); + } } /* This is to be filled by SB code - startup value what was found. */ @@ -481,7 +487,8 @@ u8 acpi_slp_type = 0; static int acpi_is_wakeup(void) { - return (acpi_slp_type == 3); + /* Both resume from S2 and resume from S3 restart at CPU reset */ + return (acpi_slp_type == 3 || acpi_slp_type == 2); } static acpi_rsdp_t *valid_rsdp(acpi_rsdp_t *rsdp) @@ -567,9 +574,11 @@ void *acpi_find_wakeup_vector(void) return wake_vec; } +#if CONFIG_SMP extern char *lowmem_backup; extern char *lowmem_backup_ptr; extern int lowmem_backup_size; +#endif #define WAKEUP_BASE 0x600 @@ -588,16 +597,22 @@ void acpi_jump_to_wakeup(void *vector) return; } +#if CONFIG_SMP // FIXME: This should go into the ACPI backup memory, too. No pork saussages. /* * Just restore the SMP trampoline and continue with wakeup on * assembly level. */ memcpy(lowmem_backup_ptr, lowmem_backup, lowmem_backup_size); +#endif /* Copy wakeup trampoline in place. */ memcpy((void *)WAKEUP_BASE, &__wakeup, (size_t)&__wakeup_size); +#if CONFIG_COLLECT_TIMESTAMPS + timestamp_add_now(TS_ACPI_WAKE_JUMP); +#endif + acpi_do_wakeup((u32)vector, acpi_backup_memory, CONFIG_RAMBASE, HIGH_MEMORY_SAVE); }