]> git.proxmox.com Git - mirror_edk2.git/blame - ArmRealViewEbPkg/MemoryInitPei/MemoryInit.c
Enhance EDKII Browser to support flexible HotKey setting.
[mirror_edk2.git] / ArmRealViewEbPkg / MemoryInitPei / MemoryInit.c
CommitLineData
afdfe8f0 1/**@file\r
2\r
3Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
4This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 MemoryInit.c\r
15 \r
16Abstract:\r
17\r
18 PEIM to provide fake memory init\r
19\r
20**/\r
21\r
22\r
23\r
24//\r
25// The package level header files this module uses\r
26//\r
27#include <PiPei.h>\r
28//\r
29// The protocols, PPI and GUID defintions for this module\r
30//\r
31#include <Ppi/MasterBootMode.h>\r
32#include <Ppi/BootInRecoveryMode.h>\r
33//\r
34// The Library classes this module consumes\r
35//\r
36#include <Library/DebugLib.h>\r
37#include <Library/PeimEntryPoint.h>\r
38#include <Library/PcdLib.h>\r
39#include <Library/HobLib.h>\r
40#include <Library/PeiServicesLib.h>\r
41\r
42\r
43//\r
44// Module globals\r
45//\r
46\r
47EFI_STATUS\r
48EFIAPI\r
49InitializeMemory (\r
50 IN EFI_PEI_FILE_HANDLE FileHandle,\r
51 IN CONST EFI_PEI_SERVICES **PeiServices\r
52 )\r
53/*++\r
54\r
55Routine Description:\r
56\r
57 \r
58\r
59Arguments:\r
60\r
61 FileHandle - Handle of the file being invoked.\r
62 PeiServices - Describes the list of possible PEI Services.\r
63 \r
64Returns:\r
65\r
66 Status - EFI_SUCCESS if the boot mode could be set\r
67\r
68--*/\r
69{\r
70 EFI_STATUS Status;\r
71 EFI_RESOURCE_ATTRIBUTE_TYPE Attributes;\r
72 UINT64 MemoryBase;\r
73 UINT64 MemorySize;\r
74\r
75 DEBUG ((EFI_D_ERROR, "Memory Init PEIM Loaded\n"));\r
76\r
77 // NOTE: this needs to come from your memory controller initization process\r
78 MemoryBase = 0;\r
79 MemorySize = 0x10000000;\r
80\r
81 DEBUG ((EFI_D_ERROR, "Installing hardcoded 256MB\n"));\r
82 Status = PeiServicesInstallPeiMemory (MemoryBase, MemorySize);\r
83 ASSERT_EFI_ERROR (Status);\r
84 \r
85 Attributes =\r
86 (\r
87 EFI_RESOURCE_ATTRIBUTE_PRESENT |\r
88 EFI_RESOURCE_ATTRIBUTE_INITIALIZED |\r
89 EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |\r
90 EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |\r
91 EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |\r
92 EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE |\r
93 EFI_RESOURCE_ATTRIBUTE_TESTED\r
94 );\r
95 \r
96 BuildResourceDescriptorHob (\r
97 EFI_RESOURCE_SYSTEM_MEMORY,\r
98 Attributes,\r
99 MemoryBase,\r
100 MemorySize\r
101 );\r
102\r
103 return Status;\r
104}\r