Acidanthera UEFI Development Kit based on EDK II edk2-stable202311
Go to file
jljusten 931a0c74ed 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 07:19:16 +00:00
AppPkg Update copyright format 2012-04-24 06:49:39 +00:00
ArmPkg ArmPkg: Changed Uncached System Memory from EFI_MEMORY_UC to EFI_MEMORY_WC 2012-08-31 16:24:01 +00:00
ArmPlatformPkg ArmPlatformPkg/Bds: Fixed device path of the default error output device 2012-08-08 16:47:51 +00:00
BaseTools Roll back the changes for BaseTools 2012-06-25 02:24:12 +00:00
BeagleBoardPkg ArmPlatformPkg: Fixed ArmRealViewEb & BeagleBoard builds 2012-08-02 18:21:16 +00:00
Conf
CryptoPkg Fix PeiCryptLib build issue. 2012-08-23 03:31:00 +00:00
DuetPkg Fix comparisons of enumerated types which may cause warnings for some compilers. 2012-08-28 06:48:28 +00:00
EdkCompatibilityPkg Fix comparisons of enumerated types which may cause warnings for some compilers. 2012-08-28 06:48:28 +00:00
EdkShellBinPkg New EDK Shell binary(r59). 2012-05-30 09:08:33 +00:00
EdkShellPkg EdkShellPkg/ShellR33.patch: Fixed '32'2' folder names 2012-06-22 18:47:06 +00:00
EmbeddedPkg EmbeddedPkg/MmcDxe: The timeout while waiting for the programming to be complete was decreased twice. 2012-08-31 16:29:23 +00:00
EmulatorPkg EmulatorPkg/PlatformSmbiosDxe: Fix build issue with UNIXGCC 2012-08-28 21:21:57 +00:00
FatBinPkg FatBinPkg/License.txt: Sync with License.txt in FatPkg 2012-04-11 23:19:56 +00:00
IntelFrameworkModulePkg Set mode 0 (80x25) when Consplitter does not exist. 2012-09-04 09:43:22 +00:00
IntelFrameworkPkg Update copyright format 2012-04-24 06:49:39 +00:00
MdeModulePkg Enhance the check for options in the question. 2012-09-10 08:29:32 +00:00
MdePkg Enhance the error code info. 2012-09-11 10:53:37 +00:00
NetworkPkg Fix bugs in PXE driver when using option 43 for boot server list and boot menu prompt. 2012-08-24 08:25:42 +00:00
Nt32Pkg Change the type of NotifyHandle from EFI_HANDLE to VOID * for SimpleTextInEx protocol. 2012-07-30 03:50:42 +00:00
Omap35xxPkg EDK II Packages: Added License.txt files 2012-04-12 16:40:32 +00:00
OptionRomPkg Fix comparisons of enumerated types which may cause warnings for some compilers. 2012-08-28 06:48:28 +00:00
OvmfPkg OvmfPkg: enable PIIX4 IO space in the PEI phase 2012-09-12 07:19:16 +00:00
PcAtChipsetPkg Fix comparisons of enumerated types which may cause warnings for some compilers. 2012-08-28 06:48:28 +00:00
PerformancePkg Fixed build failed. 2012-05-31 08:35:48 +00:00
SecurityPkg Fix compile error 2012-09-12 01:23:04 +00:00
ShellBinPkg ShellBinPkg: Update binary images to those made from revision 13224 of ShellPkg. 2012-05-30 20:10:20 +00:00
ShellPkg Refine code to make it more safely. 2012-09-10 09:35:43 +00:00
SourceLevelDebugPkg This revision can only work with Intel(c) UDK Debugger Tool version 1.2 or greater. Detailed change log is as below: 2012-06-11 02:15:11 +00:00
StdLib Modify UDP and IP to transmit on all network adapters instead of just the first network adapter. 2012-09-10 19:04:41 +00:00
StdLibPrivateInternalFiles StdLib: Add multi-byte character support. The normal "narrow" character set is now UTF-8 instead of ASCII. 2012-06-15 19:58:39 +00:00
UefiCpuPkg Add type cast to avoid sign extension on x64 tip. 2012-09-10 02:36:17 +00:00
UnixPkg Change the type of NotifyHandle from EFI_HANDLE to VOID * for SimpleTextInEx protocol. 2012-07-30 03:50:42 +00:00
BuildNotes2.txt Update EDKII BuildNotes to say the default tool chain tag is VS2008 instead of VS2005 2011-12-14 06:15:48 +00:00
edksetup.bat Added VS2010 support in edksetup script. 2012-04-10 07:45:35 +00:00
edksetup.sh Correct copyright year 2011-02-16 12:21:31 +00:00