Reviewed-by: Maurice Ma <***@intel.com>
Thanks,
-Maurice
-----Original Message-----
From: Dong, Guo
Sent: Thursday, June 11, 2015 6:33 AM
To: edk2-***@lists.sourceforge.net
Cc: Ma, Maurice
Subject: [Patch 1/2] CorebootModulePkg: Get power management register addresses.
This patch will get power management event register address and power management GPE enable register address.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Guo Dong <***@intel.com>
---
CorebootModulePkg/CbSupportPei/CbSupportPei.c | 6 +++++-
CorebootModulePkg/Include/Guid/AcpiBoardInfoGuid.h | 4 +++-
CorebootModulePkg/Include/Library/CbParseLib.h | 6 +++++-
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/CorebootModulePkg/CbSupportPei/CbSupportPei.c b/CorebootModulePkg/CbSupportPei/CbSupportPei.c
index b3705fa..2fb28d4 100755
--- a/CorebootModulePkg/CbSupportPei/CbSupportPei.c
+++ b/CorebootModulePkg/CbSupportPei/CbSupportPei.c
@@ -169,10 +169,12 @@ CbPeiEntryPoint (
SYSTEM_TABLE_INFO* pSystemTableInfo;
FRAME_BUFFER_INFO FbInfo;
FRAME_BUFFER_INFO* pFbInfo;
ACPI_BOARD_INFO* pAcpiBoardInfo;
UINTN PmCtrlRegBase, PmTimerRegBase, ResetRegAddress, ResetValue;
+ UINTN PmEvtBase;
+ UINTN PmGpeEnBase;
LowMemorySize = 0;
HighMemorySize = 0;
Status = CbParseMemoryInfo (&LowMemorySize, &HighMemorySize); @@ -353,19 +355,21 @@ CbPeiEntryPoint (
DEBUG ((EFI_D_ERROR, "Create system table info guid hob\n"));
//
// Create guid hob for acpi board information
//
- Status = CbParseFadtInfo (&PmCtrlRegBase, &PmTimerRegBase, &ResetRegAddress, &ResetValue);
+ Status = CbParseFadtInfo (&PmCtrlRegBase, &PmTimerRegBase,
+ &ResetRegAddress, &ResetValue, &PmEvtBase, &PmGpeEnBase);
ASSERT_EFI_ERROR (Status);
pAcpiBoardInfo = NULL;
pAcpiBoardInfo = BuildGuidHob (&gUefiAcpiBoardInfoGuid, sizeof (ACPI_BOARD_INFO));
ASSERT (pAcpiBoardInfo != NULL);
pAcpiBoardInfo->PmCtrlRegBase = (UINT64)PmCtrlRegBase;
pAcpiBoardInfo->PmTimerRegBase = (UINT64)PmTimerRegBase;
pAcpiBoardInfo->ResetRegAddress = (UINT64)ResetRegAddress;
pAcpiBoardInfo->ResetValue = (UINT8)ResetValue;
+ pAcpiBoardInfo->PmEvtBase = (UINT64)PmEvtBase;
+ pAcpiBoardInfo->PmGpeEnBase = (UINT64)PmGpeEnBase;
DEBUG ((EFI_D_ERROR, "Create acpi board info guid hob\n"));
//
// Create guid hob for frame buffer information
//
diff --git a/CorebootModulePkg/Include/Guid/AcpiBoardInfoGuid.h b/CorebootModulePkg/Include/Guid/AcpiBoardInfoGuid.h
index 66ebffe..609e989 100644
--- a/CorebootModulePkg/Include/Guid/AcpiBoardInfoGuid.h
+++ b/CorebootModulePkg/Include/Guid/AcpiBoardInfoGuid.h
@@ -18,11 +18,13 @@
///
/// Board information GUID
///
extern EFI_GUID gUefiAcpiBoardInfoGuid;
-typedef struct {
+typedef struct {
+ UINT64 PmEvtBase;
+ UINT64 PmGpeEnBase;
UINT64 PmCtrlRegBase;
UINT64 PmTimerRegBase;
UINT64 ResetRegAddress;
UINT8 ResetValue;
} ACPI_BOARD_INFO;
diff --git a/CorebootModulePkg/Include/Library/CbParseLib.h b/CorebootModulePkg/Include/Library/CbParseLib.h
index 36727d3..170375b 100644
--- a/CorebootModulePkg/Include/Library/CbParseLib.h
+++ b/CorebootModulePkg/Include/Library/CbParseLib.h
@@ -89,21 +89,25 @@ CbParseSmbiosTable (
@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
+ @param pPmEvtReg Pointer to the address of power management event register
+ @param pPmGpeEnReg Pointer to the address of power management GPE enable 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
+ IN UINTN* pResetValue,
+ IN UINTN* pPmEvtReg,
+ IN UINTN* pPmGpeEnReg
);
/**
Find the serial port information
--
1.9.5.msysgit.0
------------------------------------------------------------------------------