From 05de9ab296553c3ae54857f3ba63429010f3b245 Mon Sep 17 00:00:00 2001 From: Guo Dong Date: Wed, 1 Jul 2015 09:41:58 +0000 Subject: CorebootModulePkg: Get power management register addresses. This patch will get power management event register address and power management GPE enable register address. Add missing code in CbParseLib.c. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Guo Dong Reviewed-by: Maurice Ma git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17791 6f19259b-4bc3-4df7-8a09-765794883524 --- CorebootModulePkg/Library/CbParseLib/CbParseLib.c | 25 ++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/CorebootModulePkg/Library/CbParseLib/CbParseLib.c b/CorebootModulePkg/Library/CbParseLib/CbParseLib.c index 66374b5a32..8509bd2f9e 100644 --- a/CorebootModulePkg/Library/CbParseLib/CbParseLib.c +++ b/CorebootModulePkg/Library/CbParseLib/CbParseLib.c @@ -395,6 +395,8 @@ CbParseSmbiosTable ( @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. @@ -405,7 +407,9 @@ CbParseFadtInfo ( OUT UINTN *pPmCtrlReg, OUT UINTN *pPmTimerReg, OUT UINTN *pResetReg, - OUT UINTN *pResetValue + OUT UINTN *pResetValue, + OUT UINTN *pPmEvtReg, + OUT UINTN *pPmGpeEnReg ) { EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp; @@ -464,6 +468,16 @@ CbParseFadtInfo ( } DEBUG ((EFI_D_INFO, "Reset Value 0x%x\n", Fadt->ResetValue)); + if (pPmEvtReg != NULL) { + *pPmEvtReg = Fadt->Pm1aEvtBlk; + DEBUG ((EFI_D_INFO, "PmEvt Reg 0x%x\n", Fadt->Pm1aEvtBlk)); + } + + if (pPmGpeEnReg != NULL) { + *pPmGpeEnReg = Fadt->Gpe0Blk + Fadt->Gpe0BlkLen / 2; + DEBUG ((EFI_D_INFO, "PmGpeEn Reg 0x%x\n", *pPmGpeEnReg)); + } + return RETURN_SUCCESS; } } @@ -495,6 +509,15 @@ CbParseFadtInfo ( *pResetValue = Fadt->ResetValue; DEBUG ((EFI_D_ERROR, "Reset Value 0x%x\n", Fadt->ResetValue)); + if (pPmEvtReg != NULL) { + *pPmEvtReg = Fadt->Pm1aEvtBlk; + DEBUG ((EFI_D_INFO, "PmEvt Reg 0x%x\n", Fadt->Pm1aEvtBlk)); + } + + if (pPmGpeEnReg != NULL) { + *pPmGpeEnReg = Fadt->Gpe0Blk + Fadt->Gpe0BlkLen / 2; + DEBUG ((EFI_D_INFO, "PmGpeEn Reg 0x%x\n", *pPmGpeEnReg)); + } return RETURN_SUCCESS; } } -- cgit v1.2.3