2019-03-04 13:34:09 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
*/
|
|
|
|
|
2019-04-30 15:56:58 +08:00
|
|
|
/* this is for direct guest_boot method */
|
2019-03-04 13:34:09 +08:00
|
|
|
|
2019-03-22 03:02:30 +08:00
|
|
|
#include <types.h>
|
|
|
|
#include <e820.h>
|
|
|
|
#include <cpu.h>
|
2019-04-30 13:56:32 +08:00
|
|
|
#include <direct_boot.h>
|
2019-03-04 13:34:09 +08:00
|
|
|
|
2019-11-04 18:09:55 +08:00
|
|
|
/* AP trampoline code buffer base address. */
|
|
|
|
static uint64_t ap_trampoline_buf;
|
|
|
|
|
2019-04-30 15:56:58 +08:00
|
|
|
static void init_direct_boot(void)
|
2019-03-04 13:34:09 +08:00
|
|
|
{
|
2019-11-04 18:09:55 +08:00
|
|
|
ap_trampoline_buf = e820_alloc_low_memory(CONFIG_LOW_RAM_SIZE);
|
2019-03-04 13:34:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* @post: return != 0UL */
|
2019-04-30 15:56:58 +08:00
|
|
|
static uint64_t get_direct_boot_ap_trampoline(void)
|
2019-03-04 13:34:09 +08:00
|
|
|
{
|
2019-11-04 18:09:55 +08:00
|
|
|
return ap_trampoline_buf;
|
2019-03-04 13:34:09 +08:00
|
|
|
}
|
|
|
|
|
2019-04-30 15:56:58 +08:00
|
|
|
static void* get_direct_boot_rsdp(void)
|
2019-03-04 13:34:09 +08:00
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2019-04-30 15:56:58 +08:00
|
|
|
static void init_direct_boot_irq(void)
|
2019-03-04 13:34:09 +08:00
|
|
|
{
|
|
|
|
CPU_IRQ_ENABLE();
|
|
|
|
}
|
|
|
|
|
2019-04-30 15:56:58 +08:00
|
|
|
static struct vboot_operations direct_boot_ops = {
|
|
|
|
.init = init_direct_boot,
|
|
|
|
.get_ap_trampoline = get_direct_boot_ap_trampoline,
|
|
|
|
.get_rsdp = get_direct_boot_rsdp,
|
|
|
|
.init_irq = init_direct_boot_irq,
|
2019-03-04 13:34:09 +08:00
|
|
|
};
|
|
|
|
|
2019-04-30 15:56:58 +08:00
|
|
|
struct vboot_operations* get_direct_boot_ops(void)
|
2019-03-04 13:34:09 +08:00
|
|
|
{
|
2019-04-30 15:56:58 +08:00
|
|
|
return &direct_boot_ops;
|
2019-03-04 13:34:09 +08:00
|
|
|
}
|