diff options
author | Maurice Ma <maurice.ma@intel.com> | 2015-03-31 01:06:23 +0000 |
---|---|---|
committer | mauricema <mauricema@Edk2> | 2015-03-31 01:06:23 +0000 |
commit | fce4ecd92cf137d479c0dc97461bec3512e9c98d (patch) | |
tree | 58c77cce1adb54af4e94ec196c0db9448a09154b /CorebootModulePkg/Include/Library/CbParseLib.h | |
parent | 14df6e059c9115108c9fcbbceac2ae4c6fc7ee94 (diff) | |
download | edk2-platforms-fce4ecd92cf137d479c0dc97461bec3512e9c98d.tar.xz |
Pkg-Module: CorebootModulePkg
Initial coreboot UEFI payload code check in. It provides UEFI services on top of coreboot that allows UEFI OS boot.
CorebootModulePkg is the source code package of coreboot support modules that will be used to parse the coreboot tables and report memory/io resources.
It supports the following features:
- Support Unified Extensible Firmware Interface (UEFI) specification 2.4.
- Support Platform Initialization(PI) specification 1.3.
- Support execution as a coreboot payload.
- Support USB 3.0
- Support SATA/ATA devices.
- Support EFI aware OS boot.
The following features are not supported currently and have not been validated:
- GCC Tool Chains
- SMM Execution Environment
- Security Boot
It was tested on a Intel Bay Trail CRB platform.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17084 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'CorebootModulePkg/Include/Library/CbParseLib.h')
-rw-r--r-- | CorebootModulePkg/Include/Library/CbParseLib.h | 154 |
1 files changed, 154 insertions, 0 deletions
diff --git a/CorebootModulePkg/Include/Library/CbParseLib.h b/CorebootModulePkg/Include/Library/CbParseLib.h new file mode 100644 index 0000000000..36727d3f58 --- /dev/null +++ b/CorebootModulePkg/Include/Library/CbParseLib.h @@ -0,0 +1,154 @@ +/** @file
+ This library will parse the coreboot table in memory and extract those required
+ information.
+
+ Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+#include <Guid/FrameBufferInfoGuid.h>
+
+/**
+ Acquire the memory information from the coreboot table in memory.
+
+ @param pLowMemorySize Pointer to the variable of low memory size
+ @param pHighMemorySize Pointer to the variable of high memory size
+
+ @retval RETURN_SUCCESS Successfully find out the memory information.
+ @retval RETURN_INVALID_PARAMETER Invalid input parameters.
+ @retval RETURN_NOT_FOUND Failed to find the memory information.
+
+**/
+RETURN_STATUS
+CbParseMemoryInfo (
+ IN UINT64* pLowMemorySize,
+ IN UINT64* pHighMemorySize
+ );
+
+/**
+ Acquire the coreboot memory table with the given table id
+
+ @param TableId Table id to be searched
+ @param pMemTable Pointer to the base address of the memory table
+ @param pMemTableSize Pointer to the size of the memory table
+
+ @retval RETURN_SUCCESS Successfully find out the memory table.
+ @retval RETURN_INVALID_PARAMETER Invalid input parameters.
+ @retval RETURN_NOT_FOUND Failed to find the memory table.
+
+**/
+RETURN_STATUS
+CbParseCbMemTable (
+ IN UINT32 TableId,
+ IN VOID** pMemTable,
+ IN UINT32* pMemTableSize
+ );
+
+/**
+ Acquire the acpi table from coreboot
+
+ @param pMemTable Pointer to the base address of the memory table
+ @param pMemTableSize Pointer to the size of the memory table
+
+ @retval RETURN_SUCCESS Successfully find out the memory table.
+ @retval RETURN_INVALID_PARAMETER Invalid input parameters.
+ @retval RETURN_NOT_FOUND Failed to find the memory table.
+
+**/
+RETURN_STATUS
+CbParseAcpiTable (
+ IN VOID** pMemTable,
+ IN UINT32* pMemTableSize
+ );
+
+/**
+ Acquire the smbios table from coreboot
+
+ @param pMemTable Pointer to the base address of the memory table
+ @param pMemTableSize Pointer to the size of the memory table
+
+ @retval RETURN_SUCCESS Successfully find out the memory table.
+ @retval RETURN_INVALID_PARAMETER Invalid input parameters.
+ @retval RETURN_NOT_FOUND Failed to find the memory table.
+
+**/
+RETURN_STATUS
+CbParseSmbiosTable (
+ IN VOID** pMemTable,
+ IN UINT32* pMemTableSize
+ );
+
+/**
+ Find the required fadt information
+
+ @param pPmCtrlReg Pointer to the address of power management control register
+ @param pPmTimerReg Pointer to the address of power management timer register
+ @param pResetReg Pointer to the address of system reset register
+ @param pResetValue Pointer to the value to be writen to the system reset register
+
+ @retval RETURN_SUCCESS Successfully find out all the required fadt information.
+ @retval RETURN_NOT_FOUND Failed to find the fadt table.
+
+**/
+RETURN_STATUS
+CbParseFadtInfo (
+ IN UINTN* pPmCtrlReg,
+ IN UINTN* pPmTimerReg,
+ IN UINTN* pResetReg,
+ IN UINTN* pResetValue
+ );
+
+/**
+ Find the serial port information
+
+ @param pRegBase Pointer to the base address of serial port registers
+ @param pRegAccessType Pointer to the access type of serial port registers
+ @param pBaudrate Pointer to the serial port baudrate
+
+ @retval RETURN_SUCCESS Successfully find the serial port information.
+ @retval RETURN_NOT_FOUND Failed to find the serial port information .
+
+**/
+RETURN_STATUS
+CbParseSerialInfo (
+ IN UINT32* pRegBase,
+ IN UINT32* pRegAccessType,
+ IN UINT32* pBaudrate
+ );
+
+/**
+ Search for the coreboot table header
+
+ @param Level Level of the search depth
+ @param HeaderPtr Pointer to the pointer of coreboot table header
+
+ @retval RETURN_SUCCESS Successfully find the coreboot table header .
+ @retval RETURN_NOT_FOUND Failed to find the coreboot table header .
+
+**/
+RETURN_STATUS
+CbParseGetCbHeader (
+ IN UINTN Level,
+ IN VOID** HeaderPtr
+ );
+
+/**
+ Find the video frame buffer information
+
+ @param pFbInfo Pointer to the FRAME_BUFFER_INFO 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
+CbParseFbInfo (
+ IN FRAME_BUFFER_INFO* pFbInfo
+ );
+
|