Add support for mainboard specific suspend/resume handler
authorStefan Reinauer <stefan.reinauer@coreboot.org>
Tue, 3 Apr 2012 21:28:22 +0000 (23:28 +0200)
committerStefan Reinauer <stefan.reinauer@coreboot.org>
Wed, 4 Apr 2012 17:10:28 +0000 (19:10 +0200)
Some mainboards (most likely laptops) will need mainboard specific functions
called upon a resume from suspend.

Change-Id: If1518a4b016bba776643adaef0ae64ff49f57e51
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/852
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
src/arch/x86/boot/acpi.c
src/arch/x86/include/arch/acpi.h

index f81127a02fbc540738e06fcf509308044d529597..f17e73e3f677f2e0cfa1726310ae9b5a349cfcce 100644 (file)
@@ -474,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. */
index 504d71b4f587e08565ba35b0d39d3865aa23ab3e..8c521af0b23740edc392efcdb581bfa807abc519 100644 (file)
@@ -417,6 +417,7 @@ void acpi_write_rsdp(acpi_rsdp_t *rsdp, acpi_rsdt_t *rsdt, acpi_xsdt_t *xsdt);
 extern u8 acpi_slp_type;
 
 void suspend_resume(void);
+void __attribute__((weak)) mainboard_suspend_resume(void);
 void *acpi_find_wakeup_vector(void);
 void *acpi_get_wakeup_rsdp(void);
 void acpi_jump_to_wakeup(void *wakeup_addr);