mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-18 19:57:31 +00:00
HV: add bsp acpi info support
On some occations HV operates relying on host acpi info, we can use a c file to store this data. The data could be hardcoded or use offline tool that run on target first and then generate the file automatically. Signed-off-by: Victor Sun <victor.sun@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
35f06b8382
commit
88e1c4975c
@ -147,6 +147,7 @@ endif
|
||||
|
||||
C_SRCS += bsp/$(PLATFORM)/vm_description.c
|
||||
C_SRCS += bsp/$(PLATFORM)/$(PLATFORM).c
|
||||
C_SRCS += bsp/$(PLATFORM)/platform_acpi_info.c
|
||||
|
||||
ifeq ($(PLATFORM),uefi)
|
||||
C_SRCS += bsp/$(PLATFORM)/cmdline.c
|
||||
|
22
hypervisor/bsp/sbl/platform_acpi_info.c
Normal file
22
hypervisor/bsp/sbl/platform_acpi_info.c
Normal file
@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Intel Corporation. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <hypervisor.h>
|
||||
|
||||
const struct acpi_info host_acpi_info = {
|
||||
6, /* x86 family: 6 */
|
||||
0x5C, /* x86 model: 0x5C, ApolloLake */
|
||||
{
|
||||
{SPACE_SYSTEM_IO, 20, 0, 3, 0x400}, /* PM1a EVT */
|
||||
{SPACE_SYSTEM_IO, 0, 0, 0, 0}, /* PM1b EVT */
|
||||
{SPACE_SYSTEM_IO, 10, 0, 2, 0x404}, /* PM1a CNT */
|
||||
{SPACE_SYSTEM_IO, 0, 0, 0, 0}, /* PM1b CNT */
|
||||
{0x05, 0, 0}, /* _S3 Package */
|
||||
{0x07, 0, 0}, /* _S5 Package */
|
||||
(uint32_t *)0x7AEDCEFC, /* Wake Vector 32 */
|
||||
(uint64_t *)0x7AEDCF08 /* Wake Vector 64 */
|
||||
}
|
||||
};
|
26
hypervisor/bsp/uefi/platform_acpi_info.c
Normal file
26
hypervisor/bsp/uefi/platform_acpi_info.c
Normal file
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Intel Corporation. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
/* This is a template for uninitialized host_acpi_info,
|
||||
* we should use a user space tool running on target to generate this file.
|
||||
*/
|
||||
|
||||
#include <hypervisor.h>
|
||||
|
||||
const struct acpi_info host_acpi_info = {
|
||||
-1, /* x86 family */
|
||||
-1, /* x86 model */
|
||||
{
|
||||
{SPACE_SYSTEM_IO, 0, 0, 0, 0}, /* PM1a EVT */
|
||||
{SPACE_SYSTEM_IO, 0, 0, 0, 0}, /* PM1b EVT */
|
||||
{SPACE_SYSTEM_IO, 0, 0, 0, 0}, /* PM1a CNT */
|
||||
{SPACE_SYSTEM_IO, 0, 0, 0, 0}, /* PM1b CNT */
|
||||
{0, 0, 0}, /* _S3 Package */
|
||||
{0, 0, 0}, /* _S5 Package */
|
||||
(uint32_t *)0, /* Wake Vector 32 */
|
||||
(uint64_t *)0 /* Wake Vector 64 */
|
||||
}
|
||||
};
|
@ -305,6 +305,30 @@ struct cpu_px_data {
|
||||
uint64_t status; /* success indicator */
|
||||
} __attribute__((aligned(8)));
|
||||
|
||||
struct acpi_sx_pkg {
|
||||
uint8_t val_pm1a;
|
||||
uint8_t val_pm1b;
|
||||
uint16_t reserved;
|
||||
} __attribute__((aligned(8)));
|
||||
|
||||
struct pm_s_state_data {
|
||||
struct acpi_generic_address pm1a_evt;
|
||||
struct acpi_generic_address pm1b_evt;
|
||||
struct acpi_generic_address pm1a_cnt;
|
||||
struct acpi_generic_address pm1b_cnt;
|
||||
struct acpi_sx_pkg s3_pkg;
|
||||
struct acpi_sx_pkg s5_pkg;
|
||||
uint32_t *wake_vector_32;
|
||||
uint64_t *wake_vector_64;
|
||||
}__attribute__((aligned(8)));
|
||||
|
||||
struct acpi_info {
|
||||
int16_t x86_family;
|
||||
int16_t x86_model;
|
||||
struct pm_s_state_data pm_s_state;
|
||||
/* TODO: we can add more acpi info field here if needed. */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Info PM command from DM/VHM.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user