+++ /dev/null
-/** @file\r
- This file defines Pei memory test PPI used to perform memory test in PEI phase.\r
-\r
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#ifndef __BASE_MEMORY_TEST_H__\r
-#define __BASE_MEMORY_TEST_H__\r
-\r
-#define PEI_BASE_MEMORY_TEST_GUID \\r
- { 0xb6ec423c, 0x21d2, 0x490d, {0x85, 0xc6, 0xdd, 0x58, 0x64, 0xea, 0xa6, 0x74 } }\r
-\r
-typedef struct _PEI_BASE_MEMORY_TEST_PPI PEI_BASE_MEMORY_TEST_PPI;\r
-\r
-///\r
-/// Pei Memory test operations\r
-/// Ignore op not test memory, Quick and Sparse op test memory quickly, Extensive op test memory detailedly.\r
-///\r
-typedef enum {\r
- Ignore,\r
- Quick,\r
- Sparse,\r
- Extensive\r
-} PEI_MEMORY_TEST_OP;\r
-\r
-/**\r
- Test a range memory space that is ready to read and write.\r
- If the memory is not ready, the error memory address will be returned.\r
-\r
- @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
- @param This Pointer to Pei memory test PPI instance.\r
- @param BeginAddress Beginning of the memory address to be checked.\r
- @param MemoryLength Bytes of memory range to be checked.\r
- @param Operation Type of memory check operation to be performed.\r
- @param ErrorAddress Address of memory where the error is checked.\r
-\r
- @retval EFI_SUCCESS Memory range pass basic read and write test.\r
- @retval EFI_DEVICE_ERROR Memory is not ready to access.\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *PEI_BASE_MEMORY_TEST)(\r
- IN EFI_PEI_SERVICES **PeiServices,\r
- IN PEI_BASE_MEMORY_TEST_PPI * This,\r
- IN EFI_PHYSICAL_ADDRESS BeginAddress,\r
- IN UINT64 MemoryLength,\r
- IN PEI_MEMORY_TEST_OP Operation,\r
- OUT EFI_PHYSICAL_ADDRESS * ErrorAddress\r
- );\r
-\r
-struct _PEI_BASE_MEMORY_TEST_PPI {\r
- PEI_BASE_MEMORY_TEST BaseMemoryTest;\r
-};\r
-\r
-extern EFI_GUID gPeiBaseMemoryTestPpiGuid;\r
-\r
-#endif\r
## Include/Protocol/HotPlugDevice.h\r
gEfiHotPlugDeviceGuid = { 0x220AC432, 0x1D43, 0x49E5, { 0xA7, 0x4F, 0x4C, 0x9D, 0xA6, 0x7A, 0xD2, 0x3B }}\r
\r
-[Ppis.common]\r
- ## Pei memory test PPI used to Perform memory test in PEI phase.\r
- ## Include/Ppi/BaseMemoryTest.h\r
- gPeiBaseMemoryTestPpiGuid = { 0xB6EC423C, 0x21D2, 0x490D, { 0x85, 0xC6, 0xDD, 0x58, 0x64, 0xEA, 0xA6, 0x74 }}\r
-\r
[PcdsFeatureFlag.common]\r
## Indicate whether platform can support update capsule across a system reset\r
gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleReset|FALSE|BOOLEAN|0x0001001d\r
MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf\r
MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteDxe/FtwLite.inf\r
MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf\r
- MdeModulePkg/Universal/MemoryTest/BaseMemoryTestPei/BaseMemoryTestPei.inf\r
MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf\r
MdeModulePkg/Universal/Metronome/Metronome.inf\r
MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf\r
+++ /dev/null
-/** @file\r
- Support of memory test in PEI Phase.\r
-\r
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "BaseMemoryTest.h"\r
-\r
-PEI_BASE_MEMORY_TEST_PPI mPeiBaseMemoryTestPpi = {\r
- BaseMemoryTest\r
-};\r
-\r
-EFI_PEI_PPI_DESCRIPTOR PpiListPeiBaseMemoryTest = {\r
- (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
- &gPeiBaseMemoryTestPpiGuid,\r
- &mPeiBaseMemoryTestPpi\r
-};\r
-\r
-/**\r
- Entry point of BaseMemoryTestPei PEIM.\r
-\r
- This function is the entry point of BaseMemoryTestPei PEIM.\r
- It installs the PEI_BASE_MEMORY_TEST_PPI.\r
-\r
- @param FileHandle Handle of the file being invoked.\r
- @param PeiServices Describes the list of possible PEI Services.\r
-\r
- @retval EFI_SUCCESS PEI_BASE_MEMORY_TEST_PPI is successfully installed.\r
- @retval Others PEI_BASE_MEMORY_TEST_PPI is not successfully installed.\r
-\r
-**/ \r
-EFI_STATUS\r
-EFIAPI\r
-PeiBaseMemoryTestInit (\r
- IN EFI_PEI_FILE_HANDLE FileHandle,\r
- IN CONST EFI_PEI_SERVICES **PeiServices\r
- )\r
-{\r
- return PeiServicesInstallPpi (&PpiListPeiBaseMemoryTest);\r
- \r
-}\r
-\r
-/**\r
- Test base memory.\r
-\r
- @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
- @param This Pointer to this PPI instance.\r
- @param BeginAddress Beginning of the memory address to be checked.\r
- @param MemoryLength Bytes of memory range to be checked.\r
- @param Operation Type of memory check operation to be performed.\r
- @param ErrorAddress Pointer to address of the error memory returned.\r
-\r
- @retval EFI_SUCCESS Memory test passed.\r
- @retval EFI_DEVICE_ERROR Memory test failed.\r
-\r
-**/ \r
-EFI_STATUS\r
-EFIAPI\r
-BaseMemoryTest (\r
- IN EFI_PEI_SERVICES **PeiServices,\r
- IN PEI_BASE_MEMORY_TEST_PPI *This,\r
- IN EFI_PHYSICAL_ADDRESS BeginAddress,\r
- IN UINT64 MemoryLength,\r
- IN PEI_MEMORY_TEST_OP Operation,\r
- OUT EFI_PHYSICAL_ADDRESS *ErrorAddress\r
- )\r
-{\r
- UINT32 TestPattern;\r
- EFI_PHYSICAL_ADDRESS TempAddress;\r
- UINT32 SpanSize;\r
-\r
- REPORT_STATUS_CODE (EFI_PROGRESS_CODE, PcdGet32 (PcdStatusCodeValueMemoryTestStarted));\r
-\r
- TestPattern = TEST_PATTERN;\r
- SpanSize = 0;\r
-\r
- //\r
- // Make sure we don't try and test anything above the max physical address range\r
- //\r
- ASSERT (BeginAddress + MemoryLength < MAX_ADDRESS);\r
-\r
- switch (Operation) {\r
- case Extensive:\r
- //\r
- // Extensive means full and detailed check,\r
- // so use small span size to cover the entire test range.\r
- //\r
- SpanSize = 0x4;\r
- break;\r
-\r
- case Sparse:\r
- case Quick:\r
- //\r
- // Sparse and Quick indicates quick test,\r
- // so use large span size for sample test.\r
- //\r
- SpanSize = COVER_SPAN;\r
- break;\r
-\r
- case Ignore:\r
- //\r
- // Ignore means no test.\r
- //\r
- goto Done;\r
- break;\r
- }\r
- //\r
- // Write the test pattern into memory range\r
- //\r
- TempAddress = BeginAddress;\r
- while (TempAddress < BeginAddress + MemoryLength) {\r
- (*(UINT32 *) (UINTN) TempAddress) = TestPattern;\r
- TempAddress += SpanSize;\r
- }\r
- //\r
- // Read pattern from memory and compare it\r
- //\r
- TempAddress = BeginAddress;\r
- while (TempAddress < BeginAddress + MemoryLength) {\r
- if ((*(UINT32 *) (UINTN) TempAddress) != TestPattern) {\r
- //\r
- // Value read back does not equal to the value written, so error is detected.\r
- //\r
- *ErrorAddress = TempAddress;\r
- REPORT_STATUS_CODE (EFI_ERROR_CODE | EFI_ERROR_UNRECOVERED, PcdGet32 (PcdStatusCodeValueUncorrectableMemoryError));\r
-\r
- return EFI_DEVICE_ERROR;\r
- }\r
-\r
- TempAddress += SpanSize;\r
- }\r
-\r
-Done:\r
- return EFI_SUCCESS;\r
-}\r
+++ /dev/null
-/** @file\r
- Internal include file for support of memory test in PEI Phase.\r
-\r
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#ifndef _PEI_BASE_MEMORY_TEST_H_\r
-#define _PEI_BASE_MEMORY_TEST_H_\r
-\r
-#include <PiPei.h>\r
-#include <Ppi/BaseMemoryTest.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/PeimEntryPoint.h>\r
-#include <Library/ReportStatusCodeLib.h>\r
-#include <Library/PcdLib.h>\r
-#include <Library/PeiServicesLib.h>\r
-\r
-#define COVER_SPAN 0x40000\r
-#define TEST_PATTERN 0x5A5A5A5A\r
-\r
-/**\r
- Test base memory.\r
-\r
- @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
- @param This Pointer to this PPI instance.\r
- @param BeginAddress Beginning of the memory address to be checked.\r
- @param MemoryLength Bytes of memory range to be checked.\r
- @param Operation Type of memory check operation to be performed.\r
- @param ErrorAddress Pointer to address of the error memory returned.\r
-\r
- @retval EFI_SUCCESS Memory test passed.\r
- @retval EFI_DEVICE_ERROR Memory test failed.\r
-\r
-**/ \r
-EFI_STATUS\r
-EFIAPI\r
-BaseMemoryTest (\r
- IN EFI_PEI_SERVICES **PeiServices,\r
- IN PEI_BASE_MEMORY_TEST_PPI *This,\r
- IN EFI_PHYSICAL_ADDRESS BeginAddress,\r
- IN UINT64 MemoryLength,\r
- IN PEI_MEMORY_TEST_OP Operation,\r
- OUT EFI_PHYSICAL_ADDRESS *ErrorAddress\r
- );\r
-\r
-#endif\r
+++ /dev/null
-#/** @file\r
-# This PEIM provides Base Memory Test PPI for memory test in PEI Phase.\r
-# \r
-# Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
-# All rights reserved. This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-# \r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
-#**/\r
-\r
-[Defines]\r
- INF_VERSION = 0x00010005\r
- BASE_NAME = BaseMemoryTestPei\r
- FILE_GUID = 736EB068-8C01-47c5-964B-1C57BD5D4D64\r
- MODULE_TYPE = PEIM\r
- VERSION_STRING = 1.0\r
- ENTRY_POINT = PeiBaseMemoryTestInit\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-# VALID_ARCHITECTURES = IA32 X64 IPF EBC (EBC is for build only)\r
-#\r
-\r
-[Sources.common]\r
- BaseMemoryTest.c\r
- BaseMemoryTest.h\r
-\r
-[Packages]\r
- MdePkg/MdePkg.dec\r
- MdeModulePkg/MdeModulePkg.dec\r
-\r
-[LibraryClasses]\r
- ReportStatusCodeLib\r
- PeimEntryPoint\r
- DebugLib\r
- PeiServicesLib\r
-\r
-[Ppis]\r
- gPeiBaseMemoryTestPpiGuid ## PRODUCES\r
-\r
-[FixedPcd.common]\r
- gEfiMdePkgTokenSpaceGuid.PcdStatusCodeValueMemoryTestStarted\r
- gEfiMdePkgTokenSpaceGuid.PcdStatusCodeValueUncorrectableMemoryError\r
-\r
IntelFrameworkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.inf\r
Nt32Pkg/BootModePei/BootModePei.inf\r
Nt32Pkg/WinNtFlashMapPei/WinNtFlashMapPei.inf\r
- MdeModulePkg/Universal/MemoryTest/BaseMemoryTestPei/BaseMemoryTestPei.inf\r
MdeModulePkg/Universal/Variable/Pei/VariablePei.inf\r
Nt32Pkg/WinNtAutoScanPei/WinNtAutoScanPei.inf\r
Nt32Pkg/WinNtFirmwareVolumePei/WinNtFirmwareVolumePei.inf\r
INF IntelFrameworkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.inf\r
INF Nt32Pkg/BootModePei/BootModePei.inf\r
INF Nt32Pkg/WinNtFlashMapPei/WinNtFlashMapPei.inf\r
-INF MdeModulePkg/Universal/MemoryTest/BaseMemoryTestPei/BaseMemoryTestPei.inf\r
INF Nt32Pkg/WinNtAutoScanPei/WinNtAutoScanPei.inf\r
INF Nt32Pkg/WinNtFirmwareVolumePei/WinNtFirmwareVolumePei.inf\r
INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf\r
//\r
// The protocols, PPI and GUID defintions for this module\r
//\r
-#include <Ppi/BaseMemoryTest.h>\r
#include <Ppi/NtAutoscan.h>\r
//\r
// The Library classes this module consumes\r
PEI_NT_AUTOSCAN_PPI *PeiNtService;\r
UINT64 MemorySize;\r
EFI_PHYSICAL_ADDRESS MemoryBase;\r
- PEI_BASE_MEMORY_TEST_PPI *MemoryTestPpi;\r
- EFI_PHYSICAL_ADDRESS ErrorAddress;\r
UINTN Index;\r
EFI_RESOURCE_ATTRIBUTE_TYPE Attributes;\r
\r
);\r
ASSERT_EFI_ERROR (Status);\r
\r
- //\r
- // Get the Memory Test PPI\r
- //\r
- Status = PeiServicesLocatePpi (\r
- &gPeiBaseMemoryTestPpiGuid,\r
- 0,\r
- NULL,\r
- (VOID**)&MemoryTestPpi\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
-\r
Index = 0;\r
do {\r
Status = PeiNtService->NtAutoScan (Index, &MemoryBase, &MemorySize);\r
\r
if (Index == 0) {\r
//\r
- // For the first area register it as PEI tested memory\r
- //\r
- Status = MemoryTestPpi->BaseMemoryTest (\r
- (EFI_PEI_SERVICES **) PeiServices,\r
- MemoryTestPpi,\r
- MemoryBase,\r
- MemorySize,\r
- Quick,\r
- &ErrorAddress\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
-\r
- //\r
- // Register the "tested" memory with the PEI Core\r
+ // Register the memory with the PEI Core\r
//\r
Status = PeiServicesInstallPeiMemory (MemoryBase, MemorySize);\r
ASSERT_EFI_ERROR (Status);\r
PeiServicesLib\r
\r
[Ppis]\r
- gPeiBaseMemoryTestPpiGuid # PPI ALWAYS_CONSUMED\r
gPeiNtAutoScanPpiGuid # PPI ALWAYS_CONSUMED\r
\r
[depex]\r
- gPeiNtAutoScanPpiGuid AND gEfiPeiMasterBootModePpiGuid AND gPeiBaseMemoryTestPpiGuid\r
+ gPeiNtAutoScanPpiGuid AND gEfiPeiMasterBootModePpiGuid\r
\r
#include "PiPei.h"\r
#include <Ppi/UnixAutoScan.h>\r
-#include <Ppi/BaseMemoryTest.h>\r
#include <Ppi/MemoryDiscovered.h>\r
\r
#include <Library/DebugLib.h>\r
PEI_UNIX_AUTOSCAN_PPI *PeiUnixService;\r
UINT64 MemorySize;\r
EFI_PHYSICAL_ADDRESS MemoryBase;\r
- PEI_BASE_MEMORY_TEST_PPI *MemoryTestPpi;\r
- EFI_PHYSICAL_ADDRESS ErrorAddress;\r
UINTN Index;\r
EFI_RESOURCE_ATTRIBUTE_TYPE Attributes;\r
\r
);\r
ASSERT_EFI_ERROR (Status);\r
\r
- //\r
- // Get the Memory Test PPI\r
- //\r
- Status = PeiServicesLocatePpi (\r
- &gPeiBaseMemoryTestPpiGuid,\r
- 0,\r
- NULL,\r
- (VOID**)&MemoryTestPpi\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
-\r
Index = 0;\r
do {\r
Status = PeiUnixService->UnixAutoScan (Index, &MemoryBase, &MemorySize);\r
\r
if (Index == 0) {\r
//\r
- // For the first area register it as PEI tested memory\r
- //\r
- Status = MemoryTestPpi->BaseMemoryTest (\r
- (EFI_PEI_SERVICES **) PeiServices,\r
- MemoryTestPpi,\r
- MemoryBase,\r
- MemorySize,\r
- Quick,\r
- &ErrorAddress\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
-\r
- //\r
- // Register the "tested" memory with the PEI Core\r
+ // Register the memory with the PEI Core\r
//\r
Status = PeiServicesInstallPeiMemory (MemoryBase, MemorySize);\r
ASSERT_EFI_ERROR (Status);\r
\r
[Ppis]\r
gEfiPeiMemoryDiscoveredPpiGuid # PPI ALWAYS_PRODUCED\r
- gPeiBaseMemoryTestPpiGuid # PPI ALWAYS_CONSUMED\r
gPeiUnixAutoScanPpiGuid # PPI ALWAYS_CONSUMED\r
\r
\r
[Depex]\r
- gPeiUnixAutoScanPpiGuid AND gEfiPeiMasterBootModePpiGuid AND gPeiBaseMemoryTestPpiGuid\r
+ gPeiUnixAutoScanPpiGuid AND gEfiPeiMasterBootModePpiGuid\r
\r
IntelFrameworkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.inf\r
UnixPkg/BootModePei/BootModePei.inf\r
UnixPkg/UnixFlashMapPei/FlashMap.inf\r
- MdeModulePkg/Universal/MemoryTest/BaseMemoryTestPei/BaseMemoryTestPei.inf\r
MdeModulePkg/Universal/Variable/Pei/VariablePei.inf\r
UnixPkg/UnixAutoScanPei/UnixAutoScan.inf\r
UnixPkg/UnixFirmwareVolumePei/UnixFwh.inf\r
INF IntelFrameworkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.inf\r
INF UnixPkg/BootModePei/BootModePei.inf\r
INF UnixPkg/UnixFlashMapPei/FlashMap.inf\r
-INF MdeModulePkg/Universal/MemoryTest/BaseMemoryTestPei/BaseMemoryTestPei.inf\r
INF UnixPkg/UnixAutoScanPei/UnixAutoScan.inf\r
INF UnixPkg/UnixFirmwareVolumePei/UnixFwh.inf\r
INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf\r