2009-01-08 09:48:15 +01:00
|
|
|
/** @file
|
2009-06-25 15:47:45 +02:00
|
|
|
PCI Rom supporting funtions declaration for PCI Bus module.
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2009-06-25 15:47:45 +02:00
|
|
|
Copyright (c) 2006 - 2009, Intel Corporation
|
|
|
|
All rights reserved. This program and the accompanying materials
|
|
|
|
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.
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2007-07-23 09:06:23 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2009-06-25 15:47:45 +02:00
|
|
|
#ifndef _EFI_PCI_OPTION_ROM_SUPPORT_H_
|
|
|
|
#define _EFI_PCI_OPTION_ROM_SUPPORT_H_
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2009-04-03 10:18:43 +02:00
|
|
|
|
|
|
|
/**
|
2009-06-09 05:47:29 +02:00
|
|
|
Initialize a PCI LoadFile2 instance.
|
2009-06-25 15:47:45 +02:00
|
|
|
|
2009-06-09 05:47:29 +02:00
|
|
|
@param PciIoDevice PCI IO Device.
|
2009-04-03 10:18:43 +02:00
|
|
|
|
|
|
|
**/
|
|
|
|
VOID
|
|
|
|
InitializePciLoadFile2 (
|
2009-06-25 15:47:45 +02:00
|
|
|
IN PCI_IO_DEVICE *PciIoDevice
|
2009-04-03 10:18:43 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Causes the driver to load a specified file.
|
2009-06-25 15:47:45 +02:00
|
|
|
|
2009-04-03 10:18:43 +02:00
|
|
|
@param This Indicates a pointer to the calling context.
|
|
|
|
@param FilePath The device specific path of the file to load.
|
|
|
|
@param BootPolicy Should always be FALSE.
|
2009-06-25 15:47:45 +02:00
|
|
|
@param BufferSize On input the size of Buffer in bytes. On output with a return
|
|
|
|
code of EFI_SUCCESS, the amount of data transferred to Buffer.
|
|
|
|
On output with a return code of EFI_BUFFER_TOO_SMALL,
|
|
|
|
the size of Buffer required to retrieve the requested file.
|
|
|
|
@param Buffer The memory buffer to transfer the file to. If Buffer is NULL,
|
2009-06-09 05:47:29 +02:00
|
|
|
then no the size of the requested file is returned in BufferSize.
|
2009-04-03 10:18:43 +02:00
|
|
|
|
2009-06-25 15:47:45 +02:00
|
|
|
@retval EFI_SUCCESS The file was loaded.
|
2009-04-03 10:18:43 +02:00
|
|
|
@retval EFI_UNSUPPORTED BootPolicy is TRUE.
|
2009-06-25 15:47:45 +02:00
|
|
|
@retval EFI_INVALID_PARAMETER FilePath is not a valid device path, or
|
|
|
|
BufferSize is NULL.
|
|
|
|
@retval EFI_NOT_FOUND Not found PCI Option Rom on PCI device.
|
|
|
|
@retval EFI_DEVICE_ERROR Failed to decompress PCI Option Rom image.
|
2009-04-03 10:18:43 +02:00
|
|
|
@retval EFI_BUFFER_TOO_SMALL The BufferSize is too small to read the current directory entry.
|
|
|
|
BufferSize has been updated with the size needed to complete the request.
|
2009-06-25 15:47:45 +02:00
|
|
|
|
2009-04-03 10:18:43 +02:00
|
|
|
**/
|
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
LoadFile2 (
|
|
|
|
IN EFI_LOAD_FILE2_PROTOCOL *This,
|
|
|
|
IN EFI_DEVICE_PATH_PROTOCOL *FilePath,
|
|
|
|
IN BOOLEAN BootPolicy,
|
|
|
|
IN OUT UINTN *BufferSize,
|
|
|
|
IN VOID *Buffer OPTIONAL
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Check if the RomImage contains EFI Images.
|
|
|
|
|
2009-06-25 15:47:45 +02:00
|
|
|
@param RomImage The ROM address of Image for check.
|
2009-04-03 10:18:43 +02:00
|
|
|
@param RomSize Size of ROM for check.
|
|
|
|
|
|
|
|
@retval TRUE ROM contain EFI Image.
|
|
|
|
@retval FALSE ROM not contain EFI Image.
|
2009-06-25 15:47:45 +02:00
|
|
|
|
2009-04-03 10:18:43 +02:00
|
|
|
**/
|
|
|
|
BOOLEAN
|
|
|
|
ContainEfiImage (
|
|
|
|
IN VOID *RomImage,
|
|
|
|
IN UINT64 RomSize
|
2009-06-25 15:47:45 +02:00
|
|
|
);
|
2009-04-03 10:18:43 +02:00
|
|
|
|
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
2009-07-07 06:00:44 +02:00
|
|
|
Get Pci device's oprom information.
|
2009-01-08 09:48:15 +01:00
|
|
|
|
2009-07-07 06:00:44 +02:00
|
|
|
@param PciIoDevice Input Pci device instance.
|
|
|
|
Output Pci device instance with updated OptionRom size.
|
2009-06-25 15:47:45 +02:00
|
|
|
|
|
|
|
@retval EFI_NOT_FOUND Pci device has not Option Rom.
|
|
|
|
@retval EFI_SUCCESS Pci device has Option Rom.
|
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
EFI_STATUS
|
|
|
|
GetOpRomInfo (
|
2009-07-07 06:00:44 +02:00
|
|
|
IN OUT PCI_IO_DEVICE *PciIoDevice
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
2009-06-25 15:47:45 +02:00
|
|
|
Load Option Rom image for specified PCI device.
|
|
|
|
|
|
|
|
@param PciDevice Pci device instance.
|
|
|
|
@param RomBase Base address of Option Rom.
|
|
|
|
|
|
|
|
@retval EFI_OUT_OF_RESOURCES No enough memory to hold image.
|
|
|
|
@retval EFI_SUCESS Successfully loaded Option Rom.
|
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
EFI_STATUS
|
|
|
|
LoadOpRomImage (
|
|
|
|
IN PCI_IO_DEVICE *PciDevice,
|
|
|
|
IN UINT64 RomBase
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
2009-06-25 15:47:45 +02:00
|
|
|
Enable/Disable Option Rom decode.
|
|
|
|
|
|
|
|
@param PciDevice Pci device instance.
|
2008-04-16 11:24:58 +02:00
|
|
|
@param RomBarIndex The BAR index of the standard PCI Configuration header to use as the
|
|
|
|
base address for resource range. The legal range for this field is 0..5.
|
2009-06-25 15:47:45 +02:00
|
|
|
@param RomBar Base address of Option Rom.
|
2008-04-16 11:24:58 +02:00
|
|
|
@param Enable Flag for enable/disable decode.
|
2009-06-25 15:47:45 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2009-06-25 15:47:45 +02:00
|
|
|
VOID
|
2007-06-28 16:02:17 +02:00
|
|
|
RomDecode (
|
|
|
|
IN PCI_IO_DEVICE *PciDevice,
|
|
|
|
IN UINT8 RomBarIndex,
|
|
|
|
IN UINT32 RomBar,
|
|
|
|
IN BOOLEAN Enable
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
2009-06-25 15:47:45 +02:00
|
|
|
Load and start the Option Rom image.
|
|
|
|
|
|
|
|
@param PciDevice Pci device instance.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS Successfully loaded and started PCI Option Rom image.
|
|
|
|
@retval EFI_NOT_FOUND Failed to process PCI Option Rom image.
|
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
EFI_STATUS
|
|
|
|
ProcessOpRomImage (
|
2009-06-25 15:47:45 +02:00
|
|
|
IN PCI_IO_DEVICE *PciDevice
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
|
|
|
#endif
|