--- /dev/null
+/** @file\r
+ This file declares PlatfromOpRom protocols.\r
+\r
+ Copyright (c) 2006, Intel Corporation \r
+ All rights reserved. This program and the accompanying materials \r
+ are licensed and made available under the terms and conditions of the BSD License \r
+ which accompanies this distribution. The full text of the license may be found at \r
+ http://opensource.org/licenses/bsd-license.php \r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+\r
+ Module Name: PciPlatform.h\r
+\r
+ @par Revision Reference:\r
+ This protocol is defined in PCI Platform Support Specification\r
+ Version 0.9\r
+\r
+**/\r
+\r
+#ifndef _PCI_PLATFORM_H_\r
+#define _PCI_PLATFORM_H_\r
+\r
+//\r
+// Protocol for GUID.\r
+//\r
+\r
+#define EFI_PCI_PLATFORM_PROTOCOL_GUID \\r
+{ 0x7d75280, 0x27d4, 0x4d69, {0x90, 0xd0, 0x56, 0x43, 0xe2, 0x38, 0xb3, 0x41} }\r
+\r
+typedef struct _EFI_PCI_PLATFORM_PROTOCOL EFI_PCI_PLATFORM_PROTOCOL;\r
+\r
+typedef UINT32 EFI_PCI_PLATFORM_POLICY;\r
+\r
+\r
+#define EFI_RESERVE_NONE_IO_ALIAS 0x0000\r
+#define EFI_RESERVE_ISA_IO_ALIAS 0x0001\r
+#define EFI_RESERVE_ISA_IO_NO_ALIAS 0x0002\r
+#define EFI_RESERVE_VGA_IO_ALIAS 0x0004\r
+#define EFI_RESERVE_VGA_IO_NO_ALIAS 0x0008\r
+\r
+\r
+typedef enum {\r
+ ChipsetEntry,\r
+ ChipsetExit,\r
+ MaximumChipsetPhase\r
+} EFI_PCI_CHIPSET_EXECUTION_PHASE;\r
+\r
+\r
+/**\r
+ The PlatformNotify() function can be used to notify the platform driver so that \r
+ it can perform platform-specific actions. No specific actions are required. \r
+ Eight notification points are defined at this time. More synchronization points \r
+ may be added as required in the future. The PCI bus driver calls the platform driver \r
+ twice for every Phase-once before the PCI Host Bridge Resource Allocation Protocol \r
+ driver is notified, and once after the PCI Host Bridge Resource Allocation Protocol \r
+ driver has been notified. \r
+ This member function may not perform any error checking on the input parameters. It \r
+ also does not return any error codes. If this member function detects any error condition, \r
+ it needs to handle those errors on its own because there is no way to surface any \r
+ errors to the caller.\r
+\r
+ @param This Pointer to the EFI_PCI_PLATFORM_PROTOCOL instance.\r
+ @param HostBridge The handle of the host bridge controller.\r
+ @param Phase The phase of the PCI bus enumeration.\r
+ @param ChipsetPhase Defines the execution phase of the PCI chipset driver.\r
+\r
+ @retval EFI_SUCCESS The function completed successfully.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_PLATFORM_PHASE_NOTIFY) (\r
+ IN EFI_PCI_PLATFORM_PROTOCOL *This,\r
+ IN EFI_HANDLE HostBridge,\r
+ IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE Phase,\r
+ IN EFI_PCI_CHIPSET_EXECUTION_PHASE ChipsetPhase \r
+)\r
+;\r
+\r
+\r
+/**\r
+ The PlatformPrepController() function can be used to notify the platform driver so that \r
+ it can perform platform-specific actions. No specific actions are required. \r
+ Several notification points are defined at this time. More synchronization points may be \r
+ added as required in the future. The PCI bus driver calls the platform driver twice for \r
+ every PCI controller-once before the PCI Host Bridge Resource Allocation Protocol driver \r
+ is notified, and once after the PCI Host Bridge Resource Allocation Protocol driver has \r
+ been notified. \r
+ This member function may not perform any error checking on the input parameters. It also \r
+ does not return any error codes. If this member function detects any error condition, it \r
+ needs to handle those errors on its own because there is no way to surface any errors to \r
+ the caller. \r
+\r
+ @param This Pointer to the EFI_PCI_PLATFORM_PROTOCOL instance.\r
+ @param HostBridge The associated PCI host bridge handle.\r
+ @param RootBridge The associated PCI root bridge handle.\r
+ @param PciAddress The address of the PCI device on the PCI bus.\r
+ @param Phase The phase of the PCI controller enumeration.\r
+ @param ChipsetPhase Defines the execution phase of the PCI chipset driver.\r
+\r
+ @retval EFI_SUCCESS The function completed successfully.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_PLATFORM_PREPROCESS_CONTROLLER) (\r
+ IN EFI_PCI_PLATFORM_PROTOCOL *This,\r
+ IN EFI_HANDLE HostBridge,\r
+ IN EFI_HANDLE RootBridge,\r
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS PciAddress,\r
+ IN EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE Phase,\r
+ IN EFI_PCI_CHIPSET_EXECUTION_PHASE ChipsetPhase\r
+)\r
+;\r
+\r
+\r
+/**\r
+ The GetPlatformPolicy() function retrieves the platform policy regarding PCI \r
+ enumeration. The PCI bus driver and the PCI Host Bridge Resource Allocation Protocol \r
+ driver can call this member function to retrieve the policy.\r
+\r
+ @param This Pointer to the EFI_PCI_PLATFORM_PROTOCOL instance.\r
+ @param PciPolicy The platform policy with respect to VGA and ISA aliasing.\r
+\r
+ @retval EFI_SUCCESS The function completed successfully.\r
+ @retval EFI_INVALID_PARAMETER PciPolicy is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_PLATFORM_GET_PLATFORM_POLICY) (\r
+ IN EFI_PCI_PLATFORM_PROTOCOL *This,\r
+ OUT EFI_PCI_PLATFORM_POLICY *PciPolicy\r
+)\r
+;\r
+\r
+\r
+/**\r
+ The GetPciRom() function gets the PCI device's option ROM from a platform-specific location. \r
+ The option ROM will be loaded into memory. This member function is used to return an image \r
+ that is packaged as a PCI 2.2 option ROM. The image may contain both legacy and EFI option \r
+ ROMs. See the EFI 1.10 Specification for details. This member function can be used to return \r
+ option ROM images for embedded controllers. Option ROMs for embedded controllers are typically \r
+ stored in platform-specific storage, and this member function can retrieve it from that storage \r
+ and return it to the PCI bus driver. The PCI bus driver will call this member function before \r
+ scanning the ROM that is attached to any controller, which allows a platform to specify a ROM \r
+ image that is different from the ROM image on a PCI card.\r
+\r
+ @param This Pointer to the EFI_PCI_PLATFORM_PROTOCOL instance.\r
+ @param PciHandle The handle of the PCI device.\r
+ @param RomImage If the call succeeds, the pointer to the pointer to the option ROM image.\r
+ Otherwise, this field is undefined. The memory for RomImage is allocated\r
+ by EFI_PCI_PLATFORM_PROTOCOL.GetPciRom() using the EFI Boot Service AllocatePool().\r
+ It is the caller's responsibility to free the memory using the EFI Boot Service\r
+ FreePool(), when the caller is done with the option ROM.\r
+ @param RomSize If the call succeeds, a pointer to the size of the option ROM size. Otherwise,\r
+ this field is undefined.\r
+\r
+ @retval EFI_SUCCESS The option ROM was available for this device and loaded into memory.\r
+ @retval EFI_NOT_FOUND No option ROM was available for this device.\r
+ @retval EFI_OUT_OF_RESOURCES No memory was available to load the option ROM.\r
+ @retval EFI_DEVICE_ERROR An error occurred in getting the option ROM.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_PLATFORM_GET_PCI_ROM) ( \r
+ IN EFI_PCI_PLATFORM_PROTOCOL *This,\r
+ IN EFI_HANDLE PciHandle,\r
+ OUT VOID **RomImage,\r
+ OUT UINTN *RomSize \r
+)\r
+;\r
+\r
+/**\r
+ @par Protocol Description:\r
+ This protocol provides the interface between the PCI bus driver/PCI Host \r
+ Bridge Resource Allocation driver and a platform-specific driver to describe \r
+ the unique features of a platform.\r
+\r
+ @param PlatformNotify\r
+ The notification from the PCI bus enumerator to the platform that it is \r
+ about to enter a certain phase during the enumeration process.\r
+\r
+ @param PlatformPrepController\r
+ The notification from the PCI bus enumerator to the platform for each PCI \r
+ controller at several predefined points during PCI controller initialization.\r
+\r
+ @param GetPlatformPolicy\r
+ Retrieves the platform policy regarding enumeration.\r
+\r
+ @param GetPciRom\r
+ Gets the PCI device's option ROM from a platform-specific location.\r
+\r
+**/\r
+struct _EFI_PCI_PLATFORM_PROTOCOL {\r
+ EFI_PCI_PLATFORM_PHASE_NOTIFY PhaseNotify;\r
+ EFI_PCI_PLATFORM_PREPROCESS_CONTROLLER PlatformPrepController;\r
+ EFI_PCI_PLATFORM_GET_PLATFORM_POLICY GetPlatformPolicy;\r
+ EFI_PCI_PLATFORM_GET_PCI_ROM GetPciRom;\r
+};\r
+\r
+extern EFI_GUID gEfiPciPlatformProtocolGuid;\r
+\r
+\r
+#endif\r