4 Copyright (c) 2006 - 2009, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 // The package level header files this module uses
21 // The Library classes this module consumes
23 #include <Library/DebugLib.h>
24 #include <Library/HobLib.h>
25 #include <Library/IoLib.h>
26 #include <Library/PciLib.h>
27 #include <Library/PeimEntryPoint.h>
28 #include <Library/ResourcePublicationLib.h>
29 #include <Guid/MemoryTypeInformation.h>
33 EFI_MEMORY_TYPE_INFORMATION mDefaultMemoryTypeInformation
[] = {
34 { EfiACPIMemoryNVS
, 0x004 },
35 { EfiACPIReclaimMemory
, 0x01C },
36 { EfiRuntimeServicesData
, 0x050 },
37 { EfiRuntimeServicesCode
, 0x020 },
38 { EfiBootServicesCode
, 0x0F0 },
39 { EfiBootServicesData
, 0xA00 },
40 { EfiMaxMemoryType
, 0x000 }
45 AddIoMemoryBaseSizeHob (
46 EFI_PHYSICAL_ADDRESS MemoryBase
,
50 STATIC EFI_RESOURCE_ATTRIBUTE_TYPE Attributes
=
52 EFI_RESOURCE_ATTRIBUTE_PRESENT
|
53 EFI_RESOURCE_ATTRIBUTE_INITIALIZED
|
54 EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE
|
55 EFI_RESOURCE_ATTRIBUTE_TESTED
58 BuildResourceDescriptorHob (
59 EFI_RESOURCE_MEMORY_MAPPED_IO
,
69 EFI_PHYSICAL_ADDRESS MemoryBase
,
70 EFI_PHYSICAL_ADDRESS MemoryLimit
73 AddIoMemoryBaseSizeHob (MemoryBase
, (UINT64
)(MemoryLimit
- MemoryBase
));
78 AddMemoryBaseSizeHob (
79 EFI_PHYSICAL_ADDRESS MemoryBase
,
83 STATIC EFI_RESOURCE_ATTRIBUTE_TYPE Attributes
=
85 EFI_RESOURCE_ATTRIBUTE_PRESENT
|
86 EFI_RESOURCE_ATTRIBUTE_INITIALIZED
|
87 EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE
|
88 EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE
|
89 EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE
|
90 EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE
|
91 EFI_RESOURCE_ATTRIBUTE_TESTED
94 BuildResourceDescriptorHob (
95 EFI_RESOURCE_SYSTEM_MEMORY
,
105 EFI_PHYSICAL_ADDRESS MemoryBase
,
106 EFI_PHYSICAL_ADDRESS MemoryLimit
109 AddMemoryBaseSizeHob (MemoryBase
, (UINT64
)(MemoryLimit
- MemoryBase
));
114 MemMapInitialization (
118 // Create Memory Type Information HOB
121 &gEfiMemoryTypeInformationGuid
,
122 mDefaultMemoryTypeInformation
,
123 sizeof(mDefaultMemoryTypeInformation
)
129 AddIoMemoryBaseSizeHob (0xFEC80000, 0x80000);
134 AddIoMemoryBaseSizeHob (0xFEC00000, 0x80000);
137 // Video memory + Legacy BIOS region
139 AddMemoryRangeHob (0x0A0000, 0x0B0000);
140 AddIoMemoryRangeHob (0x0B0000, 0x100000);
151 IoWrite8 (0x92, (UINT8
) (IoRead8 (0x92) | 0x02));
154 // Build the CPU hob with 36-bit addressing and 16-bits of IO space.
156 BuildCpuHob (36, 16);
161 Perform Platform PEI initialization.
163 @param FileHandle Handle of the file being invoked.
164 @param PeiServices Describes the list of possible PEI Services.
166 @return EFI_SUCCESS The PEIM initialized successfully.
172 IN EFI_PEI_FILE_HANDLE FileHandle
,
173 IN CONST EFI_PEI_SERVICES
**PeiServices
176 DEBUG ((EFI_D_ERROR
, "Platform PEIM Loaded\n"));
180 PeiFvInitialization ();
182 MemMapInitialization ();
184 MiscInitialization ();