Add DxeBootScriptLibNull in IntelFrameworkPkg.

Add IsaBusDxe in IntelFrameworkModulePkg.
Add Pcat.h in "IntelFrameworkModulePkg/IndustryStandard"


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2948 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
yshang1 2007-07-02 09:09:00 +00:00
parent 9262714181
commit c3902377a9
19 changed files with 4838 additions and 5 deletions

View File

@ -0,0 +1,56 @@
/**@file
Common header file shared by all source files.
This file includes package header files, library classes and protocol, PPI & GUID definitions.
Copyright (c) 2006 - 2007, Intel Corporation.
All rights reserved.
This software and associated documentation (if any) is furnished
under a license and may only be used or copied in accordance
with the terms of the license. Except as permitted by such
license, no part of this software or documentation may be
reproduced, stored in a retrieval system, or transmitted in any
form or by any means without the express written consent of
Intel Corporation.
**/
#ifndef __COMMON_HEADER_H_
#define __COMMON_HEADER_H_
//
// The package level header files this module uses
//
#include <PiDxe.h>
#include <FrameworkDxe.h>
//
// The protocols, PPI and GUID defintions for this module
//
#include <Protocol/PciIo.h>
#include <Protocol/ComponentName.h>
#include <Protocol/IsaIo.h>
#include <Protocol/DevicePath.h>
#include <Protocol/IsaAcpi.h>
#include <Protocol/DriverBinding.h>
#include <Protocol/GenericMemoryTest.h>
#include <Guid/StatusCodeDataTypeId.h>
//
// The Library classes this module consumes
//
#include <Library/DebugLib.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/UefiLib.h>
#include <Library/DevicePathLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/ReportStatusCodeLib.h>
#include <Library/BootScriptLib.h>
#include <Library/PcdLib.h>
//
// Driver Binding Externs
//
extern EFI_DRIVER_BINDING_PROTOCOL gIsaBusControllerDriver;
extern EFI_COMPONENT_NAME_PROTOCOL gIsaBusComponentName;
#endif

View File

@ -0,0 +1,141 @@
/*++
Copyright (c) 2006, Intel Corporation. All rights reserved. <BR>
This software and associated documentation (if any) is furnished
under a license and may only be used or copied in accordance
with the terms of the license. Except as permitted by such
license, no part of this software or documentation may be
reproduced, stored in a retrieval system, or transmitted in any
form or by any means without the express written consent of
Intel Corporation.
Module Name:
ComponentName.c
Abstract:
--*/
#include "ComponentName.h"
//
// EFI Component Name Protocol
//
EFI_COMPONENT_NAME_PROTOCOL gIsaBusComponentName = {
IsaBusComponentNameGetDriverName,
IsaBusComponentNameGetControllerName,
"eng"
};
STATIC EFI_UNICODE_STRING_TABLE mIsaBusDriverNameTable[] = {
{
"eng",
L"ISA Bus Driver"
},
{
NULL,
NULL
}
};
EFI_STATUS
EFIAPI
IsaBusComponentNameGetDriverName (
IN EFI_COMPONENT_NAME_PROTOCOL *This,
IN CHAR8 *Language,
OUT CHAR16 **DriverName
)
/*++
Routine Description:
Retrieves a Unicode string that is the user readable name of the EFI Driver.
Arguments:
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
Language - A pointer to a three character ISO 639-2 language identifier.
This is the language of the driver name that that the caller
is requesting, and it must match one of the languages specified
in SupportedLanguages. The number of languages supported by a
driver is up to the driver writer.
DriverName - A pointer to the Unicode string to return. This Unicode string
is the name of the driver specified by This in the language
specified by Language.
Returns:
EFI_SUCCESS - The Unicode string for the Driver specified by This
and the language specified by Language was returned
in DriverName.
EFI_INVALID_PARAMETER - Language is NULL.
EFI_INVALID_PARAMETER - DriverName is NULL.
EFI_UNSUPPORTED - The driver specified by This does not support the
language specified by Language.
--*/
{
return LookupUnicodeString (
Language,
gIsaBusComponentName.SupportedLanguages,
mIsaBusDriverNameTable,
DriverName
);
}
EFI_STATUS
EFIAPI
IsaBusComponentNameGetControllerName (
IN EFI_COMPONENT_NAME_PROTOCOL *This,
IN EFI_HANDLE ControllerHandle,
IN EFI_HANDLE ChildHandle OPTIONAL,
IN CHAR8 *Language,
OUT CHAR16 **ControllerName
)
/*++
Routine Description:
Retrieves a Unicode string that is the user readable name of the controller
that is being managed by an EFI Driver.
Arguments:
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
ControllerHandle - The handle of a controller that the driver specified by
This is managing. This handle specifies the controller
whose name is to be returned.
ChildHandle - The handle of the child controller to retrieve the name
of. This is an optional parameter that may be NULL. It
will be NULL for device drivers. It will also be NULL
for a bus drivers that wish to retrieve the name of the
bus controller. It will not be NULL for a bus driver
that wishes to retrieve the name of a child controller.
Language - A pointer to a three character ISO 639-2 language
identifier. This is the language of the controller name
that that the caller is requesting, and it must match one
of the languages specified in SupportedLanguages. The
number of languages supported by a driver is up to the
driver writer.
ControllerName - A pointer to the Unicode string to return. This Unicode
string is the name of the controller specified by
ControllerHandle and ChildHandle in the language
specified by Language from the point of view of the
driver specified by This.
Returns:
EFI_SUCCESS - The Unicode string for the user readable name in the
language specified by Language for the driver
specified by This was returned in DriverName.
EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid
EFI_HANDLE.
EFI_INVALID_PARAMETER - Language is NULL.
EFI_INVALID_PARAMETER - ControllerName is NULL.
EFI_UNSUPPORTED - The driver specified by This is not currently
managing the controller specified by
ControllerHandle and ChildHandle.
EFI_UNSUPPORTED - The driver specified by This does not support the
language specified by Language.
--*/
{
return EFI_UNSUPPORTED;
}

View File

@ -0,0 +1,92 @@
/*++
Copyright (c) 2006, Intel Corporation. All rights reserved.
This software and associated documentation (if any) is furnished
under a license and may only be used or copied in accordance
with the terms of the license. Except as permitted by such
license, no part of this software or documentation may be
reproduced, stored in a retrieval system, or transmitted in any
form or by any means without the express written consent of
Intel Corporation.
Module Name:
ComponentName.h
Abstract:
Revision History:
--*/
#ifndef _EFI_ISA_BUS_COMPONENT_NAME_H
#define _EFI_ISA_BUS_COMPONENT_NAME_H
//
// Include common header file for this module.
//
#include "CommonHeader.h"
extern EFI_COMPONENT_NAME_PROTOCOL gIsaBusComponentName;
//
// EFI Component Name Functions
//
EFI_STATUS
EFIAPI
IsaBusComponentNameGetDriverName (
IN EFI_COMPONENT_NAME_PROTOCOL *This,
IN CHAR8 *Language,
OUT CHAR16 **DriverName
)
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
This - GC_TODO: add argument description
Language - GC_TODO: add argument description
DriverName - GC_TODO: add argument description
Returns:
GC_TODO: add return values
--*/
;
EFI_STATUS
EFIAPI
IsaBusComponentNameGetControllerName (
IN EFI_COMPONENT_NAME_PROTOCOL *This,
IN EFI_HANDLE ControllerHandle,
IN EFI_HANDLE ChildHandle OPTIONAL,
IN CHAR8 *Language,
OUT CHAR16 **ControllerName
)
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
This - GC_TODO: add argument description
ControllerHandle - GC_TODO: add argument description
ChildHandle - GC_TODO: add argument description
Language - GC_TODO: add argument description
ControllerName - GC_TODO: add argument description
Returns:
GC_TODO: add return values
--*/
;
#endif

View File

@ -0,0 +1,58 @@
/**@file
Entry Point Source file.
This file contains the user entry point
Copyright (c) 2006 - 2007, Intel Corporation.
All rights reserved.
This software and associated documentation (if any) is furnished
under a license and may only be used or copied in accordance
with the terms of the license. Except as permitted by such
license, no part of this software or documentation may be
reproduced, stored in a retrieval system, or transmitted in any
form or by any means without the express written consent of
Intel Corporation.
**/
//
// Include common header file for this module.
//
#include "InternalIsaBus.h"
/**
The user Entry Point for module IsaBus. The user code starts with this function.
@param[in] ImageHandle The firmware allocated handle for the EFI image.
@param[in] SystemTable A pointer to the EFI System Table.
@retval EFI_SUCCESS The entry point is executed successfully.
@retval other Some error occurs when executing this entry point.
**/
EFI_STATUS
EFIAPI
InitializeIsaBus(
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
//
// Install driver model protocol(s).
//
Status = EfiLibInstallAllDriverProtocols (
ImageHandle,
SystemTable,
&gIsaBusControllerDriver,
ImageHandle,
&gIsaBusComponentName,
NULL,
NULL
);
ASSERT_EFI_ERROR (Status);
return Status;
}

View File

@ -0,0 +1,253 @@
/*++
Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.
This software and associated documentation (if any) is furnished
under a license and may only be used or copied in accordance
with the terms of the license. Except as permitted by such
license, no part of this software or documentation may be
reproduced, stored in a retrieval system, or transmitted in any
form or by any means without the express written consent of
Intel Corporation.
Module Name:
IsaBus.h
Abstract:
The header file for ISA bus driver
Revision History:
--*/
#ifndef _EFI_ISA_BUS_H
#define _EFI_ISA_BUS_H
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#include "ComponentName.h"
extern EFI_ISA_IO_PROTOCOL IsaIoInterface;
typedef enum {
IsaAccessTypeUnknown,
IsaAccessTypeIo,
IsaAccessTypeMem,
IsaAccessTypeMaxType
} ISA_ACCESS_TYPE;
//
// 16 MB Memory Range
//
#define ISA_MAX_MEMORY_ADDRESS 0x1000000
//
// 64K I/O Range
//
#define ISA_MAX_IO_ADDRESS 0x10000
typedef struct {
UINT8 Address;
UINT8 Page;
UINT8 Count;
} EFI_ISA_DMA_REGISTERS;
//
// ISA I/O Device Structure
//
#define ISA_IO_DEVICE_SIGNATURE EFI_SIGNATURE_32 ('i', 's', 'a', 'i')
typedef struct {
UINT32 Signature;
EFI_HANDLE Handle;
EFI_ISA_IO_PROTOCOL IsaIo;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
EFI_PCI_IO_PROTOCOL *PciIo;
} ISA_IO_DEVICE;
#define ISA_IO_DEVICE_FROM_ISA_IO_THIS(a) CR (a, ISA_IO_DEVICE, IsaIo, ISA_IO_DEVICE_SIGNATURE)
//
// Global Variables
//
extern EFI_DRIVER_BINDING_PROTOCOL gIsaBusControllerDriver;
//
// Mapping structure for performing ISA DMA to a buffer above 16 MB
//
typedef struct {
EFI_ISA_IO_PROTOCOL_OPERATION Operation;
UINTN NumberOfBytes;
UINTN NumberOfPages;
EFI_PHYSICAL_ADDRESS HostAddress;
EFI_PHYSICAL_ADDRESS MappedHostAddress;
} ISA_MAP_INFO;
//
// EFI Driver Binding Protocol Interface Functions
//
EFI_STATUS
EFIAPI
IsaBusControllerDriverSupported (
IN EFI_DRIVER_BINDING_PROTOCOL * This,
IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
)
/*++
Routine Description:
This function checks to see if a controller can be managed by the ISA Bus
Driver. This is done by checking to see if the controller supports the
EFI_PCI_IO_PROTOCOL protocol, and then looking at the PCI Configuration
Header to see if the device is a PCI to ISA bridge. The class code of
PCI to ISA bridge: Base class 06h, Sub class 01h Interface 00h
Arguments:
This - The EFI_DRIVER_BINDING_PROTOCOL instance.
Controller - The handle of the device to check.
RemainingDevicePath - A pointer to the remaining portion of a device path.
Returns:
EFI_SUCCESS - The device is supported by this driver.
EFI_UNSUPPORTED - The device is not supported by this driver.
--*/
;
EFI_STATUS
EFIAPI
IsaBusControllerDriverStart (
IN EFI_DRIVER_BINDING_PROTOCOL * This,
IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
)
/*++
Routine Description:
This function tells the ISA Bus Driver to start managing a PCI to ISA
Bridge controller.
Arguments:
This - The EFI_DRIVER_BINDING_PROTOCOL instance.
Controller - A handle to the device being started.
RemainingDevicePath - A pointer to the remaining portion of a device path.
Returns:
EFI_SUCCESS - The device was started.
EFI_UNSUPPORTED - The device is not supported.
EFI_DEVICE_ERROR - The device could not be started due to a device error.
EFI_ALREADY_STARTED - The device has already been started.
EFI_INVALID_PARAMETER - One of the parameters has an invalid value.
EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of
resources.
--*/
;
EFI_STATUS
EFIAPI
IsaBusControllerDriverStop (
IN EFI_DRIVER_BINDING_PROTOCOL * This,
IN EFI_HANDLE Controller,
IN UINTN NumberOfChildren,
IN EFI_HANDLE * ChildHandleBuffer OPTIONAL
)
/*++
Routine Description:
This function tells the ISA Bus Driver to stop managing a PCI to ISA
Bridge controller.
Arguments:
This - The EFI_DRIVER_BINDING_PROTOCOL instance.
Controller - A handle to the device being stopped.
NumberOfChindren - The number of child device handles in ChildHandleBuffer.
ChildHandleBuffer - An array of child handles to be freed.
Returns:
EFI_SUCCESS - The device was stopped.
EFI_DEVICE_ERROR - The device could not be stopped due to a device error.
EFI_NOT_STARTED - The device has not been started.
EFI_INVALID_PARAMETER - One of the parameters has an invalid value.
EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of
resources.
--*/
;
//
// Function Prototypes
//
EFI_STATUS
IsaCreateDevice (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN EFI_PCI_IO_PROTOCOL *PciIo,
IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath,
IN EFI_ISA_ACPI_RESOURCE_LIST *IsaDeviceResourceList,
OUT EFI_DEVICE_PATH_PROTOCOL **ChildDevicePath
)
/*++
Routine Description:
Create ISA device found by IsaPnpProtocol
Arguments:
This - The EFI_DRIVER_BINDING_PROTOCOL instance.
Controller - The handle of ISA bus controller(PCI to ISA bridge)
PciIo - The Pointer to the PCI protocol
ParentDevicePath - Device path of the ISA bus controller
IsaDeviceResourceList - The resource list of the ISA device
ChildDevicePath - The pointer to the child device.
Returns:
EFI_SUCCESS - Create the child device.
EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of
resources.
EFI_DEVICE_ERROR - Can not create child device.
--*/
;
EFI_STATUS
InitializeIsaIoInstance (
IN ISA_IO_DEVICE *IsaIoDevice,
IN EFI_ISA_ACPI_RESOURCE_LIST *IsaDevice
)
/*++
Routine Description:
Initializes an ISA I/O Instance
Arguments:
IsaIoDevice - The iso device to be initialized.
IsaDevice - The resource list.
Returns:
EFI_SUCCESS - Initial success.
--*/
;
#endif

View File

@ -0,0 +1,163 @@
/*++
Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.
This software and associated documentation (if any) is furnished
under a license and may only be used or copied in accordance
with the terms of the license. Except as permitted by such
license, no part of this software or documentation may be
reproduced, stored in a retrieval system, or transmitted in any
form or by any means without the express written consent of
Intel Corporation.
Module Name:
IsaIo.h
Abstract:
The header file for EFI_ISA_IO protocol implementation.
--*/
#ifndef _EFI_ISA_IO_LOCAL_H
#define _EFI_ISA_IO_LOCAL_H
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#include "InternalIsaBus.h"
//
// ISA I/O Support Function Prototypes
//
EFI_STATUS
IsaIoVerifyAccess (
IN ISA_IO_DEVICE *IsaIoDevice,
IN ISA_ACCESS_TYPE Type,
IN EFI_ISA_IO_PROTOCOL_WIDTH Width,
IN UINTN Count,
IN OUT UINT32 *Offset
);
EFI_STATUS
EFIAPI
IsaIoIoRead (
IN EFI_ISA_IO_PROTOCOL *This,
IN EFI_ISA_IO_PROTOCOL_WIDTH Width,
IN UINT32 Offset,
IN UINTN Count,
IN OUT VOID *Buffer
);
EFI_STATUS
EFIAPI
IsaIoIoWrite (
IN EFI_ISA_IO_PROTOCOL *This,
IN EFI_ISA_IO_PROTOCOL_WIDTH Width,
IN UINT32 Offset,
IN UINTN Count,
IN OUT VOID *Buffer
);
EFI_STATUS
EFIAPI
IsaIoMap (
IN EFI_ISA_IO_PROTOCOL *This,
IN EFI_ISA_IO_PROTOCOL_OPERATION Operation,
IN UINT8 ChannelNumber OPTIONAL,
IN UINT32 ChannelAttributes,
IN VOID *HostAddress,
IN OUT UINTN *NumberOfBytes,
OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
OUT VOID **Mapping
);
EFI_STATUS
EFIAPI
IsaIoUnmap (
IN EFI_ISA_IO_PROTOCOL *This,
IN VOID *Mapping
);
EFI_STATUS
EFIAPI
IsaIoFlush (
IN EFI_ISA_IO_PROTOCOL *This
);
EFI_STATUS
ReportErrorStatusCode (
EFI_STATUS_CODE_VALUE code
);
EFI_STATUS
WriteDmaPort (
IN EFI_ISA_IO_PROTOCOL *This,
IN UINT32 AddrOffset,
IN UINT32 PageOffset,
IN UINT32 CountOffset,
IN UINT32 BaseAddress,
IN UINT16 Count
);
EFI_STATUS
WritePort (
IN EFI_ISA_IO_PROTOCOL *This,
IN UINT32 Offset,
IN UINT8 Value
);
EFI_STATUS
EFIAPI
IsaIoMemRead (
IN EFI_ISA_IO_PROTOCOL *This,
IN EFI_ISA_IO_PROTOCOL_WIDTH Width,
IN UINT32 Offset,
IN UINTN Count,
IN OUT VOID *Buffer
);
EFI_STATUS
EFIAPI
IsaIoMemWrite (
IN EFI_ISA_IO_PROTOCOL *This,
IN EFI_ISA_IO_PROTOCOL_WIDTH Width,
IN UINT32 Offset,
IN UINTN Count,
IN OUT VOID *Buffer
);
EFI_STATUS
EFIAPI
IsaIoCopyMem (
IN EFI_ISA_IO_PROTOCOL *This,
IN EFI_ISA_IO_PROTOCOL_WIDTH Width,
IN UINT32 DestOffset,
IN UINT32 SrcOffset,
IN UINTN Count
);
EFI_STATUS
EFIAPI
IsaIoAllocateBuffer (
IN EFI_ISA_IO_PROTOCOL *This,
IN EFI_ALLOCATE_TYPE Type,
IN EFI_MEMORY_TYPE MemoryType,
IN UINTN Pages,
OUT VOID **HostAddress,
IN UINT64 Attributes
);
EFI_STATUS
EFIAPI
IsaIoFreeBuffer (
IN EFI_ISA_IO_PROTOCOL *This,
IN UINTN Pages,
IN VOID *HostAddress
);
#endif

View File

@ -0,0 +1,653 @@
/*++
Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved. <BR>
This software and associated documentation (if any) is furnished
under a license and may only be used or copied in accordance
with the terms of the license. Except as permitted by such
license, no part of this software or documentation may be
reproduced, stored in a retrieval system, or transmitted in any
form or by any means without the express written consent of
Intel Corporation.
Module Name:
IsaBus.c
Abstract:
Discovers all the ISA Controllers and their resources by using the ISA PnP
Protocol, produces an instance of the ISA I/O Protocol for every ISA
Controller found, loads and initializes all ISA Device Drivers, matches ISA
Device Drivers with their respective ISA Controllers in a deterministic
manner, and informs a ISA Device Driver when it is to start managing an ISA
Controller.
Revision History:
--*/
#include "InternalIsaBus.h"
//
// ISA Bus Driver Global Variables
//
EFI_DRIVER_BINDING_PROTOCOL gIsaBusControllerDriver = {
IsaBusControllerDriverSupported,
IsaBusControllerDriverStart,
IsaBusControllerDriverStop,
0xa,
NULL,
NULL
};
EFI_STATUS
EFIAPI
IsaBusControllerDriverSupported (
IN EFI_DRIVER_BINDING_PROTOCOL * This,
IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
)
/*++
Routine Description:
This function checks to see if a controller can be managed by the ISA Bus
Driver. This is done by checking to see if the controller supports the
EFI_PCI_IO_PROTOCOL protocol, and then looking at the PCI Configuration
Header to see if the device is a PCI to ISA bridge. The class code of
PCI to ISA bridge: Base class 06h, Sub class 01h Interface 00h
Arguments:
This - The EFI_DRIVER_BINDING_PROTOCOL instance.
Controller - The handle of the device to check.
RemainingDevicePath - A pointer to the remaining portion of a device path.
Returns:
EFI_SUCCESS - The device is supported by this driver.
EFI_UNSUPPORTED - The device is not supported by this driver.
--*/
{
EFI_STATUS Status;
EFI_ISA_ACPI_PROTOCOL *IsaAcpi;
//
// If RemainingDevicePath is not NULL, it should verify that the first device
// path node in RemainingDevicePath is an ACPI Device path node
//
if (RemainingDevicePath != NULL) {
if (RemainingDevicePath->Type != ACPI_DEVICE_PATH) {
return EFI_UNSUPPORTED;
} else if (RemainingDevicePath->SubType == ACPI_DP) {
if (DevicePathNodeLength (RemainingDevicePath) != sizeof (ACPI_HID_DEVICE_PATH)) {
return EFI_UNSUPPORTED;
}
} else if (RemainingDevicePath->SubType == ACPI_EXTENDED_DP) {
if (DevicePathNodeLength (RemainingDevicePath) != sizeof (ACPI_EXTENDED_HID_DEVICE_PATH)) {
return EFI_UNSUPPORTED;
}
} else {
return EFI_UNSUPPORTED;
}
}
//
// Test the existence of DEVICE_PATH protocol
//
Status = gBS->OpenProtocol (
Controller,
&gEfiDevicePathProtocolGuid,
NULL,
This->DriverBindingHandle,
Controller,
EFI_OPEN_PROTOCOL_TEST_PROTOCOL
);
if (EFI_ERROR (Status)) {
return Status;
}
//
// Get the Isa Acpi protocol
//
Status = gBS->OpenProtocol (
Controller,
&gEfiIsaAcpiProtocolGuid,
(VOID **) &IsaAcpi,
This->DriverBindingHandle,
Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER
);
if (Status == EFI_ALREADY_STARTED) {
return EFI_SUCCESS;
}
if (EFI_ERROR (Status)) {
return Status;
}
gBS->CloseProtocol (
Controller,
&gEfiIsaAcpiProtocolGuid,
This->DriverBindingHandle,
Controller
);
return Status;
}
EFI_STATUS
EFIAPI
IsaBusControllerDriverStart (
IN EFI_DRIVER_BINDING_PROTOCOL * This,
IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
)
/*++
Routine Description:
This function tells the ISA Bus Driver to start managing a PCI to ISA
Bridge controller.
Arguments:
This - The EFI_DRIVER_BINDING_PROTOCOL instance.
Controller - A handle to the device being started.
RemainingDevicePath - A pointer to the remaining portion of a device path.
Returns:
EFI_SUCCESS - The device was started.
EFI_UNSUPPORTED - The device is not supported.
EFI_DEVICE_ERROR - The device could not be started due to a device error.
EFI_ALREADY_STARTED - The device has already been started.
EFI_INVALID_PARAMETER - One of the parameters has an invalid value.
EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of
resources.
--*/
{
EFI_STATUS Status;
EFI_PCI_IO_PROTOCOL *PciIo;
EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;
EFI_ISA_ACPI_PROTOCOL *IsaAcpi;
EFI_ISA_ACPI_DEVICE_ID *IsaDevice;
EFI_ISA_ACPI_RESOURCE_LIST *ResourceList;
EFI_GENERIC_MEMORY_TEST_PROTOCOL *GenMemoryTest;
//
// Local variables declaration for StatusCode reporting
//
EFI_RESOURCE_ALLOC_FAILURE_ERROR_DATA AllocFailExtendedData;
EFI_DEVICE_PATH_PROTOCOL *DevicePathData;
BootScriptSaveInformationAsciiString (
EFI_ACPI_S3_RESUME_SCRIPT_TABLE,
"IsaBusBindingStartBegin"
);
//
// Initialize status code structure
//
AllocFailExtendedData.DataHeader.HeaderSize = sizeof (EFI_STATUS_CODE_DATA);
AllocFailExtendedData.DataHeader.Size = sizeof (EFI_RESOURCE_ALLOC_FAILURE_ERROR_DATA) - sizeof (EFI_STATUS_CODE_DATA);
CopyMem (
&AllocFailExtendedData.DataHeader.Type,
&gEfiStatusCodeSpecificDataGuid,
sizeof (EFI_GUID)
);
//
// Open Device Path Protocol
//
Status = gBS->OpenProtocol (
Controller,
&gEfiDevicePathProtocolGuid,
(VOID **) &ParentDevicePath,
This->DriverBindingHandle,
Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER
);
if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) {
return Status;
}
//
// Open Pci IO Protocol
//
Status = gBS->OpenProtocol (
Controller,
&gEfiPciIoProtocolGuid,
(VOID **) &PciIo,
This->DriverBindingHandle,
Controller,
EFI_OPEN_PROTOCOL_GET_PROTOCOL
);
if (EFI_ERROR (Status)) {
//
// Close opened protocol
//
gBS->CloseProtocol (
Controller,
&gEfiDevicePathProtocolGuid,
This->DriverBindingHandle,
Controller
);
return Status;
}
//
// Open ISA Acpi Protocol
//
Status = gBS->OpenProtocol (
Controller,
&gEfiIsaAcpiProtocolGuid,
(VOID **) &IsaAcpi,
This->DriverBindingHandle,
Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER
);
if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) {
//
// Close opened protocol
//
gBS->CloseProtocol (
Controller,
&gEfiDevicePathProtocolGuid,
This->DriverBindingHandle,
Controller
);
gBS->CloseProtocol (
Controller,
&gEfiPciIoProtocolGuid,
This->DriverBindingHandle,
Controller
);
return Status;
}
//
// The IsaBus driver will use memory below 16M, which is not tested yet,
// so call CompatibleRangeTest to test them. Since memory below 1M should
// be reserved to CSM, and 15M~16M might be reserved for Isa hole, test 1M
// ~15M here
//
Status = gBS->LocateProtocol (
&gEfiGenericMemTestProtocolGuid,
NULL,
(VOID **) &GenMemoryTest
);
if (!EFI_ERROR (Status)) {
Status = GenMemoryTest->CompatibleRangeTest (
GenMemoryTest,
0x100000,
0xE00000
);
}
//
// Report Status Code here since we will initialize the host controller
//
REPORT_STATUS_CODE_WITH_DEVICE_PATH (
EFI_PROGRESS_CODE,
(EFI_IO_BUS_LPC | EFI_IOB_PC_INIT),
ParentDevicePath
);
//
// first init ISA interface
//
IsaAcpi->InterfaceInit (IsaAcpi);
//
// Report Status Code here since we will enable the host controller
//
REPORT_STATUS_CODE_WITH_DEVICE_PATH (
EFI_PROGRESS_CODE,
(EFI_IO_BUS_LPC | EFI_IOB_PC_ENABLE),
ParentDevicePath
);
//
// Create each ISA device handle in this ISA bus
//
IsaDevice = NULL;
do {
Status = IsaAcpi->DeviceEnumerate (IsaAcpi, &IsaDevice);
if (EFI_ERROR (Status)) {
break;
}
//
// Get current resource of this ISA device
//
ResourceList = NULL;
Status = IsaAcpi->GetCurResource (IsaAcpi, IsaDevice, &ResourceList);
if (EFI_ERROR (Status)) {
continue;
}
//
// Create handle for this ISA device
//
Status = IsaCreateDevice (
This,
Controller,
PciIo,
ParentDevicePath,
ResourceList,
&DevicePathData
//&AllocFailExtendedData.DevicePath
);
if (EFI_ERROR (Status)) {
continue;
}
//
// Initialize ISA device
//
IsaAcpi->InitDevice (IsaAcpi, IsaDevice);
//
// Set resources for this ISA device
//
Status = IsaAcpi->SetResource (IsaAcpi, IsaDevice, ResourceList);
//
// Report Status Code here when failed to resource conflicts
//
if (EFI_ERROR (Status) && (Status != EFI_UNSUPPORTED)) {
//
// It's hard to tell which resource conflicts
//
AllocFailExtendedData.Bar = 0;
AllocFailExtendedData.ReqRes = NULL;
AllocFailExtendedData.AllocRes = NULL;
REPORT_STATUS_CODE_WITH_DEVICE_PATH (
EFI_ERROR_CODE,
(EFI_IO_BUS_LPC | EFI_IOB_EC_RESOURCE_CONFLICT),
DevicePathData
);
}
//
// Set power for this ISA device
//
IsaAcpi->SetPower (IsaAcpi, IsaDevice, TRUE);
//
// Enable this ISA device
//
IsaAcpi->EnableDevice (IsaAcpi, IsaDevice, TRUE);
} while (TRUE);
BootScriptSaveInformationAsciiString (
EFI_ACPI_S3_RESUME_SCRIPT_TABLE,
"IsaBusBindingStartEnd"
);
return EFI_SUCCESS;
}
EFI_STATUS
EFIAPI
IsaBusControllerDriverStop (
IN EFI_DRIVER_BINDING_PROTOCOL * This,
IN EFI_HANDLE Controller,
IN UINTN NumberOfChildren,
IN EFI_HANDLE * ChildHandleBuffer OPTIONAL
)
/*++
Routine Description:
This function tells the ISA Bus Driver to stop managing a PCI to ISA
Bridge controller.
Arguments:
This - The EFI_DRIVER_BINDING_PROTOCOL instance.
Controller - A handle to the device being stopped.
NumberOfChindren - The number of child device handles in ChildHandleBuffer.
ChildHandleBuffer - An array of child handles to be freed.
Returns:
EFI_SUCCESS - The device was stopped.
EFI_DEVICE_ERROR - The device could not be stopped due to a device error.
EFI_NOT_STARTED - The device has not been started.
EFI_INVALID_PARAMETER - One of the parameters has an invalid value.
EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of
resources.
--*/
{
EFI_STATUS Status;
UINTN Index;
BOOLEAN AllChildrenStopped;
ISA_IO_DEVICE *IsaIoDevice;
EFI_ISA_IO_PROTOCOL *IsaIo;
if (NumberOfChildren == 0) {
//
// Close the bus driver
//
Status = gBS->CloseProtocol (
Controller,
&gEfiPciIoProtocolGuid,
This->DriverBindingHandle,
Controller
);
if (EFI_ERROR (Status)) {
return Status;
}
Status = gBS->CloseProtocol (
Controller,
&gEfiDevicePathProtocolGuid,
This->DriverBindingHandle,
Controller
);
if (EFI_ERROR (Status)) {
return Status;
}
Status = gBS->CloseProtocol (
Controller,
&gEfiIsaAcpiProtocolGuid,
This->DriverBindingHandle,
Controller
);
if (EFI_ERROR (Status)) {
return Status;
}
return EFI_SUCCESS;
}
//
// Complete all outstanding transactions to Controller.
// Don't allow any new transaction to Controller to be started.
//
//
// Stop all the children
// Find all the ISA devices that were discovered on this PCI to ISA Bridge
// with the Start() function.
//
AllChildrenStopped = TRUE;
for (Index = 0; Index < NumberOfChildren; Index++) {
Status = gBS->OpenProtocol (
ChildHandleBuffer[Index],
&gEfiIsaIoProtocolGuid,
(VOID **) &IsaIo,
This->DriverBindingHandle,
Controller,
EFI_OPEN_PROTOCOL_GET_PROTOCOL
);
if (!EFI_ERROR (Status)) {
IsaIoDevice = ISA_IO_DEVICE_FROM_ISA_IO_THIS (IsaIo);
Status = gBS->UninstallMultipleProtocolInterfaces (
ChildHandleBuffer[Index],
&gEfiDevicePathProtocolGuid,
IsaIoDevice->DevicePath,
&gEfiIsaIoProtocolGuid,
&IsaIoDevice->IsaIo,
NULL
);
if (!EFI_ERROR (Status)) {
//
// Close the child handle
//
Status = gBS->CloseProtocol (
Controller,
&gEfiPciIoProtocolGuid,
This->DriverBindingHandle,
ChildHandleBuffer[Index]
);
gBS->FreePool (IsaIoDevice->DevicePath);
gBS->FreePool (IsaIoDevice);
}
}
if (EFI_ERROR (Status)) {
AllChildrenStopped = FALSE;
}
}
if (!AllChildrenStopped) {
return EFI_DEVICE_ERROR;
}
return EFI_SUCCESS;
}
//
// Internal Function
//
EFI_STATUS
IsaCreateDevice (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN EFI_PCI_IO_PROTOCOL *PciIo,
IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath,
IN EFI_ISA_ACPI_RESOURCE_LIST *IsaDeviceResourceList,
OUT EFI_DEVICE_PATH_PROTOCOL **ChildDevicePath
)
/*++
Routine Description:
Create ISA device found by IsaPnpProtocol
Arguments:
This - The EFI_DRIVER_BINDING_PROTOCOL instance.
Controller - The handle of ISA bus controller(PCI to ISA bridge)
PciIo - The Pointer to the PCI protocol
ParentDevicePath - Device path of the ISA bus controller
IsaDeviceResourceList - The resource list of the ISA device
ChildDevicePath - The pointer to the child device.
Returns:
EFI_SUCCESS - Create the child device.
EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of
resources.
EFI_DEVICE_ERROR - Can not create child device.
--*/
{
EFI_STATUS Status;
ISA_IO_DEVICE *IsaIoDevice;
EFI_DEV_PATH Node;
//
// Initialize the PCI_IO_DEVICE structure
//
IsaIoDevice = AllocateZeroPool (sizeof (ISA_IO_DEVICE));
if (IsaIoDevice == NULL) {
return EFI_OUT_OF_RESOURCES;
}
IsaIoDevice->Signature = ISA_IO_DEVICE_SIGNATURE;
IsaIoDevice->Handle = NULL;
IsaIoDevice->PciIo = PciIo;
//
// Initialize the ISA I/O instance structure
//
Status = InitializeIsaIoInstance (IsaIoDevice, IsaDeviceResourceList);
if (EFI_ERROR (Status)) {
gBS->FreePool (IsaIoDevice);
return Status;
}
//
// Build the child device path
//
Node.DevPath.Type = ACPI_DEVICE_PATH;
Node.DevPath.SubType = ACPI_DP;
SetDevicePathNodeLength (&Node.DevPath, sizeof (ACPI_HID_DEVICE_PATH));
Node.Acpi.HID = IsaDeviceResourceList->Device.HID;
Node.Acpi.UID = IsaDeviceResourceList->Device.UID;
IsaIoDevice->DevicePath = AppendDevicePathNode (
ParentDevicePath,
&Node.DevPath
);
if (IsaIoDevice->DevicePath == NULL) {
Status = EFI_DEVICE_ERROR;
goto Done;
}
*ChildDevicePath = IsaIoDevice->DevicePath;
//
// Create a child handle and attach the DevicePath,
// PCI I/O, and Controller State
//
Status = gBS->InstallMultipleProtocolInterfaces (
&IsaIoDevice->Handle,
&gEfiDevicePathProtocolGuid,
IsaIoDevice->DevicePath,
&gEfiIsaIoProtocolGuid,
&IsaIoDevice->IsaIo,
NULL
);
if (EFI_ERROR (Status)) {
goto Done;
}
Status = gBS->OpenProtocol (
Controller,
&gEfiPciIoProtocolGuid,
(VOID **) &PciIo,
This->DriverBindingHandle,
IsaIoDevice->Handle,
EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
);
if (EFI_ERROR (Status)) {
gBS->UninstallMultipleProtocolInterfaces (
IsaIoDevice->Handle,
&gEfiDevicePathProtocolGuid,
IsaIoDevice->DevicePath,
&gEfiIsaIoProtocolGuid,
&IsaIoDevice->IsaIo,
NULL
);
}
Done:
if (EFI_ERROR (Status)) {
if (IsaIoDevice->DevicePath != NULL) {
gBS->FreePool (IsaIoDevice->DevicePath);
}
gBS->FreePool (IsaIoDevice);
}
return Status;
}

View File

@ -0,0 +1,145 @@
#/** @file
# Component description file for IsaBus module.
#
# Discovers all the ISA Controllers and their resources by using the ISA PnP
# Protocol, produces an instance of the ISA I/O Protocol for every ISA
# Controller found, loads and initializes all ISA Device Drivers, matches ISA
# Device Drivers with their respective ISA Controllers in a deterministic
# manner, and informs a ISA Device Driver when it is to start managing an ISA
# Controller.
# Copyright (c) 2006 - 2007, Intel Corporation.
#
# All rights reserved.
# This software and associated documentation (if any) is furnished
# under a license and may only be used or copied in accordance
# with the terms of the license. Except as permitted by such
# license, no part of this software or documentation may be
# reproduced, stored in a retrieval system, or transmitted in any
# form or by any means without the express written consent of
# Intel Corporation.
#
#
#**/
################################################################################
#
# Defines Section - statements that will be processed to create a Makefile.
#
################################################################################
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = IsaBus
FILE_GUID = 240612B5-A063-11d4-9A3A-0090273FC14D
MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0
EDK_RELEASE_VERSION = 0x00020000
EFI_SPECIFICATION_VERSION = 0x00020000
ENTRY_POINT = InitializeIsaBus
#
# The following information is for reference only and not required by the build tools.
#
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
#
# DRIVER_BINDING = gIsaBusControllerDriver
# COMPONENT_NAME = gIsaBusComponentName
#
################################################################################
#
# Sources Section - list of files that are required for the build to succeed.
#
################################################################################
[Sources.common]
ComponentName.c
IsaIo.c
IsaBus.c
IsaIo.h
IsaBus.h
IsaAcpi.h
ComponentName.h
CommonHeader.h
EntryPoint.c
################################################################################
#
# Includes Section - list of Include locations that are required for
# this module.
#
################################################################################
[Includes]
################################################################################
#
# Package Dependency Section - list of Package files that are required for
# this module.
#
################################################################################
[Packages]
MdePkg/MdePkg.dec
IntelFrameworkPkg/IntelFrameworkPkg.dec
MdeModulePkg/MdeModulePkg.dec
IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
################################################################################
#
# Library Class Section - list of Library Classes that are required for
# this module.
#
################################################################################
[LibraryClasses]
PcdLib
BootScriptLib
ReportStatusCodeLib
UefiBootServicesTableLib
MemoryAllocationLib
BaseMemoryLib
DevicePathLib
UefiLib
UefiDriverEntryPoint
DebugLib
################################################################################
#
# Guid C Name Section - list of Guids that this module uses or produces.
#
################################################################################
[Guids]
gEfiStatusCodeSpecificDataGuid # ALWAYS_CONSUMED
################################################################################
#
# Protocol C Name Section - list of Protocol and Protocol Notify C Names
# that this module uses or produces.
#
################################################################################
[Protocols]
gEfiIsaIoProtocolGuid # PROTOCOL BY_START
gEfiIsaAcpiProtocolGuid # PROTOCOL TO_START
gEfiPciIoProtocolGuid # PROTOCOL TO_START
gEfiDevicePathProtocolGuid # PROTOCOL TO_START
gEfiGenericMemTestProtocolGuid # PROTOCOL TO_START
################################################################################
#
# Pcd FEATURE_FLAG - list of PCDs that this module is coded for.
#
################################################################################
[PcdsFeatureFlag.common]
PcdIsaBusOnlySupportSlaveDma|gEfiIntelFrameworkModulePkgTokenSpaceGuid
PcdIsaBusSupportDma|gEfiIntelFrameworkModulePkgTokenSpaceGuid
PcdIsaBusSupportIsaMemory|gEfiIntelFrameworkModulePkgTokenSpaceGuid

View File

@ -0,0 +1,142 @@
<?xml version="1.0" encoding="UTF-8"?>
<ModuleSurfaceArea xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0 http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd" xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<MsaHeader>
<ModuleName>IsaBus</ModuleName>
<ModuleType>DXE_DRIVER</ModuleType>
<GuidValue>240612B5-A063-11d4-9A3A-0090273FC14D</GuidValue>
<Version>1.0</Version>
<Abstract>Component description file for IsaBus module.</Abstract>
<Description>Discovers all the ISA Controllers and their resources by using the ISA PnP
Protocol, produces an instance of the ISA I/O Protocol for every ISA
Controller found, loads and initializes all ISA Device Drivers, matches ISA
Device Drivers with their respective ISA Controllers in a deterministic
manner, and informs a ISA Device Driver when it is to start managing an ISA
Controller.</Description>
<Copyright>Copyright (c) 2006 - 2007, Intel Corporation.</Copyright>
<License>All rights reserved.
This software and associated documentation (if any) is furnished
under a license and may only be used or copied in accordance
with the terms of the license. Except as permitted by such
license, no part of this software or documentation may be
reproduced, stored in a retrieval system, or transmitted in any
form or by any means without the express written consent of
Intel Corporation.</License>
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
</MsaHeader>
<ModuleDefinitions>
<SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>
<BinaryModule>false</BinaryModule>
<OutputFileBasename>IsaBus</OutputFileBasename>
</ModuleDefinitions>
<LibraryClassDefinitions>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>DebugLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>UefiDriverModelLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>UefiDriverEntryPoint</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>UefiLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>DevicePathLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>BaseMemoryLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>MemoryAllocationLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>UefiBootServicesTableLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>ReportStatusCodeLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>BootScriptLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>PcdLib</Keyword>
</LibraryClass>
</LibraryClassDefinitions>
<SourceFiles>
<Filename>ComponentName.h</Filename>
<Filename>IsaAcpi.h</Filename>
<Filename>IsaBus.h</Filename>
<Filename>IsaIo.h</Filename>
<Filename>IsaBus.c</Filename>
<Filename>IsaIo.c</Filename>
<Filename>ComponentName.c</Filename>
</SourceFiles>
<PackageDependencies>
<Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
<Package PackageGuid="68169ab0-d41b-4009-9060-292c253ac43d"/>
<Package PackageGuid="bea835f9-fd62-464a-81ff-f3a806360c6b"/>
</PackageDependencies>
<Protocols>
<Protocol Usage="TO_START">
<ProtocolCName>gEfiGenericMemTestProtocolGuid</ProtocolCName>
</Protocol>
<Protocol Usage="TO_START">
<ProtocolCName>gEfiDevicePathProtocolGuid</ProtocolCName>
</Protocol>
<Protocol Usage="TO_START">
<ProtocolCName>gEfiPciIoProtocolGuid</ProtocolCName>
</Protocol>
<Protocol Usage="TO_START">
<ProtocolCName>gEfiIsaAcpiProtocolGuid</ProtocolCName>
</Protocol>
<Protocol Usage="BY_START">
<ProtocolCName>gEfiIsaIoProtocolGuid</ProtocolCName>
</Protocol>
</Protocols>
<Guids>
<GuidCNames Usage="ALWAYS_CONSUMED">
<GuidCName>gEfiStatusCodeSpecificDataGuid</GuidCName>
</GuidCNames>
</Guids>
<Externs>
<Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>
<Specification>EDK_RELEASE_VERSION 0x00020000</Specification>
<Extern>
<DriverBinding>gIsaBusControllerDriver</DriverBinding>
<ComponentName>gIsaBusComponentName</ComponentName>
</Extern>
</Externs>
<PcdCoded>
<PcdEntry PcdItemType="FEATURE_FLAG" Usage="ALWAYS_CONSUMED">
<C_Name>PcdIsaBusSupportIsaMemory</C_Name>
<TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
<DefaultValue>TRUE</DefaultValue>
<HelpText>This feature flag is used to enable the implementation for interface
_EFI_ISA_IO_PROTOCOL.Mem.Read, _EFI_ISA_IO_PROTOCOL.Mem.Write and _EFI_ISA_IO_PROTOCOL.CopyMem.
If it is unset, these interfaces will return EFI_UNSUPPORTED. When it is disabled,
it is will save code size if a platform does not have ISA device with ISA memory.</HelpText>
</PcdEntry>
<PcdEntry PcdItemType="FEATURE_FLAG" Usage="ALWAYS_CONSUMED">
<C_Name>PcdIsaBusSupportDma</C_Name>
<TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
<DefaultValue>TRUE</DefaultValue>
<HelpText>This feature flag is used to enable the implementation for interface
_EFI_ISA_IO_PROTOCOL.AllocateBuffer, _EFI_ISA_IO_PROTOCOL.FreeBuffer, _EFI_ISA_IO_PROTOCOL.Map
and _EFI_ISA_IO_PROTOCOL.UnMap. If it is unset, these interfaces will return EFI_UNSUPPORTED.
It is useful to save code size if a platform does not have ISA device which did DMA transfer.</HelpText>
</PcdEntry>
<PcdEntry PcdItemType="FEATURE_FLAG" Usage="ALWAYS_CONSUMED">
<C_Name>PcdIsaBusOnlySupportSlaveDma</C_Name>
<TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
<DefaultValue>FALSE</DefaultValue>
<HelpText>This feature flag is used to enable the implementation for interface
_EFI_ISA_IO_PROTOCOL.Map and _EFI_ISA_IO_PROTOCOL.UnMap to only support Slave DMA
transfers. In addition, unsetting this feature flag also make AllocateBuffer() and
FreeBuffer() to return EFI_UNSUPPORTED. It is useful to save code size if a platform have only
ISA device to do slave DMA R/W transfer. This flag is only effective when PcdIsaBusSupportDma
is set to TRUE. If PcdIsaBusSupportDma is set to FALSE, Map() and UnMap() will simply
return EFI_UNSUPPORTED. Please check description for PcdIsaBusSupportDma for details.</HelpText>
</PcdEntry>
</PcdCoded>
</ModuleSurfaceArea>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,105 @@
/** @file
Include file for PC-AT compatability.
Copyright (c) 2006, Intel Corporation. All rights reserved.
This software and associated documentation (if any) is furnished
under a license and may only be used or copied in accordance
with the terms of the license. Except as permitted by such
license, no part of this software or documentation may be
reproduced, stored in a retrieval system, or transmitted in any
form or by any means without the express written consent of
Intel Corporation.
**/
#ifndef _PC_AT_H_
#define _PC_AT_H_
//
// 8254 Timer
//
#define TIMER0_COUNT_PORT 0x40
#define TIMER1_COUNT_PORT 0x41
#define TIMER2_COUNT_PORT 0x42
#define TIMER_CONTROL_PORT 0x43
//
// 8259 PIC interrupt controller
//
#define PIC_CONTROL_REGISTER_MASTER 0x20
#define PIC_MASK_REGISTER_MASTER 0x21
#define PIC_CONTROL_REGISTER_SLAVE 0xA0
#define PIC_MASK_REGISTER_SLAVE 0xA1
#define PIC_EDGE_LEVEL_TRIGGERED_REGISTER_MASTER 0x4D0
#define PIC_EDGE_LEVEL_TRIGGERED_REGISTER_SLAVE 0x4D1
#define PIC_EOI 0x20
//
// 8237 DMA registers
//
#define R_8237_DMA_BASE_CA_CH0 0x00
#define R_8237_DMA_BASE_CA_CH1 0x02
#define R_8237_DMA_BASE_CA_CH2 0x04
#define R_8237_DMA_BASE_CA_CH3 0xd6
#define R_8237_DMA_BASE_CA_CH5 0xc4
#define R_8237_DMA_BASE_CA_CH6 0xc8
#define R_8237_DMA_BASE_CA_CH7 0xcc
#define R_8237_DMA_BASE_CC_CH0 0x01
#define R_8237_DMA_BASE_CC_CH1 0x03
#define R_8237_DMA_BASE_CC_CH2 0x05
#define R_8237_DMA_BASE_CC_CH3 0xd7
#define R_8237_DMA_BASE_CC_CH5 0xc6
#define R_8237_DMA_BASE_CC_CH6 0xca
#define R_8237_DMA_BASE_CC_CH7 0xce
#define R_8237_DMA_MEM_LP_CH0 0x87
#define R_8237_DMA_MEM_LP_CH1 0x83
#define R_8237_DMA_MEM_LP_CH2 0x81
#define R_8237_DMA_MEM_LP_CH3 0x82
#define R_8237_DMA_MEM_LP_CH5 0x8B
#define R_8237_DMA_MEM_LP_CH6 0x89
#define R_8237_DMA_MEM_LP_CH7 0x8A
#define R_8237_DMA_COMMAND_CH0_3 0x08
#define R_8237_DMA_COMMAND_CH4_7 0xd0
#define B_8237_DMA_COMMAND_GAP 0x10
#define B_8237_DMA_COMMAND_CGE 0x04
#define R_8237_DMA_STA_CH0_3 0xd8
#define R_8237_DMA_STA_CH4_7 0xd0
#define R_8237_DMA_WRSMSK_CH0_3 0x0a
#define R_8237_DMA_WRSMSK_CH4_7 0xd4
#define B_8237_DMA_WRSMSK_CMS 0x04
#define R_8237_DMA_CHMODE_CH0_3 0x0b
#define R_8237_DMA_CHMODE_CH4_7 0xd6
#define V_8237_DMA_CHMODE_DEMAND 0x00
#define V_8237_DMA_CHMODE_SINGLE 0x40
#define V_8237_DMA_CHMODE_CASCADE 0xc0
#define B_8237_DMA_CHMODE_DECREMENT 0x20
#define B_8237_DMA_CHMODE_INCREMENT 0x00
#define B_8237_DMA_CHMODE_AE 0x10
#define V_8237_DMA_CHMODE_VERIFY 0
#define V_8237_DMA_CHMODE_IO2MEM 0x04
#define V_8237_DMA_CHMODE_MEM2IO 0x08
#define R_8237_DMA_CBPR_CH0_3 0x0c
#define R_8237_DMA_CBPR_CH4_7 0xd8
#define R_8237_DMA_MCR_CH0_3 0x0d
#define R_8237_DMA_MCR_CH4_7 0xda
#define R_8237_DMA_CLMSK_CH0_3 0x0e
#define R_8237_DMA_CLMSK_CH4_7 0xdc
#define R_8237_DMA_WRMSK_CH0_3 0x0f
#define R_8237_DMA_WRMSK_CH4_7 0xde
#endif

View File

@ -0,0 +1,177 @@
/*++
Copyright (c) 2006 - 2007, 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.
Module Name:
IsaIo.h
Abstract:
EFI ISA I/O Protocol
Revision History
--*/
#ifndef _EFI_ISA_IO_H
#define _EFI_ISA_IO_H
#include <Protocol/IsaAcpi.h>
//
// Global ID for the ISA I/O Protocol
//
#define EFI_ISA_IO_PROTOCOL_GUID \
{ 0x7ee2bd44, 0x3da0, 0x11d4, { 0x9a, 0x38, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } }
typedef struct _EFI_ISA_IO_PROTOCOL EFI_ISA_IO_PROTOCOL;
//
// Prototypes for the ISA I/O Protocol
//
typedef enum {
EfiIsaIoWidthUint8,
EfiIsaIoWidthUint16,
EfiIsaIoWidthUint32,
EfiIsaIoWidthReserved,
EfiIsaIoWidthFifoUint8,
EfiIsaIoWidthFifoUint16,
EfiIsaIoWidthFifoUint32,
EfiIsaIoWidthFifoReserved,
EfiIsaIoWidthFillUint8,
EfiIsaIoWidthFillUint16,
EfiIsaIoWidthFillUint32,
EfiIsaIoWidthFillReserved,
EfiIsaIoWidthMaximum
} EFI_ISA_IO_PROTOCOL_WIDTH;
//
// Attributes for common buffer allocations
//
#define EFI_ISA_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x080 // Map a memory range so write are combined
#define EFI_ISA_IO_ATTRIBUTE_MEMORY_CACHED 0x800 // Map a memory range so all r/w accesses are cached
#define EFI_ISA_IO_ATTRIBUTE_MEMORY_DISABLE 0x1000 // Disable a memory range
//
// Channel attribute for DMA operations
//
#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_COMPATIBLE 0x001
#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_A 0x002
#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_B 0x004
#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_C 0x008
#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_WIDTH_8 0x010
#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_WIDTH_16 0x020
#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SINGLE_MODE 0x040
#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_DEMAND_MODE 0x080
#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_AUTO_INITIALIZE 0x100
typedef enum {
EfiIsaIoOperationBusMasterRead,
EfiIsaIoOperationBusMasterWrite,
EfiIsaIoOperationBusMasterCommonBuffer,
EfiIsaIoOperationSlaveRead,
EfiIsaIoOperationSlaveWrite,
EfiIsaIoOperationMaximum
} EFI_ISA_IO_PROTOCOL_OPERATION;
typedef
EFI_STATUS
(EFIAPI *EFI_ISA_IO_PROTOCOL_IO_MEM) (
IN EFI_ISA_IO_PROTOCOL *This,
IN EFI_ISA_IO_PROTOCOL_WIDTH Width,
IN UINT32 Offset,
IN UINTN Count,
IN OUT VOID *Buffer
);
typedef struct {
EFI_ISA_IO_PROTOCOL_IO_MEM Read;
EFI_ISA_IO_PROTOCOL_IO_MEM Write;
} EFI_ISA_IO_PROTOCOL_ACCESS;
typedef
EFI_STATUS
(EFIAPI *EFI_ISA_IO_PROTOCOL_COPY_MEM) (
IN EFI_ISA_IO_PROTOCOL *This,
IN EFI_ISA_IO_PROTOCOL_WIDTH Width,
IN UINT32 DestOffset,
IN UINT32 SrcOffset,
IN UINTN Count
);
typedef
EFI_STATUS
(EFIAPI *EFI_ISA_IO_PROTOCOL_MAP) (
IN EFI_ISA_IO_PROTOCOL *This,
IN EFI_ISA_IO_PROTOCOL_OPERATION Operation,
IN UINT8 ChannelNumber OPTIONAL,
IN UINT32 ChannelAttributes,
IN VOID *HostAddress,
IN OUT UINTN *NumberOfBytes,
OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
OUT VOID **Mapping
);
typedef
EFI_STATUS
(EFIAPI *EFI_ISA_IO_PROTOCOL_UNMAP) (
IN EFI_ISA_IO_PROTOCOL *This,
IN VOID *Mapping
);
typedef
EFI_STATUS
(EFIAPI *EFI_ISA_IO_PROTOCOL_ALLOCATE_BUFFER) (
IN EFI_ISA_IO_PROTOCOL *This,
IN EFI_ALLOCATE_TYPE Type,
IN EFI_MEMORY_TYPE MemoryType,
IN UINTN Pages,
OUT VOID **HostAddress,
IN UINT64 Attributes
);
typedef
EFI_STATUS
(EFIAPI *EFI_ISA_IO_PROTOCOL_FREE_BUFFER) (
IN EFI_ISA_IO_PROTOCOL *This,
IN UINTN Pages,
IN VOID *HostAddress
);
typedef
EFI_STATUS
(EFIAPI *EFI_ISA_IO_PROTOCOL_FLUSH) (
IN EFI_ISA_IO_PROTOCOL *This
);
//
// Interface structure for the ISA I/O Protocol
//
struct _EFI_ISA_IO_PROTOCOL {
EFI_ISA_IO_PROTOCOL_ACCESS Mem;
EFI_ISA_IO_PROTOCOL_ACCESS Io;
EFI_ISA_IO_PROTOCOL_COPY_MEM CopyMem;
EFI_ISA_IO_PROTOCOL_MAP Map;
EFI_ISA_IO_PROTOCOL_UNMAP Unmap;
EFI_ISA_IO_PROTOCOL_ALLOCATE_BUFFER AllocateBuffer;
EFI_ISA_IO_PROTOCOL_FREE_BUFFER FreeBuffer;
EFI_ISA_IO_PROTOCOL_FLUSH Flush;
EFI_ISA_ACPI_RESOURCE_LIST *ResourceList;
UINT32 RomSize;
VOID *RomImage;
};
extern EFI_GUID gEfiIsaIoProtocolGuid;
#endif

View File

@ -65,8 +65,6 @@
gMemoryStatusCodeRecordGuid = { 0x060CC026, 0x4C0D, 0x4DDA, { 0x8F, 0x41, 0x59, 0x5F, 0xEF, 0x00, 0xA5, 0x02 }}
################################################################################
#
# Global Protocols Definition section - list of Global Protocols C Name Data
@ -78,8 +76,7 @@
gEfiVgaMiniPortProtocolGuid = { 0xc7735a2f, 0x88f5, 0x4882, { 0xae, 0x63, 0xfa, 0xac, 0x8c, 0x8b, 0x86, 0xb3 }}
gEfiPciHotPlugInitProtocolGuid = { 0xAA0E8BC1, 0xDABC, 0x46B0, { 0xA8, 0x44, 0x37, 0xB8, 0x16, 0x9B, 0x2B, 0xEA }}
gEfiPciHotPlugRequestProtocolGuid = { 0x19CB87AB, 0x2CB9, 0x4665, { 0x83, 0x60, 0xDD, 0xCF, 0x60, 0x54, 0xF7, 0x9D }}
gEfiIsaIoProtocolGuid = { 0x7ee2bd44, 0x3da0, 0x11d4, { 0x9a, 0x38, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }}
################################################################################
@ -109,6 +106,9 @@
PcdPciIsaEnable|0x00010039|gEfiIntelFrameworkModulePkgTokenSpaceGuid|BOOLEAN|FALSE
PcdPciVgaEnable|0x0001003a|gEfiIntelFrameworkModulePkgTokenSpaceGuid|BOOLEAN|FALSE
PcdPciBusHotplugDeviceSupport|0x0001003d|gEfiIntelFrameworkModulePkgTokenSpaceGuid|BOOLEAN|TRUE
PcdIsaBusSupportDma|0x00010040|gEfiIntelFrameworkModulePkgTokenSpaceGuid|BOOLEAN|TRUE
PcdIsaBusOnlySupportSlaveDma|0x00010041|gEfiIntelFrameworkModulePkgTokenSpaceGuid|BOOLEAN|FALSE
PcdIsaBusSupportIsaMemory|0x00010042|gEfiIntelFrameworkModulePkgTokenSpaceGuid|BOOLEAN|TRUE
[PcdsFixedAtBuild.common]
PcdStatusCodeMemorySize|0x00010025|gEfiIntelFrameworkModulePkgTokenSpaceGuid|UINT16|1

View File

@ -77,6 +77,7 @@
DxeServicesTableLib|${WORKSPACE}/MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf
FvbServiceLib|${WORKSPACE}/MdeModulePkg/Library/EdkFvbServiceLib/EdkFvbServiceLib.inf
ReportStatusCodeLib|${WORKSPACE}/IntelFrameworkPkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
BootScriptLib|${WORKSPACE}/IntelFrameworkPkg/Library/DxeBootScriptLibNull/DxeBootScriptLibNull.inf
HiiLibFramework|$(WORKSPACE)/IntelFrameworkPkg/Library/HiiLibFramework/HiiLib.inf
IfrSupportLibFramework|$(WORKSPACE)/IntelFrameworkPkg/Library/IfrSupportLibFramework/IfrSupportLib.inf
PciIncompatibleDeviceSupportLib|${WORKSPACE}/IntelFrameworkModulePkg/Library/PciIncompatibleDeviceSupportLib/PciIncompatibleDeviceSupportLib.inf
@ -121,6 +122,9 @@
PcdPciIsaEnable|gEfiIntelFrameworkModulePkgTokenSpaceGuid|FALSE
PcdPciVgaEnable|gEfiIntelFrameworkModulePkgTokenSpaceGuid|FALSE
PcdPciBusHotplugDeviceSupport|gEfiIntelFrameworkModulePkgTokenSpaceGuid|TRUE
PcdIsaBusSupportDma|gEfiIntelFrameworkModulePkgTokenSpaceGuid|TRUE
PcdIsaBusOnlySupportSlaveDma|gEfiIntelFrameworkModulePkgTokenSpaceGuid|FALSE
PcdIsaBusSupportIsaMemory|gEfiIntelFrameworkModulePkgTokenSpaceGuid|TRUE
[PcdsFixedAtBuild.common]
PcdMaximumUnicodeStringLength|gEfiMdePkgTokenSpaceGuid|1000000
@ -160,6 +164,7 @@
$(WORKSPACE)/IntelFrameworkModulePkg/Library\GraphicsLib\GraphicsLib.inf
$(WORKSPACE)/IntelFrameworkModulePkg/Bus\Pci\PciBus\Dxe\PciBus.inf
$(WORKSPACE)/IntelFrameworkModulePkg/Bus\Pci\IdeBus\Dxe\IdeBus.inf
$(WORKSPACE)\IntelFrameworkModulePkg\Bus\Isa\IsaBusDxe\IsaBus.inf
$(WORKSPACE)/IntelFrameworkModulePkg/Universal/DataHub/DataHub/Dxe/DataHub.inf
$(WORKSPACE)/IntelFrameworkModulePkg/Universal/DataHub/DataHubStdErr/Dxe/DataHubStdErr.inf
$(WORKSPACE)/IntelFrameworkModulePkg/Universal/StatusCode/Dxe/DxeStatusCode.inf

View File

@ -0,0 +1,530 @@
/*++
Copyright (c) 2006, Intel Corporation. All rights reserved.
This software and associated documentation (if any) is furnished
under a license and may only be used or copied in accordance
with the terms of the license. Except as permitted by such
license, no part of this software or documentation may be
reproduced, stored in a retrieval system, or transmitted in any
form or by any means without the express written consent of
Intel Corporation.
Module Name:
EfiScriptLib.h
Abstract:
--*/
#ifndef _BOOT_SCRIPT_LIB_H_
#define _BOOT_SCRIPT_LIB_H_
#include <PiPei.h>
#include <Ppi/BootScriptExecuter.h>
#include <IndustryStandard/SmBus.h>
EFI_STATUS
EFIAPI
BootScriptSaveIoWrite (
IN UINT16 TableName,
IN EFI_BOOT_SCRIPT_WIDTH Width,
IN UINT64 Address,
IN UINTN Count,
IN VOID *Buffer
)
/*++
Routine Description:
Save I/O write to boot script with opcode EFI_BOOT_SCRIPT_IO_WRITE_OPCODE
Arguments:
TableName - Desired boot script table
Width - The width of the I/O operations.
Address - The base address of the I/O operations.
Count - The number of I/O operations to perform.
Buffer - The source buffer from which to write data.
Returns:
EFI_NOT_FOUND - BootScriptSave Protocol not exist.
EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
--*/
;
EFI_STATUS
EFIAPI
BootScriptSaveIoReadWrite (
IN UINT16 TableName,
IN EFI_BOOT_SCRIPT_WIDTH Width,
IN UINT64 Address,
IN VOID *Data,
IN VOID *DataMask
)
/*++
Routine Description:
Save I/O modify to boot script with opcode EFI_BOOT_SCRIPT_IO_READ_WRITE_OPCODE
Arguments:
TableName - Desired boot script table
Width - The width of the I/O operations.
Address - The base address of the I/O operations.
Data - A pointer to the data to be OR-ed.
DataMask - A pointer to the data mask to be AND-ed with the data read from the register.
Returns:
EFI_NOT_FOUND - BootScriptSave Protocol not exist.
EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
--*/
;
EFI_STATUS
EFIAPI
BootScriptSaveMemWrite (
IN UINT16 TableName,
IN EFI_BOOT_SCRIPT_WIDTH Width,
IN UINT64 Address,
IN UINTN Count,
IN VOID *Buffer
)
/*++
Routine Description:
Save memory write to boot script with opcode EFI_BOOT_SCRIPT_MEM_WRITE_OPCODE
Arguments:
TableName - Desired boot script table
Width - The width of the memory operations.
Address - The base address of the memory operations.
Count - The number of memory operations to perform.
Buffer - The source buffer from which to write the data.
Returns:
EFI_NOT_FOUND - BootScriptSave Protocol not exist.
EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
--*/
;
EFI_STATUS
EFIAPI
BootScriptSaveMemReadWrite (
IN UINT16 TableName,
IN EFI_BOOT_SCRIPT_WIDTH Width,
IN UINT64 Address,
IN VOID *Data,
IN VOID *DataMask
)
/*++
Routine Description:
Save memory modify to boot script with opcode EFI_BOOT_SCRIPT_MEM_READ_WRITE_OPCODE
Arguments:
TableName - Desired boot script table
Width - The width of the memory operations.
Address - The base address of the memory operations.
Data - A pointer to the data to be OR-ed.
DataMask - A pointer to the data mask to be AND-ed with the data read from the register.
Returns:
EFI_NOT_FOUND - BootScriptSave Protocol not exist.
EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
--*/
;
EFI_STATUS
EFIAPI
BootScriptSavePciCfgWrite (
IN UINT16 TableName,
IN EFI_BOOT_SCRIPT_WIDTH Width,
IN UINT64 Address,
IN UINTN Count,
IN VOID *Buffer
)
/*++
Routine Description:
Save PCI configuration space write operation to boot script with opcode
EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE_OPCODE
Arguments:
TableName - Desired boot script table
Width - The width of the PCI operations
Address - The address within the PCI configuration space.
Count - The number of PCI operations to perform.
Buffer - The source buffer from which to write the data.
Returns:
EFI_NOT_FOUND - BootScriptSave Protocol not exist.
EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
--*/
;
EFI_STATUS
EFIAPI
BootScriptSavePciCfgReadWrite (
IN UINT16 TableName,
IN EFI_BOOT_SCRIPT_WIDTH Width,
IN UINT64 Address,
IN VOID *Data,
IN VOID *DataMask
)
/*++
Routine Description:
Save PCI configuration space modify operation to boot script with opcode
EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_OPCODE
Arguments:
TableName - Desired boot script table
Width - The width of the PCI operations
Address - The address within the PCI configuration space.
Data - A pointer to the data to be OR-ed.
DataMask - A pointer to the data mask to be AND-ed with the data read from the register.
Returns:
EFI_NOT_FOUND - BootScriptSave Protocol not exist.
EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
--*/
;
EFI_STATUS
EFIAPI
BootScriptSaveSmbusExecute (
IN UINT16 TableName,
IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,
IN EFI_SMBUS_DEVICE_COMMAND Command,
IN EFI_SMBUS_OPERATION Operation,
IN BOOLEAN PecCheck,
IN UINTN *Length,
IN VOID *Buffer
)
/*++
Routine Description:
Save SMBus command execution to boot script with opcode
EFI_BOOT_SCRIPT_SMBUS_EXECUTE_OPCODE
Arguments:
TableName - Desired boot script table
SlaveAddress - The SMBus address for the slave device that the operation is targeting.
Command - The command that is transmitted by the SMBus host controller to the
SMBus slave device.
Operation - Indicates which particular SMBus protocol it will use to execute the
SMBus transactions.
PecCheck - Defines if Packet Error Code (PEC) checking is required for this operation.
Length - A pointer to signify the number of bytes that this operation will do.
Buffer - Contains the value of data to execute to the SMBUS slave device.
Returns:
EFI_NOT_FOUND - BootScriptSave Protocol not exist.
EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
--*/
;
EFI_STATUS
EFIAPI
BootScriptSaveStall (
IN UINT16 TableName,
IN UINTN Duration
)
/*++
Routine Description:
Save execution stall on the processor to boot script with opcode
EFI_BOOT_SCRIPT_STALL_OPCODE
Arguments:
TableName - Desired boot script table
Duration - Duration in microseconds of the stall.
Returns:
EFI_NOT_FOUND - BootScriptSave Protocol not exist.
EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
--*/
;
EFI_STATUS
EFIAPI
BootScriptSaveDispatch (
IN UINT16 TableName,
IN EFI_PHYSICAL_ADDRESS EntryPoint
)
/*++
Routine Description:
Save dispatching specified arbitrary code to boot script with opcode
EFI_BOOT_SCRIPT_DISPATCH_OPCODE
Arguments:
TableName - Desired boot script table
EntryPoint - Entry point of the code to be dispatched.
Returns:
EFI_NOT_FOUND - BootScriptSave Protocol not exist.
EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
--*/
;
EFI_STATUS
EFIAPI
BootScriptSaveDispatch2 (
IN UINT16 TableName,
IN EFI_PHYSICAL_ADDRESS EntryPoint,
IN EFI_PHYSICAL_ADDRESS Context
)
/*++
Routine Description:
Save dispatching specified arbitrary code to boot script with opcode
EFI_BOOT_SCRIPT_DISPATCH_OPCODE
Arguments:
TableName - Desired boot script table
EntryPoint - Entry point of the code to be dispatched.
Context - The data that will be passed into code.
Returns:
EFI_NOT_FOUND - BootScriptSave Protocol not exist.
EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
--*/
;
EFI_STATUS
EFIAPI
BootScriptSaveDispatch2Image (
IN UINT16 TableName,
IN EFI_GUID *FfsName,
IN EFI_PHYSICAL_ADDRESS Context,
IN EFI_HANDLE ParentHandle
)
/*++
Routine Description:
Save dispatching specified arbitrary code to boot script with opcode
EFI_BOOT_SCRIPT_DISPATCH_OPCODE
Arguments:
TableName - Desired boot script table
FfsName - The file name of the code to be dispatched.
Context - The data that will be passed into code.
ParentHandle - The caller's image handle.
Returns:
EFI_NOT_FOUND - BootScriptSave Protocol not exist.
EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
--*/
;
EFI_STATUS
EFIAPI
BootScriptSaveInformation (
IN UINT16 TableName,
IN UINT32 Length,
IN EFI_PHYSICAL_ADDRESS Buffer
)
/*++
Routine Description:
Save information specified by Buffer, length is specified by Length, to
boot script with opcode EFI_BOOT_SCRIPT_INFORMATION_OPCODE
Arguments:
TableName - Desired boot script table
FfsName - The file name of the code to be dispatched.
Context - The data that will be passed into code.
ParentHandle - The caller's image handle.
Returns:
EFI_NOT_FOUND - BootScriptSave Protocol not exist.
EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
--*/
;
EFI_STATUS
EFIAPI
BootScriptSaveInformationUnicodeString (
IN UINT16 TableName,
IN CONST CHAR16 *String
)
/*++
Routine Description:
Save unicode string information specified by Buffer to
boot script with opcode EFI_BOOT_SCRIPT_INFORMATION_OPCODE
Arguments:
TableName - Desired boot script table
FfsName - The file name of the code to be dispatched.
Context - The data that will be passed into code.
ParentHandle - The caller's image handle.
Returns:
EFI_NOT_FOUND - BootScriptSave Protocol not exist.
EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
--*/
;
EFI_STATUS
EFIAPI
BootScriptSaveInformationAsciiString (
IN UINT16 TableName,
IN CONST CHAR8 *String
)
/*++
Routine Description:
Save ASCII string information specified by Buffer to
boot script with opcode EFI_BOOT_SCRIPT_INFORMATION_OPCODE
Arguments:
TableName - Desired boot script table
FfsName - The file name of the code to be dispatched.
Context - The data that will be passed into code.
ParentHandle - The caller's image handle.
Returns:
EFI_NOT_FOUND - BootScriptSave Protocol not exist.
EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
--*/
;
EFI_STATUS
EFIAPI
BootScriptSaveInitialize (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
/*++
Routine Description:
Intialize Boot Script Lib if it has not yet been initialized.
Arguments:
ImageHandle - The firmware allocated handle for the EFI image.
SystemTable - A pointer to the EFI System Table.
Returns:
EFI_STATUS always returns EFI_SUCCESS
--*/
;
#endif

View File

@ -21,7 +21,51 @@
#ifndef _PEI_BOOT_SCRIPT_EXECUTER_PPI_H
#define _PEI_BOOT_SCRIPT_EXECUTER_PPI_H
#include <PiPei.h>
#define EFI_ACPI_S3_RESUME_SCRIPT_TABLE 0x00
//
// Boot Script Opcode Definitions
//
#define EFI_BOOT_SCRIPT_IO_WRITE_OPCODE 0x00
#define EFI_BOOT_SCRIPT_IO_READ_WRITE_OPCODE 0x01
#define EFI_BOOT_SCRIPT_MEM_WRITE_OPCODE 0x02
#define EFI_BOOT_SCRIPT_MEM_READ_WRITE_OPCODE 0x03
#define EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE_OPCODE 0x04
#define EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_OPCODE 0x05
#define EFI_BOOT_SCRIPT_SMBUS_EXECUTE_OPCODE 0x06
#define EFI_BOOT_SCRIPT_STALL_OPCODE 0x07
#define EFI_BOOT_SCRIPT_DISPATCH_OPCODE 0x08
//
// Extensions to boot script definitions
//
#define EFI_BOOT_SCRIPT_MEM_POLL_OPCODE 0x09
#define EFI_BOOT_SCRIPT_INFORMATION_OPCODE 0x0A
#define EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE_OPCODE 0x0B
#define EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE_OPCODE 0x0C
#define EFI_BOOT_SCRIPT_DISPATCH_2_OPCODE 0x0D
#define EFI_BOOT_SCRIPT_TABLE_OPCODE 0xAA
#define EFI_BOOT_SCRIPT_TERMINATE_OPCODE 0xFF
//
// EFI Boot Script Width
//
typedef enum {
EfiBootScriptWidthUint8,
EfiBootScriptWidthUint16,
EfiBootScriptWidthUint32,
EfiBootScriptWidthUint64,
EfiBootScriptWidthFifoUint8,
EfiBootScriptWidthFifoUint16,
EfiBootScriptWidthFifoUint32,
EfiBootScriptWidthFifoUint64,
EfiBootScriptWidthFillUint8,
EfiBootScriptWidthFillUint16,
EfiBootScriptWidthFillUint32,
EfiBootScriptWidthFillUint64,
EfiBootScriptWidthMaximum
} EFI_BOOT_SCRIPT_WIDTH;
#define EFI_PEI_BOOT_SCRIPT_EXECUTER_PPI_GUID \
{ \

View File

@ -0,0 +1,508 @@
/*++
Copyright (c) 2007, Intel Corporation. All rights reserved. <BR>
This software and associated documentation (if any) is furnished
under a license and may only be used or copied in accordance
with the terms of the license. Except as permitted by such
license, no part of this software or documentation may be
reproduced, stored in a retrieval system, or transmitted in any
form or by any means without the express written consent of
Intel Corporation.
Module Name:
BootScriptLib.c
Abstract:
Support for EFI script.
--*/
//
// The package level header files this module uses
//
#include <PiDxe.h>
//
// The protocols, PPI and GUID defintions for this module
//
//
// The Library classes this module consumes
//
#include <Library/BootScriptLib.h>
EFI_STATUS
EFIAPI
BootScriptSaveIoWrite (
IN UINT16 TableName,
IN EFI_BOOT_SCRIPT_WIDTH Width,
IN UINT64 Address,
IN UINTN Count,
IN VOID *Buffer
)
/*++
Routine Description:
Save I/O write to boot script
Arguments:
TableName - Desired boot script table
(Standard EFI IO write script parameter)
Returns:
EFI_NOT_FOUND - BootScriptSave Protocol not exist.
EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
--*/
// GC_TODO: Width - add argument and description to function comment
// GC_TODO: Address - add argument and description to function comment
// GC_TODO: Count - add argument and description to function comment
// GC_TODO: Buffer - add argument and description to function comment
{
return EFI_SUCCESS;
}
EFI_STATUS
EFIAPI
BootScriptSaveIoReadWrite (
IN UINT16 TableName,
IN EFI_BOOT_SCRIPT_WIDTH Width,
IN UINT64 Address,
IN VOID *Data,
IN VOID *DataMask
)
/*++
Routine Description:
Save I/O write to boot script
Arguments:
TableName - Desired boot script table
(Standard EFI IO read write script parameter)
Returns:
EFI_NOT_FOUND - BootScriptSave Protocol not exist.
EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
--*/
// GC_TODO: Width - add argument and description to function comment
// GC_TODO: Address - add argument and description to function comment
// GC_TODO: Data - add argument and description to function comment
// GC_TODO: DataMask - add argument and description to function comment
{
return EFI_SUCCESS;
}
EFI_STATUS
EFIAPI
BootScriptSaveMemWrite (
IN UINT16 TableName,
IN EFI_BOOT_SCRIPT_WIDTH Width,
IN UINT64 Address,
IN UINTN Count,
IN VOID *Buffer
)
/*++
Routine Description:
Save I/O write to boot script
Arguments:
TableName - Desired boot script table
(Standard EFI MEM write script parameter)
Returns:
EFI_NOT_FOUND - BootScriptSave Protocol not exist.
EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
--*/
// GC_TODO: Width - add argument and description to function comment
// GC_TODO: Address - add argument and description to function comment
// GC_TODO: Count - add argument and description to function comment
// GC_TODO: Buffer - add argument and description to function comment
{
return EFI_SUCCESS;
}
EFI_STATUS
EFIAPI
BootScriptSaveMemReadWrite (
IN UINT16 TableName,
IN EFI_BOOT_SCRIPT_WIDTH Width,
IN UINT64 Address,
IN VOID *Data,
IN VOID *DataMask
)
/*++
Routine Description:
Save I/O write to boot script
Arguments:
TableName - Desired boot script table
(Standard EFI MEM read write script parameter)
Returns:
EFI_NOT_FOUND - BootScriptSave Protocol not exist.
EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
--*/
// GC_TODO: Width - add argument and description to function comment
// GC_TODO: Address - add argument and description to function comment
// GC_TODO: Data - add argument and description to function comment
// GC_TODO: DataMask - add argument and description to function comment
{
return EFI_SUCCESS;
}
EFI_STATUS
EFIAPI
BootScriptSavePciCfgWrite (
IN UINT16 TableName,
IN EFI_BOOT_SCRIPT_WIDTH Width,
IN UINT64 Address,
IN UINTN Count,
IN VOID *Buffer
)
/*++
Routine Description:
Save I/O write to boot script
Arguments:
TableName - Desired boot script table
(Standard EFI PCI write script parameter)
Returns:
EFI_NOT_FOUND - BootScriptSave Protocol not exist.
EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
--*/
// GC_TODO: Width - add argument and description to function comment
// GC_TODO: Address - add argument and description to function comment
// GC_TODO: Count - add argument and description to function comment
// GC_TODO: Buffer - add argument and description to function comment
{
return EFI_SUCCESS;
}
EFI_STATUS
EFIAPI
BootScriptSavePciCfgReadWrite (
IN UINT16 TableName,
IN EFI_BOOT_SCRIPT_WIDTH Width,
IN UINT64 Address,
IN VOID *Data,
IN VOID *DataMask
)
/*++
Routine Description:
Save I/O write to boot script
Arguments:
TableName - Desired boot script table
(Standard EFI PCI read write script parameter)
Returns:
EFI_NOT_FOUND - BootScriptSave Protocol not exist.
EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
--*/
// GC_TODO: Width - add argument and description to function comment
// GC_TODO: Address - add argument and description to function comment
// GC_TODO: Data - add argument and description to function comment
// GC_TODO: DataMask - add argument and description to function comment
{
return EFI_SUCCESS;
}
EFI_STATUS
EFIAPI
BootScriptSaveSmbusExecute (
IN UINT16 TableName,
IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,
IN EFI_SMBUS_DEVICE_COMMAND Command,
IN EFI_SMBUS_OPERATION Operation,
IN BOOLEAN PecCheck,
IN UINTN *Length,
IN VOID *Buffer
)
/*++
Routine Description:
Save I/O write to boot script
Arguments:
TableName - Desired boot script table
(Standard EFI Smbus execute script parameter)
Returns:
EFI_NOT_FOUND - BootScriptSave Protocol not exist.
EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
--*/
// GC_TODO: SlaveAddress - add argument and description to function comment
// GC_TODO: Command - add argument and description to function comment
// GC_TODO: Operation - add argument and description to function comment
// GC_TODO: PecCheck - add argument and description to function comment
// GC_TODO: Length - add argument and description to function comment
// GC_TODO: Buffer - add argument and description to function comment
{
return EFI_SUCCESS;
}
EFI_STATUS
EFIAPI
BootScriptSaveStall (
IN UINT16 TableName,
IN UINTN Duration
)
/*++
Routine Description:
Save I/O write to boot script
Arguments:
TableName - Desired boot script table
(Standard EFI stall script parameter)
Returns:
EFI_NOT_FOUND - BootScriptSave Protocol not exist.
EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
--*/
// GC_TODO: Duration - add argument and description to function comment
{
return EFI_SUCCESS;
}
EFI_STATUS
EFIAPI
BootScriptSaveDispatch2 (
IN UINT16 TableName,
IN EFI_PHYSICAL_ADDRESS EntryPoint,
IN EFI_PHYSICAL_ADDRESS Context
)
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
TableName - GC_TODO: add argument description
EntryPoint - GC_TODO: add argument description
Returns:
EFI_NOT_FOUND - GC_TODO: Add description for return value
EFI_SUCCESS - GC_TODO: Add description for return value
--*/
{
return EFI_SUCCESS;
}
EFI_STATUS
EFIAPI
BootScriptSaveInformation (
IN UINT16 TableName,
IN UINT32 Length,
IN EFI_PHYSICAL_ADDRESS Buffer
)
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
TableName - GC_TODO: add argument description
EntryPoint - GC_TODO: add argument description
Returns:
EFI_NOT_FOUND - GC_TODO: Add description for return value
EFI_SUCCESS - GC_TODO: Add description for return value
--*/
{
return EFI_SUCCESS;
}
EFI_STATUS
EFIAPI
BootScriptSaveInformationUnicodeString (
IN UINT16 TableName,
IN CONST CHAR16 *String
)
/*++
Routine Description:
Save unicode string information specified by Buffer to
boot script with opcode EFI_BOOT_SCRIPT_INFORMATION_OPCODE
Arguments:
TableName - Desired boot script table
FfsName - The file name of the code to be dispatched.
Context - The data that will be passed into code.
ParentHandle - The caller's image handle.
Returns:
EFI_NOT_FOUND - BootScriptSave Protocol not exist.
EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
--*/
{
return EFI_SUCCESS;
}
EFI_STATUS
EFIAPI
BootScriptSaveInformationAsciiString (
IN UINT16 TableName,
IN CONST CHAR8 *String
)
/*++
Routine Description:
Save ASCII string information specified by Buffer to
boot script with opcode EFI_BOOT_SCRIPT_INFORMATION_OPCODE
Arguments:
TableName - Desired boot script table
FfsName - The file name of the code to be dispatched.
Context - The data that will be passed into code.
ParentHandle - The caller's image handle.
Returns:
EFI_NOT_FOUND - BootScriptSave Protocol not exist.
EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
--*/
{
return EFI_SUCCESS;
}
EFI_STATUS
EFIAPI
BootScriptSaveDispatch (
IN UINT16 TableName,
IN EFI_PHYSICAL_ADDRESS EntryPoint
)
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
TableName - GC_TODO: add argument description
EntryPoint - GC_TODO: add argument description
Returns:
EFI_NOT_FOUND - GC_TODO: Add description for return value
EFI_SUCCESS - GC_TODO: Add description for return value
--*/
{
return EFI_SUCCESS;
}
EFI_STATUS
EFIAPI
BootScriptSaveDispatch2Image (
IN UINT16 TableName,
IN EFI_GUID *FfsName,
IN EFI_PHYSICAL_ADDRESS Context,
IN EFI_HANDLE ParentHandle
)
/*++
Routine Description:
Save dispatching specified arbitrary code to boot script with opcode
EFI_BOOT_SCRIPT_DISPATCH_OPCODE
Arguments:
TableName - Desired boot script table
FfsName - The file name of the code to be dispatched.
Context - The data that will be passed into code.
ParentHandle - The caller's image handle.
Returns:
EFI_NOT_FOUND - BootScriptSave Protocol not exist.
EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
--*/
{
return EFI_SUCCESS;
}

View File

@ -0,0 +1,71 @@
#/** @file
# BootScriptLib instance that always produces NOP operation.
#
# This library is primarily used by platform that does not support ACPI S3 resume.
# All the library interfaces simply return EFI_SUCCESS without performing any operation.
# Copyright (c) 2007, Intel Corporation.
#
# All rights reserved.
# This software and associated documentation (if any) is furnished
# under a license and may only be used or copied in accordance
# with the terms of the license. Except as permitted by such
# license, no part of this software or documentation may be
# reproduced, stored in a retrieval system, or transmitted in any
# form or by any means without the express written consent of
# Intel Corporation.
#
#
#**/
################################################################################
#
# Defines Section - statements that will be processed to create a Makefile.
#
################################################################################
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = DxeBootScriptLibNull
FILE_GUID = 9A6DC1AC-94C0-43b1-8714-4C70FD58A815
MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0
LIBRARY_CLASS = BootScriptLib
EDK_RELEASE_VERSION = 0x00020000
EFI_SPECIFICATION_VERSION = 0x00020000
#
# The following information is for reference only and not required by the build tools.
#
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
#
################################################################################
#
# Sources Section - list of files that are required for the build to succeed.
#
################################################################################
[Sources.common]
BootScriptLib.c
################################################################################
#
# Includes Section - list of Include locations that are required for
# this module.
#
################################################################################
[Includes]
################################################################################
#
# Package Dependency Section - list of Package files that are required for
# this module.
#
################################################################################
[Packages]
MdePkg/MdePkg.dec
IntelFrameworkPkg/IntelFrameworkPkg.dec

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<MsaHeader>
<ModuleName>DxeBootScriptLibNull</ModuleName>
<ModuleType>DXE_DRIVER</ModuleType>
<GuidValue>9A6DC1AC-94C0-43b1-8714-4C70FD58A815</GuidValue>
<Version>1.0</Version>
<Abstract>BootScriptLib instance that always produces NOP operation.</Abstract>
<Description>This library is primarily used by platform that does not support ACPI S3 resume.
All the library interfaces simply return EFI_SUCCESS without performing any operation.</Description>
<Copyright>Copyright (c) 2007, Intel Corporation.</Copyright>
<License>All rights reserved.
This software and associated documentation (if any) is furnished
under a license and may only be used or copied in accordance
with the terms of the license. Except as permitted by such
license, no part of this software or documentation may be
reproduced, stored in a retrieval system, or transmitted in any
form or by any means without the express written consent of
Intel Corporation.</License>
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
</MsaHeader>
<ModuleDefinitions>
<SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>
<BinaryModule>false</BinaryModule>
<OutputFileBasename>DxeBootScriptLibNull</OutputFileBasename>
</ModuleDefinitions>
<LibraryClassDefinitions>
<LibraryClass Usage="ALWAYS_PRODUCED">
<Keyword>BootScriptLib</Keyword>
</LibraryClass>
</LibraryClassDefinitions>
<SourceFiles>
<Filename>BootScriptLib.c</Filename>
</SourceFiles>
<PackageDependencies>
<Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
<Package PackageGuid="68169ab0-d41b-4009-9060-292c253ac43d"/>
<Package PackageGuid="bea835f9-fd62-464a-81ff-f3a806360c6b"/>
</PackageDependencies>
<Externs>
<Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>
<Specification>EDK_RELEASE_VERSION 0x00020000</Specification>
</Externs>
</ModuleSurfaceArea>