+++ /dev/null
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-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
-Module Name:\r
-\r
- MemoryInit.c\r
- \r
-Abstract:\r
-\r
- PEIM to provide fake memory init\r
-\r
-**/\r
-\r
-\r
-\r
-//\r
-// The package level header files this module uses\r
-//\r
-#include <PiPei.h>\r
-//\r
-// The protocols, PPI and GUID defintions for this module\r
-//\r
-#include <Ppi/MasterBootMode.h>\r
-#include <Ppi/BootInRecoveryMode.h>\r
-//\r
-// The Library classes this module consumes\r
-//\r
-#include <Library/DebugLib.h>\r
-#include <Library/PeimEntryPoint.h>\r
-#include <Library/PcdLib.h>\r
-#include <Library/HobLib.h>\r
-#include <Library/PeiServicesLib.h>\r
-\r
-\r
-//\r
-// Module globals\r
-//\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeMemory (\r
- IN EFI_PEI_FILE_HANDLE FileHandle,\r
- IN CONST EFI_PEI_SERVICES **PeiServices\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- \r
-\r
-Arguments:\r
-\r
- FileHandle - Handle of the file being invoked.\r
- PeiServices - Describes the list of possible PEI Services.\r
- \r
-Returns:\r
-\r
- Status - EFI_SUCCESS if the boot mode could be set\r
-\r
---*/\r
-{\r
- EFI_STATUS Status;\r
- EFI_RESOURCE_ATTRIBUTE_TYPE Attributes;\r
- UINT64 MemoryBase;\r
- UINT64 MemorySize;\r
-\r
- DEBUG ((EFI_D_ERROR, "Memory Init PEIM Loaded\n"));\r
-\r
- // NOTE: this needs to come from your memory controller initization process\r
- MemoryBase = 0;\r
- MemorySize = 0x10000000;\r
-\r
- DEBUG ((EFI_D_ERROR, "Installing hardcoded 256MB\n"));\r
- Status = PeiServicesInstallPeiMemory (MemoryBase, MemorySize);\r
- ASSERT_EFI_ERROR (Status);\r
- \r
- Attributes =\r
- (\r
- EFI_RESOURCE_ATTRIBUTE_PRESENT |\r
- EFI_RESOURCE_ATTRIBUTE_INITIALIZED |\r
- EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |\r
- EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |\r
- EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |\r
- EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE |\r
- EFI_RESOURCE_ATTRIBUTE_TESTED\r
- );\r
- \r
- BuildResourceDescriptorHob (\r
- EFI_RESOURCE_SYSTEM_MEMORY,\r
- Attributes,\r
- MemoryBase,\r
- MemorySize\r
- );\r
-\r
- return Status;\r
-}\r