mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-10-06 19:40:42 +09:00
3a34cae011
In an S3 resume path, U-Boot does everything like a cold boot except in the last_stage_init() it jumps to the OS resume vector. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Stefan Roese <sr@denx.de>
27 lines
569 B
C
27 lines
569 B
C
/*
|
|
* Copyright (C) 2017, Bin Meng <bmeng.cn@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <asm/acpi_s3.h>
|
|
#include <asm/post.h>
|
|
|
|
static void asmlinkage (*acpi_do_wakeup)(void *vector) = (void *)WAKEUP_BASE;
|
|
|
|
static void acpi_jump_to_wakeup(void *vector)
|
|
{
|
|
/* Copy wakeup trampoline in place */
|
|
memcpy((void *)WAKEUP_BASE, __wakeup, __wakeup_size);
|
|
|
|
printf("Jumping to OS waking vector %p\n", vector);
|
|
acpi_do_wakeup(vector);
|
|
}
|
|
|
|
void acpi_resume(void *wake_vec)
|
|
{
|
|
post_code(POST_OS_RESUME);
|
|
acpi_jump_to_wakeup(wake_vec);
|
|
}
|