2010-02-24 00:58:38 +01:00
|
|
|
## @file
|
2009-05-27 23:10:18 +02:00
|
|
|
# Platform PEI driver
|
|
|
|
#
|
|
|
|
# This module provides platform specific function to detect boot mode.
|
2011-08-05 17:43:05 +02:00
|
|
|
# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
|
2009-05-27 23:10:18 +02:00
|
|
|
#
|
2010-04-28 14:43:04 +02:00
|
|
|
# This program and the accompanying materials
|
2009-05-27 23:10:18 +02:00
|
|
|
# are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
# which accompanies this distribution. The full text of the license may be found at
|
|
|
|
# http://opensource.org/licenses/bsd-license.php
|
|
|
|
#
|
|
|
|
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
#
|
2010-02-24 00:58:38 +01:00
|
|
|
##
|
2009-05-27 23:10:18 +02:00
|
|
|
|
|
|
|
[Defines]
|
|
|
|
INF_VERSION = 0x00010005
|
|
|
|
BASE_NAME = PlatformPei
|
|
|
|
FILE_GUID = 222c386d-5abc-4fb4-b124-fbb82488acf4
|
|
|
|
MODULE_TYPE = PEIM
|
|
|
|
VERSION_STRING = 1.0
|
|
|
|
ENTRY_POINT = InitializePlatform
|
|
|
|
|
|
|
|
#
|
|
|
|
# The following information is for reference only and not required by the build tools.
|
|
|
|
#
|
|
|
|
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
|
|
|
|
#
|
|
|
|
|
2010-01-30 01:10:44 +01:00
|
|
|
[Sources]
|
2009-05-27 23:10:18 +02:00
|
|
|
Cmos.c
|
|
|
|
Fv.c
|
|
|
|
MemDetect.c
|
|
|
|
Platform.c
|
2011-08-05 17:43:05 +02:00
|
|
|
Xen.c
|
2009-05-27 23:10:18 +02:00
|
|
|
|
|
|
|
[Packages]
|
|
|
|
MdePkg/MdePkg.dec
|
|
|
|
MdeModulePkg/MdeModulePkg.dec
|
2011-10-28 08:04:01 +02:00
|
|
|
UefiCpuPkg/UefiCpuPkg.dec
|
2009-05-27 23:10:18 +02:00
|
|
|
OvmfPkg/OvmfPkg.dec
|
|
|
|
|
|
|
|
[Guids]
|
|
|
|
gEfiMemoryTypeInformationGuid
|
2011-08-05 17:43:05 +02:00
|
|
|
gEfiXenInfoGuid
|
2009-05-27 23:10:18 +02:00
|
|
|
|
|
|
|
[LibraryClasses]
|
|
|
|
DebugLib
|
|
|
|
HobLib
|
|
|
|
IoLib
|
2011-01-13 06:46:24 +01:00
|
|
|
PciLib
|
2009-05-27 23:10:18 +02:00
|
|
|
PeiResourcePublicationLib
|
2011-03-22 02:55:08 +01:00
|
|
|
PeiServicesLib
|
2009-05-27 23:10:18 +02:00
|
|
|
PeiServicesTablePointerLib
|
|
|
|
PeimEntryPoint
|
2011-10-28 08:04:01 +02:00
|
|
|
MtrrLib
|
2012-07-31 20:17:37 +02:00
|
|
|
PcdLib
|
2009-05-27 23:10:18 +02:00
|
|
|
|
2010-01-30 01:10:44 +01:00
|
|
|
[Pcd]
|
2010-01-04 17:17:59 +01:00
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfMemFvBase
|
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfMemFvSize
|
OvmfPkg: enable PIIX4 IO space in the PEI phase
I. There are at least three locations in OvmfPkg that manipulate the PMBA
and related PIIX4 registers.
1. MiscInitialization() [OvmfPkg/PlatformPei/Platform.c]
module type: PEIM -- Pre-EFI Initialization Module
(a) currently sets the PMBA only: 00.01.3 / 0x40 bits [15:6]
2. AcpiTimerLibConstructor() [OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.c]
module type: BASE -- probably callable anywhere after PEI
(a) sets the PMBA if needed: 00.01.3 / 0x40 bits [15:6]
(b) sets PCICMD/IOSE if needed: 00.01.3 / 0x04 bit 0
(c) sets PMREGMISC/PMIOSE: 00.01.3 / 0x80 bit 0
3. AcpiInitialization() [OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c]
module type: DXE_DRIVER -- Driver eXecution Environment
(a) sets SCI_EN, which depends on correct PMBA setting from earlier
(
The relative order of #1 and #3 is dictated minimally by their module
types. Said relative order can be verified with the boot log:
27 Loading PEIM at 0x00000822320 EntryPoint=0x00000822580
PlatformPei.efi
28 Platform PEIM Loaded
1259 PlatformBdsInit
1270 PlatformBdsPolicyBehavior
Line 28 is printed by InitializePlatform()
[OvmfPkg/PlatformPei/Platform.c] which is the entry point of that
module. The other two lines are printed by the corresponding functions
in "OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c".
)
Currently #2 (AcpiTimerLibConstructor()) is called in a random spot
(whenever it gets loaded from the firmware image) and masks the
insufficient setup in #1. We shouldn't depend on that, PEI should finish
with IO space being fully accessibe. In addition, PEI should program the
same PMBA value as AcpiTimerLib.
II. The PEI change notwithstanding, AcpiTimerLib should stay defensive and
ensure proper PM configuration for itself (either by confirming or by
doing).
III. Considering a possible cleanup/unification of #2 and #3: timer
functions relying on AcpiTimerLibConstructor(),
- MicroSecondDelay()
- NanoSecondDelay()
- GetPerformanceCounter()
- GetPerformanceCounterProperties()
- GetTimeInNanoSecond()
may be called before #3 is reached (in Boot Device Selection phase), so we
should not move the initialization from #2 to #3. (Again, AcpiTimerLib
should contain its own setup.)
We should also not move #3 to an earlier phase -- SCI_EN is premature
unless we're about to boot real soon ("enable generation of SCI upon
assertion of PWRBTN_STS, LID_STS, THRM_STS, or GPI_STS bits").
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13722 6f19259b-4bc3-4df7-8a09-765794883524
2012-09-12 09:19:16 +02:00
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdAcpiPmBaseAddress
|
2009-05-27 23:10:18 +02:00
|
|
|
gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize
|
|
|
|
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
|
|
|
|
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
|
2009-09-07 22:18:17 +02:00
|
|
|
gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved
|
2012-07-31 20:17:37 +02:00
|
|
|
gUefiCpuPkgTokenSpaceGuid.PcdCpuLocalApicBaseAddress
|
2009-05-27 23:10:18 +02:00
|
|
|
|
2011-03-22 02:55:08 +01:00
|
|
|
[Ppis]
|
|
|
|
gEfiPeiMasterBootModePpiGuid
|
|
|
|
|
2009-05-27 23:10:18 +02:00
|
|
|
[Depex]
|
|
|
|
TRUE
|
|
|
|
|