summaryrefslogtreecommitdiffstats
path: root/UefiPayloadPkg/Include/Library
diff options
context:
space:
mode:
authorDong, Guo <guo.dong@intel.com>2019-04-11 08:51:22 -0700
committerMaurice Ma <maurice.ma@intel.com>2019-04-15 12:30:05 -0700
commit04af8bf262f1917b74745f8ffd3aa8fb465352df (patch)
tree14023c61c67dd62b37e64995d8410ee5b10ef709 /UefiPayloadPkg/Include/Library
parent87fcc6e8634efadb535ea0d7e9869e72e772fccf (diff)
downloadedk2-04af8bf262f1917b74745f8ffd3aa8fb465352df.tar.gz
edk2-04af8bf262f1917b74745f8ffd3aa8fb465352df.tar.bz2
edk2-04af8bf262f1917b74745f8ffd3aa8fb465352df.zip
UefiPayloadPkg: Enhance UEFI payload for coreboot and Slim Bootloader
CorebootModulePkg and CorebootPayloadPkg originally supports coreboot only. In order to support other bootloaders, such as Slim Bootloader, they need be updated to be more generic. UEFI Payload (UefiPayloadPkg) a converged package from CorebootModulePkg and CorebootPayloadPkg with following updates: a. Support both coreboot and Slim Bootloader b. Removed SataControllerDxe and BaseSerialPortLib16550 to use EDK2 modules c. Support passing bootloader parameter to UEFI payload, e.g. coreboot table from coreboot or HOB list from Slim Bootloader d. Using GraphicsOutputDxe from EDK2 with minor change instead of FbGop e. Remove the dependency to IntelFrameworkPkg and IntelFrameworkModulePkg and QuarkSocPkg f. Use BaseDebugLibSerialPort library as DebugLib g. Use HPET timer, drop legacy 8254 timer support h. Use BaseXApicX2ApicLib instead of BaseXApicLib i. Remove HOB gUefiFrameBufferInfoGuid to use EDK2 graphics HOBs. j. Other clean ups On how UefiPayloadPkg could work with coreboot/Slim Bootloader, please refer UefiPayloadPkg/BuildAndIntegrationInstructions.txt Once UefiPayloadPkg is checked-in, CorebootModulePkg and CorebootPayloadPkg could be retired. Signed-off-by: Guo Dong <guo.dong@intel.com> Reviewed-by: Maurice Ma <maurice.ma@intel.com>
Diffstat (limited to 'UefiPayloadPkg/Include/Library')
-rw-r--r--UefiPayloadPkg/Include/Library/BlParseLib.h120
-rw-r--r--UefiPayloadPkg/Include/Library/PlatformSupportLib.h28
2 files changed, 148 insertions, 0 deletions
diff --git a/UefiPayloadPkg/Include/Library/BlParseLib.h b/UefiPayloadPkg/Include/Library/BlParseLib.h
new file mode 100644
index 0000000000..3f9e591ede
--- /dev/null
+++ b/UefiPayloadPkg/Include/Library/BlParseLib.h
@@ -0,0 +1,120 @@
+/** @file
+ This library will parse the coreboot table in memory and extract those required
+ information.
+
+ Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.<BR>
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+#include <PiPei.h>
+#include <Guid/GraphicsInfoHob.h>
+#include <Guid/MemoryMapInfoGuid.h>
+#include <Guid/SerialPortInfoGuid.h>
+#include <Guid/SystemTableInfoGuid.h>
+#include <Guid/AcpiBoardInfoGuid.h>
+
+#ifndef __BOOTLOADER_PARSE_LIB__
+#define __BOOTLOADER_PARSE_LIB__
+
+#define GET_BOOTLOADER_PARAMETER() (*(UINT32 *)(UINTN)(PcdGet32(PcdPayloadStackTop) - sizeof(UINT32)))
+#define SET_BOOTLOADER_PARAMETER(Value) GET_BOOTLOADER_PARAMETER()=Value
+
+typedef RETURN_STATUS \
+ (*BL_MEM_INFO_CALLBACK) (MEMROY_MAP_ENTRY *MemoryMapEntry, VOID *Param);
+
+/**
+ This function retrieves the parameter base address from boot loader.
+
+ This function will get bootloader specific parameter address for UEFI payload.
+ e.g. HobList pointer for Slim Bootloader, and coreboot table header for Coreboot.
+
+ @retval NULL Failed to find the GUID HOB.
+ @retval others GUIDed HOB data pointer.
+
+**/
+VOID *
+EFIAPI
+GetParameterBase (
+ VOID
+ );
+
+/**
+ Acquire the memory map information.
+
+ @param MemInfoCallback The callback routine
+ @param Params Pointer to the callback routine parameter
+
+ @retval RETURN_SUCCESS Successfully find out the memory information.
+ @retval RETURN_NOT_FOUND Failed to find the memory information.
+
+**/
+RETURN_STATUS
+EFIAPI
+ParseMemoryInfo (
+ IN BL_MEM_INFO_CALLBACK MemInfoCallback,
+ IN VOID *Params
+ );
+
+/**
+ Acquire acpi table and smbios table from slim bootloader
+
+ @param SystemTableInfo Pointer to the system table info
+
+ @retval RETURN_SUCCESS Successfully find out the tables.
+ @retval RETURN_NOT_FOUND Failed to find the tables.
+
+**/
+RETURN_STATUS
+EFIAPI
+ParseSystemTable (
+ OUT SYSTEM_TABLE_INFO *SystemTableInfo
+ );
+
+
+/**
+ Find the serial port information
+
+ @param SERIAL_PORT_INFO Pointer to serial port info structure
+
+ @retval RETURN_SUCCESS Successfully find the serial port information.
+ @retval RETURN_NOT_FOUND Failed to find the serial port information .
+
+**/
+RETURN_STATUS
+EFIAPI
+ParseSerialInfo (
+ OUT SERIAL_PORT_INFO *SerialPortInfo
+ );
+
+
+/**
+ Find the video frame buffer information
+
+ @param GfxInfo Pointer to the EFI_PEI_GRAPHICS_INFO_HOB structure
+
+ @retval RETURN_SUCCESS Successfully find the video frame buffer information.
+ @retval RETURN_NOT_FOUND Failed to find the video frame buffer information .
+
+**/
+RETURN_STATUS
+EFIAPI
+ParseGfxInfo (
+ OUT EFI_PEI_GRAPHICS_INFO_HOB *GfxInfo
+ );
+
+/**
+ Find the video frame buffer device information
+
+ @param GfxDeviceInfo Pointer to the EFI_PEI_GRAPHICS_DEVICE_INFO_HOB structure
+
+ @retval RETURN_SUCCESS Successfully find the video frame buffer information.
+ @retval RETURN_NOT_FOUND Failed to find the video frame buffer information .
+
+**/
+RETURN_STATUS
+EFIAPI
+ParseGfxDeviceInfo (
+ OUT EFI_PEI_GRAPHICS_DEVICE_INFO_HOB *GfxDeviceInfo
+ );
+
+#endif
diff --git a/UefiPayloadPkg/Include/Library/PlatformSupportLib.h b/UefiPayloadPkg/Include/Library/PlatformSupportLib.h
new file mode 100644
index 0000000000..d9f0b83075
--- /dev/null
+++ b/UefiPayloadPkg/Include/Library/PlatformSupportLib.h
@@ -0,0 +1,28 @@
+/** @file
+ Bootloader Platform Support library. Platform can provide an implementation of this
+ library class to provide hooks that may be required for some type of
+ platform features.
+
+Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.<BR>
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef __BOOTLOADER_PLATFORM_SUPPORT_LIB__
+#define __BOOTLOADER_PLATFORM_SUPPORT_LIB__
+
+/**
+ Parse platform specific information from bootloader
+
+ @retval RETURN_SUCCESS The platform specific coreboot support succeeded.
+ @retval RETURN_DEVICE_ERROR The platform specific coreboot support could not be completed.
+
+**/
+EFI_STATUS
+EFIAPI
+ParsePlatformInfo (
+ VOID
+ );
+
+#endif // __BOOTLOADER_PLATFORM_SUPPORT_LIB__
+