diff options
author | Lu, ShifeiX A <shifeix.a.lu@intel.com> | 2017-01-20 14:16:03 +0800 |
---|---|---|
committer | Guo Mang <mang.guo@intel.com> | 2017-05-09 13:03:08 +0800 |
commit | 345670330fc0431737c26e9ae8a51ec9ad4f4129 (patch) | |
tree | c6d9696cf764437118345bb2f274cab418943673 /Platform/BroxtonPlatformPkg/Common | |
parent | 2f04afd6f3c433c831e0c15823e95ac975a6aa4b (diff) | |
download | edk2-platforms-345670330fc0431737c26e9ae8a51ec9ad4f4129.tar.xz |
Enable Mor.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: lushifex <shifeix.a.lu@intel.com>
Diffstat (limited to 'Platform/BroxtonPlatformPkg/Common')
6 files changed, 38 insertions, 53 deletions
diff --git a/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiTablesPCAT/Platform.asl b/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiTablesPCAT/Platform.asl index 7847f2f6dc..04ea3ad74d 100644 --- a/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiTablesPCAT/Platform.asl +++ b/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiTablesPCAT/Platform.asl @@ -1,5 +1,5 @@ /** @file
- Copyright (c) 2012 - 2016, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2012 - 2017, 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
@@ -19,7 +19,6 @@ External(PDC1) External(PDC2)
External(PDC3)
External(\_PR.CPU0._PPC, IntObj)
-External(\_SB.PCI0.LPCB.TPM.PTS, MethodObj)
Name(ECUP, 1) // EC State indicator: 1- Normal Mode 0- Low Power Mode
Mutex(EHLD, 0) // EC Hold indicator: 0- No one accessing the EC Power State 1- Someone else is accessing the EC Power State
@@ -153,10 +152,12 @@ Method(_PTS,1) //clear GPE0_STS
Store(Ones, G0S)
- //
- // Call TPM PTS method
- //
- \_SB.TPM.PTS (Arg0)
+ If (CondRefOf(\_SB.TPM.PTS)) {
+ //
+ // Call TPM PTS method
+ //
+ \_SB.TPM.PTS (Arg0)
+ }
//
// Set GPIO_116 (SOC_CODEC_IRQ) 20k pull-down for device I2S audio codec INT343A before enter S3/S4
diff --git a/Platform/BroxtonPlatformPkg/Common/SampleCode/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTest.c b/Platform/BroxtonPlatformPkg/Common/SampleCode/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTest.c index a3f5971b2b..b506f1347e 100644 --- a/Platform/BroxtonPlatformPkg/Common/SampleCode/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTest.c +++ b/Platform/BroxtonPlatformPkg/Common/SampleCode/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTest.c @@ -2,7 +2,7 @@ Implementation of Generic Memory Test Protocol which does not perform real memory test.
Also clears memory when the MemoryOverwriteRequest bit is set.
- Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2017, 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
@@ -19,7 +19,6 @@ #include <Library/UefiLib.h>
#include <Library/IoLib.h>
#include <Guid/MemoryOverwriteControl.h>
-#include <CMOSMap.h>
UINT64 mTestedSystemMemory = 0;
UINT64 mTotalSystemMemory = 0;
@@ -151,19 +150,12 @@ BOOLEAN IsMemoryOverwriteRequested (
)
{
- BOOLEAN bRetValue = 0;
- EFI_STATUS Status;
- UINT64 MemoryOverwriteReq = 0;
- UINTN VariableSize;
- UINT8 CmosRegValue;
-
- DEBUG((EFI_D_INFO, "+IsMemoryOverwriteRequested\n"));
+ BOOLEAN bRetValue = 0;
+ EFI_STATUS Status;
+ UINT64 MemoryOverwriteReq = 0;
+ UINTN VariableSize;
- //
- // Read the CMOS Register EFI_CMOS_CLEAN_RESET
- //
- IoWrite8(CmosIo_72, EFI_CMOS_CLEAN_RESET);
- CmosRegValue = IoRead8(CmosIo_73);
+ DEBUG ((EFI_D_INFO, "IsMemoryOverwriteRequested\n"));
//
// Get the MOR variable
@@ -187,25 +179,18 @@ IsMemoryOverwriteRequested ( &MemoryOverwriteReq
);
} else {
+ MemoryOverwriteReq = 0;
DEBUG ((EFI_D_ERROR, "IsMemoryOverwriteRequested: Failed to Get MOR Variable - Status = %r\n", Status));
}
goto Exit;
}
-
- DEBUG ((EFI_D_INFO, "IsMemoryOverwriteRequested: MOR Control Value = %02x, CmosRegValue = %02x\n", MemoryOverwriteReq, CmosRegValue));
-
- if ((MOR_CLEAR_MEMORY_VALUE(MemoryOverwriteReq)) &&
- (((CmosRegValue != B_MAGIC_CLEAN_RESET_VALUE) && (MOR_DISABLE_AUTO_DETECT_VALUE(MemoryOverwriteReq) == 0)) ||
- (MOR_DISABLE_AUTO_DETECT_VALUE(MemoryOverwriteReq) == 1))
- )
- {
- DEBUG((EFI_D_INFO, "IsMemoryOverwriteRequested: Un-controlled Reset detected and hence requesting the Memory Clear\n"));
+ if (MOR_CLEAR_MEMORY_VALUE (MemoryOverwriteReq)) {
+ DEBUG ((EFI_D_INFO, "IsMemoryOverwriteRequested: Un-controlled Reset detected and hence requesting the Memory Clear\n"));
bRetValue = 1;
}
Exit:
- IoWrite8(CmosIo_73, B_MAGIC_INIT_VALUE); // Initialize to a known value
- DEBUG((EFI_D_INFO, "-IsMemoryOverwriteRequested: bRetValue = %d\n", bRetValue));
+ DEBUG ((EFI_D_INFO, "IsMemoryOverwriteRequested: bRetValue = %d\n", bRetValue));
return bRetValue;
}
@@ -219,16 +204,15 @@ HandleMorRequest ( //
// Check if there is a need for memory overwrite.
//
- bCleanMemory = IsMemoryOverwriteRequested();
+ bCleanMemory = IsMemoryOverwriteRequested ();
//
// Clear memory if OS requested a memory overwrite operation.
// This is being done for the memory used by OS => Stolen memory is not cleared as OS cannot store keys in UEFI Stolen memory
//
- if (bCleanMemory)
- {
- DEBUG((EFI_D_INFO, "Clearing the memory per MOR request.\n"));
- ClearAvailableSystemMemory();
+ if (bCleanMemory) {
+ DEBUG ((EFI_D_INFO, "Clearing the memory per MOR request.\n"));
+ ClearAvailableSystemMemory ();
}
return;
@@ -308,17 +292,17 @@ InitializeMemoryTest ( // For those reserved memory that have not been tested, simply promote to system memory.
//
gDS->RemoveMemorySpace (
- MemorySpaceMap[Index].BaseAddress,
- MemorySpaceMap[Index].Length
- );
+ MemorySpaceMap[Index].BaseAddress,
+ MemorySpaceMap[Index].Length
+ );
gDS->AddMemorySpace (
- EfiGcdMemoryTypeSystemMemory,
- MemorySpaceMap[Index].BaseAddress,
- MemorySpaceMap[Index].Length,
- MemorySpaceMap[Index].Capabilities &~
- (EFI_MEMORY_PRESENT | EFI_MEMORY_INITIALIZED | EFI_MEMORY_TESTED | EFI_MEMORY_RUNTIME)
- );
+ EfiGcdMemoryTypeSystemMemory,
+ MemorySpaceMap[Index].BaseAddress,
+ MemorySpaceMap[Index].Length,
+ MemorySpaceMap[Index].Capabilities &~
+ (EFI_MEMORY_PRESENT | EFI_MEMORY_INITIALIZED | EFI_MEMORY_TESTED | EFI_MEMORY_RUNTIME)
+ );
mTestedSystemMemory += MemorySpaceMap[Index].Length;
mTotalSystemMemory += MemorySpaceMap[Index].Length;
@@ -425,11 +409,11 @@ GenCompatibleRangeTest ( gDS->RemoveMemorySpace (StartAddress, Length);
gDS->AddMemorySpace (
- EfiGcdMemoryTypeSystemMemory,
- StartAddress,
- Length,
- Descriptor.Capabilities &~(EFI_MEMORY_PRESENT | EFI_MEMORY_INITIALIZED | EFI_MEMORY_TESTED | EFI_MEMORY_RUNTIME)
- );
+ EfiGcdMemoryTypeSystemMemory,
+ StartAddress,
+ Length,
+ Descriptor.Capabilities &~(EFI_MEMORY_PRESENT | EFI_MEMORY_INITIALIZED | EFI_MEMORY_TESTED | EFI_MEMORY_RUNTIME)
+ );
return EFI_SUCCESS;
}
diff --git a/Platform/BroxtonPlatformPkg/Common/SampleCode/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTest.h b/Platform/BroxtonPlatformPkg/Common/SampleCode/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTest.h index 5065bf93b5..a7f453d1d5 100644 --- a/Platform/BroxtonPlatformPkg/Common/SampleCode/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTest.h +++ b/Platform/BroxtonPlatformPkg/Common/SampleCode/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTest.h @@ -1,7 +1,7 @@ /** @file
Include file of the NULL memory test driver.
- Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2017, 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
diff --git a/Platform/BroxtonPlatformPkg/Common/SampleCode/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf b/Platform/BroxtonPlatformPkg/Common/SampleCode/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf index 3db2784c77..fdbb089c58 100644 --- a/Platform/BroxtonPlatformPkg/Common/SampleCode/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf +++ b/Platform/BroxtonPlatformPkg/Common/SampleCode/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf @@ -2,7 +2,7 @@ # This driver installs Generic Memory Test Protocol which does not perform real memory test.
# Also clears memory when the MemoryOverwriteRequest bit is set.
#
-# Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2017, 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
@@ -36,7 +36,7 @@ [Packages]
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
- BroxtonPlatformPkg/PlatformPkg.dec # required for CMOSMap.h
+ BroxtonPlatformPkg/PlatformPkg.dec
[LibraryClasses]
MemoryAllocationLib
diff --git a/Platform/BroxtonPlatformPkg/Common/SampleCode/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.uni b/Platform/BroxtonPlatformPkg/Common/SampleCode/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.uni Binary files differindex 5dd1545aa7..e08347d80d 100644 --- a/Platform/BroxtonPlatformPkg/Common/SampleCode/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.uni +++ b/Platform/BroxtonPlatformPkg/Common/SampleCode/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.uni diff --git a/Platform/BroxtonPlatformPkg/Common/SampleCode/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxeExtra.uni b/Platform/BroxtonPlatformPkg/Common/SampleCode/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxeExtra.uni Binary files differindex 997aba5a6e..5ec8085692 100644 --- a/Platform/BroxtonPlatformPkg/Common/SampleCode/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxeExtra.uni +++ b/Platform/BroxtonPlatformPkg/Common/SampleCode/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxeExtra.uni |