1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <console/console.h>
7 #include <commonlib/helpers.h>
11 #define WAKEUP_BASE 0x600
13 asmlinkage
void (*acpi_do_wakeup
)(uintptr_t vector
) = (void *)WAKEUP_BASE
;
15 extern unsigned char __wakeup
;
16 extern unsigned int __wakeup_size
;
18 void __noreturn
acpi_resume(void *wake_vec
)
20 /* Call mainboard resume handler first, if defined. */
21 mainboard_suspend_resume();
23 /* Copy wakeup trampoline in place. */
24 memcpy((void *)WAKEUP_BASE
, &__wakeup
, __wakeup_size
);
26 set_boot_successful();
28 timestamp_add_now(TS_ACPI_WAKE_JUMP
);
30 post_code(POSTCODE_OS_RESUME
);
31 acpi_do_wakeup((uintptr_t)wake_vec
);
33 die("Failed the jump to wakeup vector\n");