From 6f2ef18e8097c4fa11dd6ff5fdd0152c2c61ffc5 Mon Sep 17 00:00:00 2001 From: Tim He Date: Tue, 4 Aug 2015 02:55:02 +0000 Subject: Vlv2TbltDevicePkg: Sync the branch changes to trunk. Support compatible board, and fixed some bugs. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tim He Reviewed-by: David Wei git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18149 6f19259b-4bc3-4df7-8a09-765794883524 --- Vlv2TbltDevicePkg/PlatformDxe/Platform.c | 53 +++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 15 deletions(-) (limited to 'Vlv2TbltDevicePkg/PlatformDxe') diff --git a/Vlv2TbltDevicePkg/PlatformDxe/Platform.c b/Vlv2TbltDevicePkg/PlatformDxe/Platform.c index a1cd072c8f..645b865cdd 100644 --- a/Vlv2TbltDevicePkg/PlatformDxe/Platform.c +++ b/Vlv2TbltDevicePkg/PlatformDxe/Platform.c @@ -482,18 +482,6 @@ SpiBiosProtectionFunction( B_PCH_SPI_PR0_RPE|B_PCH_SPI_PR0_WPE|\ (B_PCH_SPI_PR0_PRB_MASK&(BiosFlaLower0>>12))|(B_PCH_SPI_PR0_PRL_MASK&(BiosFlaLimit0>>12)<<16)); - // - //Lock down PR0 - // - MmioOr16 ((UINTN) (SpiBase + R_PCH_SPI_HSFS), (UINT16) (B_PCH_SPI_HSFS_FLOCKDN)); - - // - // Verify if it's really locked. - // - if ((MmioRead16 (SpiBase + R_PCH_SPI_HSFS) & B_PCH_SPI_HSFS_FLOCKDN) == 0) { - DEBUG((EFI_D_ERROR, "Failed to lock down PR0.\n")); - } - // //Set PR1 // @@ -503,7 +491,7 @@ SpiBiosProtectionFunction( (B_PCH_SPI_PR1_PRB_MASK&(BiosFlaLower1>>12))|(B_PCH_SPI_PR1_PRL_MASK&(BiosFlaLimit1>>12)<<16)); // - //Lock down PR1 + //Lock down PRx // MmioOr16 ((UINTN) (SpiBase + R_PCH_SPI_HSFS), (UINT16) (B_PCH_SPI_HSFS_FLOCKDN)); @@ -511,7 +499,7 @@ SpiBiosProtectionFunction( // Verify if it's really locked. // if ((MmioRead16 (SpiBase + R_PCH_SPI_HSFS) & B_PCH_SPI_HSFS_FLOCKDN) == 0) { - DEBUG((EFI_D_ERROR, "Failed to lock down PR1.\n")); + DEBUG((EFI_D_ERROR, "Failed to lock down PRx.\n")); } return; @@ -576,6 +564,32 @@ InitPciDevPME ( } } +VOID +EFIAPI +InitThermalZone ( + EFI_EVENT Event, + VOID *Context + ) +{ + UINTN VarSize; + EFI_STATUS Status; + EFI_GLOBAL_NVS_AREA_PROTOCOL *GlobalNvsArea; + VarSize = sizeof(SYSTEM_CONFIGURATION); + Status = gRT->GetVariable( + NORMAL_SETUP_NAME, + &gEfiNormalSetupGuid, + NULL, + &VarSize, + &mSystemConfiguration + ); + Status = gBS->LocateProtocol ( + &gEfiGlobalNvsAreaProtocolGuid, + NULL, + (void **)&GlobalNvsArea + ); + GlobalNvsArea->Area->CriticalThermalTripPoint = mSystemConfiguration.CriticalThermalTripPoint; + GlobalNvsArea->Area->PassiveThermalTripPoint = mSystemConfiguration.PassiveThermalTripPoint; +} #if defined SUPPORT_LVDS_DISPLAY && SUPPORT_LVDS_DISPLAY #endif @@ -830,7 +844,16 @@ InitializePlatform ( &mReadyToBootEvent ); } - + // + // Create a ReadyToBoot Event to run the thermalzone init process + // + Status = EfiCreateEventReadyToBootEx ( + TPL_CALLBACK, + InitThermalZone, + NULL, + &mReadyToBootEvent + ); + ReportStatusCodeEx ( EFI_PROGRESS_CODE, EFI_COMPUTING_UNIT_CHIPSET | EFI_CU_PLATFORM_DXE_STEP1, -- cgit v1.2.3