board_final_cleanup();
#if CONFIG_HAVE_ACPI_RESUME
- void *wake_vector = acpi_find_wakeup_vector();
+ struct acpi_fadt *fadt = acpi_find_fadt();
- if (wake_vector != NULL && gd->arch.prev_sleep_state == ACPI_S3)
- acpi_resume(wake_vector);
+ if (fadt != NULL && gd->arch.prev_sleep_state == ACPI_S3)
+ acpi_resume(fadt);
#endif
write_tables();
*/
void chipset_clear_sleep_state(void);
+struct acpi_fadt;
/**
* acpi_resume() - Do ACPI S3 resume
*
* This calls U-Boot wake up assembly stub and jumps to OS's wake up vector.
*
- * @wake_vec: OS wake up vector
+ * @fadt: FADT table pointer in the ACPI table
* @return: Never returns
*/
-void acpi_resume(void *wake_vec);
+void acpi_resume(struct acpi_fadt *fadt);
#endif /* __ASSEMBLY__ */
void enter_acpi_mode(int pm1_cnt);
ulong write_acpi_tables(ulong start);
+/**
+ * acpi_find_fadt() - find ACPI FADT table in the sytem memory
+ *
+ * This routine parses the ACPI table to locate the ACPI FADT table.
+ *
+ * @return: a pointer to the ACPI FADT table in the system memory
+ */
+struct acpi_fadt *acpi_find_fadt(void);
+
/**
* acpi_find_wakeup_vector() - find OS installed wake up vector address
*
*
* @return: wake up vector address installed by the OS
*/
-void *acpi_find_wakeup_vector(void);
+void *acpi_find_wakeup_vector(struct acpi_fadt *);
#include <common.h>
#include <asm/acpi_s3.h>
+#include <asm/acpi_table.h>
#include <asm/post.h>
static void asmlinkage (*acpi_do_wakeup)(void *vector) = (void *)WAKEUP_BASE;
acpi_do_wakeup(vector);
}
-void acpi_resume(void *wake_vec)
+void acpi_resume(struct acpi_fadt *fadt)
{
+ void *wake_vec;
+
+ wake_vec = acpi_find_wakeup_vector(fadt);
+
post_code(POST_OS_RESUME);
acpi_jump_to_wakeup(wake_vec);
}
return rsdp;
}
-void *acpi_find_wakeup_vector(void)
+struct acpi_fadt *acpi_find_fadt(void)
{
char *p, *end;
struct acpi_rsdp *rsdp = NULL;
struct acpi_rsdt *rsdt;
struct acpi_fadt *fadt = NULL;
- struct acpi_facs *facs;
- void *wake_vec;
int i;
- debug("Trying to find the wakeup vector...\n");
-
/* Find RSDP */
for (p = (char *)ROM_TABLE_ADDR; p < (char *)ROM_TABLE_END; p += 16) {
rsdp = acpi_valid_rsdp((struct acpi_rsdp *)p);
return NULL;
debug("FADT found at %p\n", fadt);
+ return fadt;
+}
+
+void *acpi_find_wakeup_vector(struct acpi_fadt *fadt)
+{
+ struct acpi_facs *facs;
+ void *wake_vec;
+
+ debug("Trying to find the wakeup vector...\n");
+
facs = (struct acpi_facs *)fadt->firmware_ctrl;
if (facs == NULL) {