CBMEM ACPI: Move resume handler
Handler is ACPI/x86 specific so move details out of cbmem code. With static CBMEM initialisation, ramstage will need to test for S3 wakeup condition so publish also acpi_is_wakeup(). Change-Id: If591535448cdd24a54262b534c1a828fc13da759 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/4619 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Aaron Durbin <adurbin@google.com>
This commit is contained in:
@@ -42,6 +42,10 @@ void cbmem_arch_init(void)
|
||||
{
|
||||
}
|
||||
|
||||
void cbmem_fail_resume(void)
|
||||
{
|
||||
}
|
||||
|
||||
struct lb_memory *write_tables(void)
|
||||
{
|
||||
unsigned long table_pointer, new_table_pointer;
|
||||
|
@@ -645,12 +645,18 @@ void acpi_resume(void *wake_vec)
|
||||
/* This is to be filled by SB code - startup value what was found. */
|
||||
u8 acpi_slp_type = 0;
|
||||
|
||||
static int acpi_is_wakeup(void)
|
||||
int acpi_is_wakeup(void)
|
||||
{
|
||||
/* Both resume from S2 and resume from S3 restart at CPU reset */
|
||||
return (acpi_slp_type == 3 || acpi_slp_type == 2);
|
||||
}
|
||||
|
||||
void acpi_fail_wakeup(void)
|
||||
{
|
||||
if (acpi_slp_type == 3 || acpi_slp_type == 2)
|
||||
acpi_slp_type = 0;
|
||||
}
|
||||
|
||||
static acpi_rsdp_t *valid_rsdp(acpi_rsdp_t *rsdp)
|
||||
{
|
||||
if (strncmp((char *)rsdp, RSDP_SIG, sizeof(RSDP_SIG) - 1) != 0)
|
||||
|
@@ -17,6 +17,7 @@
|
||||
|
||||
#include <console/console.h>
|
||||
#include <cbmem.h>
|
||||
#include <arch/acpi.h>
|
||||
|
||||
#if !CONFIG_DYNAMIC_CBMEM
|
||||
void get_cbmem_table(uint64_t *base, uint64_t *size)
|
||||
@@ -64,3 +65,17 @@ void *cbmem_top(void)
|
||||
}
|
||||
|
||||
#endif /* DYNAMIC_CBMEM */
|
||||
|
||||
#if !defined(__PRE_RAM__)
|
||||
|
||||
/* ACPI resume needs to be cleared in the fail-to-recover case, but that
|
||||
* condition is only handled during ramstage. */
|
||||
void cbmem_fail_resume(void)
|
||||
{
|
||||
#if CONFIG_HAVE_ACPI_RESUME
|
||||
/* Something went wrong, our high memory area got wiped */
|
||||
acpi_fail_wakeup();
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* !__PRE_RAM__ */
|
||||
|
@@ -558,6 +558,8 @@ void acpi_save_gnvs(u32 gnvs_address);
|
||||
/* 0 = S0, 1 = S1 ...*/
|
||||
extern u8 acpi_slp_type;
|
||||
|
||||
int acpi_is_wakeup(void);
|
||||
void acpi_fail_wakeup(void);
|
||||
void acpi_resume(void *wake_vec);
|
||||
void __attribute__((weak)) mainboard_suspend_resume(void);
|
||||
void *acpi_find_wakeup_vector(void);
|
||||
|
Reference in New Issue
Block a user