Add BhyvePkg, to support the bhyve hypervisor
BhyvePkg supports the bhyve hypervisor, which is a hypervisor/virtual machine manager available on FreeBSD, macOS and Illumos. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Message-Id: <20200713054131.479627-2-rebecca@bsdio.com> Acked-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
137c2c6eff
commit
656419f922
39
OvmfPkg/Bhyve/AcpiTables/AcpiTables.inf
Normal file
39
OvmfPkg/Bhyve/AcpiTables/AcpiTables.inf
Normal file
@@ -0,0 +1,39 @@
|
||||
## @file
|
||||
# Component description file for PlatformAcpiTables module.
|
||||
#
|
||||
# ACPI table data and ASL sources required to boot the platform.
|
||||
#
|
||||
# Copyright (c) 2020, Rebecca Cran <rebecca@bsdio.com>
|
||||
# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2014, Pluribus Networks, Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#
|
||||
##
|
||||
|
||||
[Defines]
|
||||
INF_VERSION = 0x00010005
|
||||
BASE_NAME = PlatformAcpiTables
|
||||
FILE_GUID = 7E374E25-8E01-4FEE-87F2-390C23C606CD
|
||||
MODULE_TYPE = USER_DEFINED
|
||||
VERSION_STRING = 1.0
|
||||
|
||||
#
|
||||
# The following information is for reference only and not required by the build tools.
|
||||
#
|
||||
# VALID_ARCHITECTURES = IA32 X64 EBC
|
||||
#
|
||||
|
||||
[Sources]
|
||||
Platform.h
|
||||
Madt.aslc
|
||||
Facp.aslc
|
||||
Facs.aslc
|
||||
Dsdt.asl
|
||||
Hpet.aslc
|
||||
Spcr.aslc
|
||||
Mcfg.aslc
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
|
1140
OvmfPkg/Bhyve/AcpiTables/Dsdt.asl
Normal file
1140
OvmfPkg/Bhyve/AcpiTables/Dsdt.asl
Normal file
File diff suppressed because it is too large
Load Diff
76
OvmfPkg/Bhyve/AcpiTables/Facp.aslc
Normal file
76
OvmfPkg/Bhyve/AcpiTables/Facp.aslc
Normal file
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Copyright (c) 2020, Rebecca Cran <rebecca@bsdio.com>
|
||||
* Copyright (c) 2014, Pluribus Networks, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
*/
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
#define EFI_ACPI_OEM_TABLE_ID SIGNATURE_64('B','V','F','A','C','P',' ',' ')
|
||||
|
||||
EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE FACP = {
|
||||
{
|
||||
EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,
|
||||
sizeof (EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE),
|
||||
EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION,
|
||||
0, // to make sum of entire table == 0
|
||||
{EFI_ACPI_OEM_ID}, // OEMID is a 6 bytes long field
|
||||
EFI_ACPI_OEM_TABLE_ID, // OEM table identification(8 bytes long)
|
||||
EFI_ACPI_OEM_REVISION, // OEM revision number
|
||||
EFI_ACPI_CREATOR_ID, // ASL compiler vendor ID
|
||||
EFI_ACPI_CREATOR_REVISION // ASL compiler revision number
|
||||
},
|
||||
0, // Physical addesss of FACS
|
||||
0, // Physical address of DSDT
|
||||
INT_MODEL, // System Interrupt Model
|
||||
RESERVED, // reserved
|
||||
SCI_INT_VECTOR, // System vector of SCI interrupt
|
||||
SMI_CMD_IO_PORT, // Port address of SMI command port
|
||||
ACPI_ENABLE, // value to write to port smi_cmd to enable ACPI
|
||||
ACPI_DISABLE, // value to write to port smi_cmd to disable ACPI
|
||||
S4BIOS_REQ, // Value to write to SMI CMD port to enter the S4BIOS state
|
||||
0, // PState control
|
||||
PM1a_EVT_BLK, // Port address of Power Mgt 1a Event Reg Blk
|
||||
PM1b_EVT_BLK, // Port address of Power Mgt 1b Event Reg Blk
|
||||
PM1a_CNT_BLK, // Port address of Power Mgt 1a Ctrl Reg Blk
|
||||
PM1b_CNT_BLK, // Port address of Power Mgt 1b Ctrl Reg Blk
|
||||
PM2_CNT_BLK, // Port address of Power Mgt 2 Ctrl Reg Blk
|
||||
PM_TMR_BLK, // Port address of Power Mgt Timer Ctrl Reg Blk
|
||||
GPE0_BLK, // Port addr of General Purpose Event 0 Reg Blk
|
||||
GPE1_BLK, // Port addr of General Purpose Event 1 Reg Blk
|
||||
PM1_EVT_LEN, // Byte Length of ports at pm1X_evt_blk
|
||||
PM1_CNT_LEN, // Byte Length of ports at pm1X_cnt_blk
|
||||
PM2_CNT_LEN, // Byte Length of ports at pm2_cnt_blk
|
||||
PM_TM_LEN, // Byte Length of ports at pm_tm_blk
|
||||
GPE0_BLK_LEN, // Byte Length of ports at gpe0_blk
|
||||
GPE1_BLK_LEN, // Byte Length of ports at gpe1_blk
|
||||
GPE1_BASE, // offset in gpe model where gpe1 events start
|
||||
0, // _CST support
|
||||
P_LVL2_LAT, // worst case HW latency to enter/exit C2 state
|
||||
P_LVL3_LAT, // worst case HW latency to enter/exit C3 state
|
||||
FLUSH_SIZE, // Size of area read to flush caches
|
||||
FLUSH_STRIDE, // Stride used in flushing caches
|
||||
DUTY_OFFSET, // bit location of duty cycle field in p_cnt reg
|
||||
DUTY_WIDTH, // bit width of duty cycle field in p_cnt reg
|
||||
DAY_ALRM, // index to day-of-month alarm in RTC CMOS RAM
|
||||
MON_ALRM, // index to month-of-year alarm in RTC CMOS RAM
|
||||
CENTURY, // index to century in RTC CMOS RAM
|
||||
IAPC_BOOT_ARCH, // Boot architecture flag
|
||||
RESERVED, // reserved
|
||||
FACP_FLAGS,
|
||||
FACP_RESET_REG,
|
||||
FACP_RESET_VAL,
|
||||
};
|
||||
|
||||
VOID*
|
||||
ReferenceAcpiTable (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
//
|
||||
// Reference the table being generated to prevent the optimizer from removing the
|
||||
// data structure from the exeutable
|
||||
//
|
||||
return (VOID*)&FACP;
|
||||
}
|
80
OvmfPkg/Bhyve/AcpiTables/Facs.aslc
Normal file
80
OvmfPkg/Bhyve/AcpiTables/Facs.aslc
Normal file
@@ -0,0 +1,80 @@
|
||||
/** @file
|
||||
FACS Table
|
||||
|
||||
Copyright (c) 2020, Rebecca Cran <rebecca@bsdio.com>
|
||||
Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#include <IndustryStandard/Acpi.h>
|
||||
|
||||
EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE FACS = {
|
||||
EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE,
|
||||
sizeof (EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE),
|
||||
|
||||
//
|
||||
// Hardware Signature will be updated at runtime
|
||||
//
|
||||
0x00000000,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
{
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
EFI_ACPI_RESERVED_BYTE
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
VOID*
|
||||
ReferenceAcpiTable (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
//
|
||||
// Reference the table being generated to prevent the optimizer from removing the
|
||||
// data structure from the exeutable
|
||||
//
|
||||
return (VOID*)&FACS;
|
||||
}
|
||||
|
72
OvmfPkg/Bhyve/AcpiTables/Hpet.aslc
Normal file
72
OvmfPkg/Bhyve/AcpiTables/Hpet.aslc
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* Copyright (c) 2020, Rebecca Cran <rebecca@bsdio.com>
|
||||
* Copyright (c) 2014, Pluribus Networks, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
*/
|
||||
|
||||
#include <IndustryStandard/HighPrecisionEventTimerTable.h>
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
#define EFI_ACPI_HPET_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('H', 'P', 'E', 'T')
|
||||
#define EFI_ACPI_OEM_TABLE_ID SIGNATURE_64('B','V','H','P','E','T',' ',' ')
|
||||
|
||||
//
|
||||
// Ensure proper structure formats
|
||||
//
|
||||
#pragma pack (1)
|
||||
|
||||
//
|
||||
// ACPI HPET structure
|
||||
//
|
||||
typedef struct {
|
||||
EFI_ACPI_HIGH_PRECISION_EVENT_TIMER_TABLE_HEADER Header;
|
||||
} EFI_ACPI_HIGH_PRECISION_EVENT_TIMER_DESCRIPTION_TABLE;
|
||||
|
||||
#pragma pack ()
|
||||
|
||||
//
|
||||
// HPET Description Table
|
||||
//
|
||||
EFI_ACPI_HIGH_PRECISION_EVENT_TIMER_DESCRIPTION_TABLE Hpet = {
|
||||
{
|
||||
{
|
||||
EFI_ACPI_HPET_DESCRIPTION_TABLE_SIGNATURE,
|
||||
sizeof (EFI_ACPI_HIGH_PRECISION_EVENT_TIMER_DESCRIPTION_TABLE),
|
||||
EFI_ACPI_HIGH_PRECISION_EVENT_TIMER_TABLE_REVISION,
|
||||
0x00, // Checksum will be updated at runtime
|
||||
{EFI_ACPI_OEM_ID},
|
||||
EFI_ACPI_OEM_TABLE_ID,
|
||||
EFI_ACPI_OEM_REVISION,
|
||||
EFI_ACPI_CREATOR_ID,
|
||||
EFI_ACPI_CREATOR_REVISION
|
||||
},
|
||||
|
||||
//
|
||||
// HPET specific fields
|
||||
//
|
||||
0x0000A400, // EventTimerBlockId
|
||||
{
|
||||
EFI_ACPI_2_0_SYSTEM_MEMORY,
|
||||
0,
|
||||
0,
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
0xFED00000,
|
||||
},
|
||||
0 // HpetNumber
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
VOID*
|
||||
ReferenceAcpiTable (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
//
|
||||
// Reference the table being generated to prevent the optimizer from removing the
|
||||
// data structure from the exeutable
|
||||
//
|
||||
return (VOID*)&Hpet;
|
||||
}
|
145
OvmfPkg/Bhyve/AcpiTables/Madt.aslc
Normal file
145
OvmfPkg/Bhyve/AcpiTables/Madt.aslc
Normal file
@@ -0,0 +1,145 @@
|
||||
/** @file
|
||||
MADT Table
|
||||
|
||||
This file contains a structure definition for the ACPI 1.0 Multiple APIC
|
||||
Description Table (MADT).
|
||||
|
||||
Copyright (c) 2020, Rebecca Cran <rebecca@bsdio.com>
|
||||
Copyright (c) 2014, Pluribus Networks, Inc.
|
||||
Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#include <IndustryStandard/Acpi.h>
|
||||
#include <Platform.h>
|
||||
|
||||
#define EFI_ACPI_OEM_TABLE_ID SIGNATURE_64('B','V','M','A','D','T',' ',' ')
|
||||
|
||||
//
|
||||
// Local APIC address
|
||||
//
|
||||
#define EFI_ACPI_LOCAL_APIC_ADDRESS 0xFEE00000
|
||||
|
||||
//
|
||||
// Multiple APIC Flags are defined in AcpiX.0.h
|
||||
//
|
||||
#define EFI_ACPI_1_0_MULTIPLE_APIC_FLAGS (EFI_ACPI_1_0_PCAT_COMPAT)
|
||||
|
||||
//
|
||||
// Define the number of each table type.
|
||||
// This is where the table layout is modified.
|
||||
//
|
||||
#define EFI_ACPI_PROCESSOR_LOCAL_APIC_COUNT 1
|
||||
#define EFI_ACPI_INTERRUPT_SOURCE_OVERRIDE_COUNT 1
|
||||
#define EFI_ACPI_IO_APIC_COUNT 1
|
||||
|
||||
//
|
||||
// Ensure proper structure formats
|
||||
//
|
||||
#pragma pack (1)
|
||||
|
||||
//
|
||||
// ACPI 1.0 MADT structure
|
||||
//
|
||||
typedef struct {
|
||||
EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER Header;
|
||||
|
||||
#if EFI_ACPI_PROCESSOR_LOCAL_APIC_COUNT > 0
|
||||
EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE LocalApic[EFI_ACPI_PROCESSOR_LOCAL_APIC_COUNT];
|
||||
#endif
|
||||
|
||||
#if EFI_ACPI_INTERRUPT_SOURCE_OVERRIDE_COUNT > 0
|
||||
EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE Iso[EFI_ACPI_INTERRUPT_SOURCE_OVERRIDE_COUNT];
|
||||
#endif
|
||||
|
||||
#if EFI_ACPI_IO_APIC_COUNT > 0
|
||||
EFI_ACPI_1_0_IO_APIC_STRUCTURE IoApic[EFI_ACPI_IO_APIC_COUNT];
|
||||
#endif
|
||||
|
||||
} EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE;
|
||||
|
||||
#pragma pack ()
|
||||
|
||||
//
|
||||
// Multiple APIC Description Table
|
||||
//
|
||||
EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE Madt = {
|
||||
{
|
||||
{
|
||||
EFI_ACPI_1_0_APIC_SIGNATURE,
|
||||
sizeof (EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE),
|
||||
EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION,
|
||||
0x00, // Checksum will be updated at runtime
|
||||
{EFI_ACPI_OEM_ID},
|
||||
EFI_ACPI_OEM_TABLE_ID,
|
||||
EFI_ACPI_OEM_REVISION,
|
||||
EFI_ACPI_CREATOR_ID,
|
||||
EFI_ACPI_CREATOR_REVISION
|
||||
},
|
||||
|
||||
//
|
||||
// MADT specific fields
|
||||
//
|
||||
EFI_ACPI_LOCAL_APIC_ADDRESS,
|
||||
EFI_ACPI_1_0_MULTIPLE_APIC_FLAGS,
|
||||
},
|
||||
|
||||
//
|
||||
// Processor Local APIC Structure
|
||||
//
|
||||
{
|
||||
{
|
||||
EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC, // Type
|
||||
sizeof (EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE), // Length
|
||||
0x00, // Processor ID
|
||||
0x00, // Local APIC ID
|
||||
0x00000001 // Flags - Enabled by default
|
||||
}
|
||||
},
|
||||
|
||||
//
|
||||
// Interrupt Source Override Structure
|
||||
//
|
||||
{
|
||||
{
|
||||
//
|
||||
// IRQ0=>IRQ2 Interrupt Source Override Structure
|
||||
//
|
||||
EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE, // Type
|
||||
sizeof (EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE),// Length
|
||||
0x00, // Bus - ISA
|
||||
0x00, // Source - IRQ0
|
||||
0x00000002, // Global System Interrupt - IRQ2
|
||||
0x0005 // Flags - Conforms to specifications of the bus
|
||||
},
|
||||
},
|
||||
|
||||
//
|
||||
// IO APIC Structure
|
||||
//
|
||||
{
|
||||
{
|
||||
EFI_ACPI_1_0_IO_APIC, // Type
|
||||
sizeof (EFI_ACPI_1_0_IO_APIC_STRUCTURE), // Length
|
||||
0x01, // IO APIC ID
|
||||
EFI_ACPI_RESERVED_BYTE, // Reserved
|
||||
0xFEC00000, // IO APIC Address (physical)
|
||||
0x00000000 // Global System Interrupt Base
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
VOID*
|
||||
ReferenceAcpiTable (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
//
|
||||
// Reference the table being generated to prevent the optimizer from removing the
|
||||
// data structure from the exeutable
|
||||
//
|
||||
return (VOID*)&Madt;
|
||||
}
|
57
OvmfPkg/Bhyve/AcpiTables/Mcfg.aslc
Normal file
57
OvmfPkg/Bhyve/AcpiTables/Mcfg.aslc
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2020, Rebecca Cran <rebecca@bsdio.com>
|
||||
* Copyright (c) 2015, Nahanni Systems, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
*/
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
#define EFI_ACPI_OEM_TABLE_ID SIGNATURE_64('B','V','M','C','F','G',' ',' ')
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
typedef struct {
|
||||
EFI_ACPI_DESCRIPTION_HEADER Header;
|
||||
UINT64 Reserved0;
|
||||
UINT64 BaseAddress;
|
||||
UINT16 PciSegmentGroupNumber;
|
||||
UINT8 StartBusNumber;
|
||||
UINT8 EndBusNumber;
|
||||
UINT32 Reserved1;
|
||||
} EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_SPACE_ACCESS_TABLE;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_SPACE_ACCESS_TABLE MCFG = {
|
||||
{
|
||||
EFI_ACPI_2_0_MEMORY_MAPPED_CONFIGURATION_BASE_ADDRESS_TABLE_SIGNATURE,
|
||||
sizeof (EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_SPACE_ACCESS_TABLE),
|
||||
EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_SPACE_ACCESS_TABLE_REVISION,
|
||||
0, // to make sum of entire table == 0
|
||||
{EFI_ACPI_OEM_ID}, // OEMID is a 6 bytes long field
|
||||
EFI_ACPI_OEM_TABLE_ID, // OEM table identification(8 bytes long)
|
||||
EFI_ACPI_OEM_REVISION, // OEM revision number
|
||||
EFI_ACPI_CREATOR_ID, // ASL compiler vendor ID
|
||||
EFI_ACPI_CREATOR_REVISION // ASL compiler revision number
|
||||
},
|
||||
0, // Reserved
|
||||
0x00000000E0000000, // BaseAddress
|
||||
0x0000, // PciSegmentGroupNumber
|
||||
0, // StartBusNumber
|
||||
255, // EndBusNumber
|
||||
0 // Reserved
|
||||
};
|
||||
|
||||
|
||||
VOID *
|
||||
ReferenceAcpiTable (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
//
|
||||
// Reference the table being generated to prevent the optimizer from removing the
|
||||
// data structure from the exeutable
|
||||
//
|
||||
return (VOID*)&MCFG;
|
||||
}
|
72
OvmfPkg/Bhyve/AcpiTables/Platform.h
Normal file
72
OvmfPkg/Bhyve/AcpiTables/Platform.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/** @file
|
||||
Platform specific defines for constructing ACPI tables
|
||||
|
||||
Copyright (c) 2020, Rebecca Cran <rebecca@bsdio.com>
|
||||
Copyright (c) 2014, Pluribus Networks, Inc.
|
||||
Copyright (c) 2012, 2013, Red Hat, Inc.
|
||||
Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#ifndef _Platform_h_INCLUDED_
|
||||
#define _Platform_h_INCLUDED_
|
||||
|
||||
#include <IndustryStandard/Acpi.h>
|
||||
#include <IndustryStandard/SerialPortConsoleRedirectionTable.h>
|
||||
#include <IndustryStandard/MemoryMappedConfigurationSpaceAccessTable.h>
|
||||
|
||||
//
|
||||
// ACPI table information used to initialize tables.
|
||||
//
|
||||
#define EFI_ACPI_OEM_ID 'B','H','Y','V','E',' ' // OEMID 6 bytes long
|
||||
#define EFI_ACPI_OEM_REVISION 0x1
|
||||
#define EFI_ACPI_CREATOR_ID SIGNATURE_32('B','H','Y','V')
|
||||
#define EFI_ACPI_CREATOR_REVISION 0x00000001
|
||||
|
||||
#define INT_MODEL 0x01
|
||||
#define SCI_INT_VECTOR 0x0009
|
||||
#define SMI_CMD_IO_PORT 0xB2
|
||||
#define ACPI_ENABLE 0xA0
|
||||
#define ACPI_DISABLE 0xA1
|
||||
#define S4BIOS_REQ 0x00
|
||||
#define PM1a_EVT_BLK 0x00000400 /* TNXXX */
|
||||
#define PM1b_EVT_BLK 0x00000000
|
||||
#define PM1a_CNT_BLK 0x00000404 /* TNXXX */
|
||||
#define PM1b_CNT_BLK 0x00000000
|
||||
#define PM2_CNT_BLK 0x00000000
|
||||
#define PM_TMR_BLK 0x00000408
|
||||
#define GPE0_BLK 0x00000000
|
||||
#define GPE1_BLK 0x00000000
|
||||
#define PM1_EVT_LEN 0x04
|
||||
#define PM1_CNT_LEN 0x02
|
||||
#define PM2_CNT_LEN 0x00
|
||||
#define PM_TM_LEN 0x04
|
||||
#define GPE0_BLK_LEN 0x00
|
||||
#define GPE1_BLK_LEN 0x00
|
||||
#define GPE1_BASE 0x00
|
||||
#define RESERVED 0x00
|
||||
#define P_LVL2_LAT 0x0000
|
||||
#define P_LVL3_LAT 0x0000
|
||||
#define FLUSH_SIZE 0x0000
|
||||
#define FLUSH_STRIDE 0x0000
|
||||
#define DUTY_OFFSET 0x00
|
||||
#define DUTY_WIDTH 0x00
|
||||
#define DAY_ALRM 0x00
|
||||
#define MON_ALRM 0x00
|
||||
#define CENTURY 0x32
|
||||
#define IAPC_BOOT_ARCH 0x12 /* 8042 present, disable PCIe ASPM */
|
||||
#define FACP_FLAGS (EFI_ACPI_1_0_WBINVD | EFI_ACPI_1_0_PROC_C1 | \
|
||||
EFI_ACPI_1_0_SLP_BUTTON | EFI_ACPI_1_0_TMR_VAL_EXT | \
|
||||
EFI_ACPI_2_0_RESET_REG_SUP | \
|
||||
EFI_ACPI_3_0_FORCE_APIC_PHYSICAL_DESTINATION_MODE)
|
||||
#define FACP_RESET_REG { \
|
||||
EFI_ACPI_3_0_SYSTEM_IO, /* Address Space ID */ \
|
||||
8, /* Bit Width */ \
|
||||
0, /* Bit Offset */ \
|
||||
EFI_ACPI_3_0_BYTE, /* Byte Access */ \
|
||||
0xCF9 /* I/O Port */ \
|
||||
}
|
||||
#define FACP_RESET_VAL 0x6
|
||||
#endif
|
63
OvmfPkg/Bhyve/AcpiTables/Spcr.aslc
Normal file
63
OvmfPkg/Bhyve/AcpiTables/Spcr.aslc
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright (c) 2020, Rebecca Cran <rebecca@bsdio.com>
|
||||
* Copyright (c) 2015, Nahanni Systems, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
*/
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
#define EFI_ACPI_OEM_TABLE_ID SIGNATURE_64('B','V','S','P','C','R',' ',' ')
|
||||
|
||||
EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE SPCR = {
|
||||
{
|
||||
EFI_ACPI_2_0_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE,
|
||||
sizeof (EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE),
|
||||
EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_REVISION,
|
||||
0, // to make sum of entire table == 0
|
||||
{EFI_ACPI_OEM_ID}, // OEMID is a 6 bytes long field
|
||||
EFI_ACPI_OEM_TABLE_ID, // OEM table identification(8 bytes long)
|
||||
EFI_ACPI_OEM_REVISION, // OEM revision number
|
||||
EFI_ACPI_CREATOR_ID, // ASL compiler vendor ID
|
||||
EFI_ACPI_CREATOR_REVISION // ASL compiler revision number
|
||||
},
|
||||
EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_16550,
|
||||
{ 0 }, // Reserved
|
||||
{ // BaseAddress
|
||||
0x01, // AddressSpaceId
|
||||
0x08, // RegisterBitWidth
|
||||
0x00, // RegisterBitOffset
|
||||
0x00, // Reserved
|
||||
0x03F8 // Address (COM1)
|
||||
},
|
||||
EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_8259,
|
||||
4, // Irq
|
||||
0, // GlobalSystemInterrupt
|
||||
EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_115200,
|
||||
EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_PARITY_NO_PARITY,
|
||||
EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_STOP_BITS_1,
|
||||
0x03, // FlowControl: RTS/CTS | DCD
|
||||
EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_VT_UTF8,
|
||||
0, // Language
|
||||
0, // PciDeviceId
|
||||
0, // PciVendorId
|
||||
0, // PciBusNumber
|
||||
0, // PciDeviceNumber
|
||||
0, // PciFunctionNumber
|
||||
0, // PciFlags
|
||||
0, // PciSegment
|
||||
0 // Reserved
|
||||
};
|
||||
|
||||
|
||||
VOID *
|
||||
ReferenceAcpiTable (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
//
|
||||
// Reference the table being generated to prevent the optimizer from removing the
|
||||
// data structure from the exeutable
|
||||
//
|
||||
return (VOID*)&SPCR;
|
||||
}
|
15
OvmfPkg/Bhyve/AcpiTables/Ssdt.asl
Normal file
15
OvmfPkg/Bhyve/AcpiTables/Ssdt.asl
Normal file
@@ -0,0 +1,15 @@
|
||||
/** @file
|
||||
Placeholder for runtime-generated objects.
|
||||
|
||||
This empty table provides only a header for dynamic copying and extension,
|
||||
and a trigger for QemuInstallAcpiSsdtTable().
|
||||
|
||||
Copyright (C) 2020, Rebecca Cran <rebecca@bsdio.com>
|
||||
Copyright (C) 2012 Red Hat, Inc.
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
DefinitionBlock ("Ssdt.aml", "SSDT", 1, "REDHAT", "OVMF ", 1) {
|
||||
}
|
Reference in New Issue
Block a user