#include <Library/ResourcePublicationLib.h>\r
#include <Guid/MemoryTypeInformation.h>\r
#include <Ppi/MasterBootMode.h>\r
+#include <IndustryStandard/Pci22.h>\r
\r
#include "Platform.h"\r
#include "Cmos.h"\r
\r
if (!Xen) {\r
//\r
- // Set the PM I/O base address to 0x400\r
+ // The PEI phase should be exited with fully accessibe PIIX4 IO space:\r
+ // 1. set PMBA\r
//\r
- PciAndThenOr32 (PCI_LIB_ADDRESS (0, 1, 3, 0x40), (UINT32) ~0xFFC0, 0x400);\r
+ PciAndThenOr32 (\r
+ PCI_LIB_ADDRESS (0, 1, 3, 0x40),\r
+ (UINT32) ~0xFFC0,\r
+ PcdGet16 (PcdAcpiPmBaseAddress)\r
+ );\r
+\r
+ //\r
+ // 2. set PCICMD/IOSE\r
+ //\r
+ PciOr8 (\r
+ PCI_LIB_ADDRESS (0, 1, 3, PCI_COMMAND_OFFSET),\r
+ EFI_PCI_COMMAND_IO_SPACE\r
+ );\r
+\r
+ //\r
+ // 3. set PMREGMISC/PMIOSE\r
+ //\r
+ PciOr8 (PCI_LIB_ADDRESS (0, 1, 3, 0x80), 0x01);\r
}\r
}\r
\r