diff options
Diffstat (limited to 'Vlv2TbltDevicePkg/PlatformDxe/Platform.c')
-rw-r--r-- | Vlv2TbltDevicePkg/PlatformDxe/Platform.c | 53 |
1 files changed, 38 insertions, 15 deletions
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 @@ -483,18 +483,6 @@ SpiBiosProtectionFunction( (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,
|