Laszlo Ersek e557442e3f OvmfPkg: fix DEC spec violation introduced by Bhyve addition
Sean reports that having two DEC files under OvmfPkg violates the DEC
spec:

> An EDK II Package (directory) is a directory that contains an EDK II
> package declaration (DEC) file. Only one DEC file is permitted per
> directory. EDK II Packages cannot be nested within other EDK II
> Packages.

This issue originates from commit 656419f922c0 ("Add BhyvePkg, to support
the bhyve hypervisor", 2020-07-31).

Remedy the problem as follows. (Note that these steps are not split to
multiple patches in order to keep Bhyve buildable across the transition.)

(1) Delete "OvmfPkg/Bhyve/BhyvePkg.dec".

(2) Point the [Packages] sections of the Bhyve-specific AcpiPlatformDxe,
    BhyveRfbDxe, and BhyveFwCtlLib INF files to "OvmfPkg.dec".

(3) Migrate the artifacts that "BhyvePkg.dec" used to have on top of
    "OvmfPkg.dec" as follows:

(3a) Merge the copyright notices from Rebecca Cran and Pluribus Networks
     into "OvmfPkg.dec".

(3b) Merge the "BhyveFwCtlLib" class header definition into "OvmfPkg.dec".

(3c) Merge value 0x2F8 for the fixed PcdDebugIoPort into
     "BhyvePkgX64.dsc".

(4) Unnest the the Include/Library/ and Library/ subtrees from under
    OvmfPkg/Bhyve to the corresponding, preexistent subtrees in OvmfPkg.
    The goal is to keep the [Includes] section in the "OvmfPkg.dec" file
    unchanged, plus simplify references in "BhyvePkgX64.dsc". Non-library
    modules remain under "OvmfPkg/Bhyve/".

(4a) The BhyveFwCtlLib class header, and sole instance, are already
     uniquely named, so their movements need not involve file renames.

(4b) Rename the Bhyve-specific PlatformBootManagerLib instance to
     PlatformBootManagerLibBhyve, in additon to moving it, for
     distinguishing it from OvmfPkg's preexistent lib instance. Apply the
     name change to all three of the lib instance directory name, the INF
     file, and the BASE_NAME define in the INF file.

(4c) Update lib class resolutions in "BhyvePkgX64.dsc" accordingly.

(5) Replace the "ACPI table storage" FILE_GUID in
    "OvmfPkg/Bhyve/AcpiTables/AcpiTables.inf" with a new GUID, and
    open-code the "ACPI table storage" GUID in the "ACPITABLE" FDF rule
    instead, replacing $(NAMED_GUID). This step is necessary because CI
    requires unique FILE_GUIDs over all INF files, and OVMF's original
    "AcpiTables.inf" already uses the "ACPI table storage" GUID as
    FILE_GUID.

Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Sean Brogan <spbrogan@outlook.com>
Fixes: 656419f922c047a3c48bd3f4ecea7d8e87d0b761
Reported-by: Sean Brogan <spbrogan@outlook.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20200801155024.16439-1-lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
2020-08-01 20:38:55 +00:00

172 lines
4.1 KiB
C

/** @file
Defined the platform specific device path which will be used by
platform Bbd to perform the platform policy connect.
Copyright (c) 2020, Rebecca Cran <rebecca@bsdio.com>
Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include "BdsPlatform.h"
#include <Guid/QemuRamfb.h>
//
// Debug Agent UART Device Path structure
//
#pragma pack(1)
typedef struct {
VENDOR_DEVICE_PATH VendorHardware;
UART_DEVICE_PATH Uart;
VENDOR_DEVICE_PATH TerminalType;
EFI_DEVICE_PATH_PROTOCOL End;
} VENDOR_UART_DEVICE_PATH;
#pragma pack()
//
// USB Keyboard Device Path structure
//
#pragma pack (1)
typedef struct {
USB_CLASS_DEVICE_PATH Keyboard;
EFI_DEVICE_PATH_PROTOCOL End;
} USB_KEYBOARD_DEVICE_PATH;
#pragma pack ()
//
// QemuRamfb Device Path structure
//
#pragma pack (1)
typedef struct {
VENDOR_DEVICE_PATH Vendor;
ACPI_ADR_DEVICE_PATH AcpiAdr;
EFI_DEVICE_PATH_PROTOCOL End;
} VENDOR_RAMFB_DEVICE_PATH;
#pragma pack ()
ACPI_HID_DEVICE_PATH gPnpPs2KeyboardDeviceNode = gPnpPs2Keyboard;
ACPI_HID_DEVICE_PATH gPnp16550ComPortDeviceNode = gPnp16550ComPort;
UART_DEVICE_PATH gUartDeviceNode = gUart;
VENDOR_DEVICE_PATH gTerminalTypeDeviceNode = gPcAnsiTerminal;
//
// Platform specific keyboard device path
//
//
// Debug Agent UART Device Path
//
VENDOR_UART_DEVICE_PATH gDebugAgentUartDevicePath = {
{
{
HARDWARE_DEVICE_PATH,
HW_VENDOR_DP,
{
(UINT8) (sizeof (VENDOR_DEVICE_PATH)),
(UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)
}
},
EFI_DEBUG_AGENT_GUID,
},
{
{
MESSAGING_DEVICE_PATH,
MSG_UART_DP,
{
(UINT8) (sizeof (UART_DEVICE_PATH)),
(UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8)
}
},
0, // Reserved
0, // BaudRate - Default
0, // DataBits - Default
0, // Parity - Default
0, // StopBits - Default
},
gPcAnsiTerminal,
gEndEntire
};
STATIC USB_KEYBOARD_DEVICE_PATH gUsbKeyboardDevicePath = {
{
{
MESSAGING_DEVICE_PATH,
MSG_USB_CLASS_DP,
{
(UINT8)sizeof (USB_CLASS_DEVICE_PATH),
(UINT8)(sizeof (USB_CLASS_DEVICE_PATH) >> 8)
}
},
0xFFFF, // VendorId: any
0xFFFF, // ProductId: any
3, // DeviceClass: HID
1, // DeviceSubClass: boot
1 // DeviceProtocol: keyboard
},
gEndEntire
};
STATIC VENDOR_RAMFB_DEVICE_PATH gQemuRamfbDevicePath = {
{
{
HARDWARE_DEVICE_PATH,
HW_VENDOR_DP,
{
(UINT8) (sizeof (VENDOR_DEVICE_PATH)),
(UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)
}
},
QEMU_RAMFB_GUID,
},
{
{
ACPI_DEVICE_PATH,
ACPI_ADR_DP,
{
(UINT8) (sizeof (ACPI_ADR_DEVICE_PATH)),
(UINT8) ((sizeof (ACPI_ADR_DEVICE_PATH)) >> 8)
}
},
ACPI_DISPLAY_ADR (
1, // DeviceIdScheme
0, // HeadId
0, // NonVgaOutput
1, // BiosCanDetect
0, // VendorInfo
ACPI_ADR_DISPLAY_TYPE_EXTERNAL_DIGITAL, // Type
0, // Port
0 // Index
),
},
gEndEntire
};
//
// Predefined platform default console device path
//
PLATFORM_CONSOLE_CONNECT_ENTRY gPlatformConsole[] = {
{
(EFI_DEVICE_PATH_PROTOCOL *) &gDebugAgentUartDevicePath,
(CONSOLE_OUT | CONSOLE_IN | STD_ERROR)
},
{
(EFI_DEVICE_PATH_PROTOCOL *)&gUsbKeyboardDevicePath,
CONSOLE_IN
},
{
(EFI_DEVICE_PATH_PROTOCOL *)&gQemuRamfbDevicePath,
CONSOLE_OUT
},
{
NULL,
0
}
};
//
// Predefined platform connect sequence
//
EFI_DEVICE_PATH_PROTOCOL *gPlatformConnectSequence[] = { NULL };