/** @file
Interpret and execute the S3 data in S3 boot script.
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
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
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "InternalBootScriptLib.h"
/**
Checks the parameter of SmbusExecute().
This function checks the input parameters of SmbusExecute(). If the input parameters are valid
for certain SMBus bus protocol, it will return EFI_SUCCESS; otherwise, it will return certain
error code based on the input SMBus bus protocol.
@param SmBusAddress Address that encodes the SMBUS Slave Address, SMBUS Command, SMBUS Data Length,
and PEC.
@param Operation Signifies which particular SMBus hardware protocol instance that
it will use to execute the SMBus transactions. This SMBus
hardware protocol is defined by the SMBus Specification and is
not related to EFI.
@param Length Signifies the number of bytes that this operation will do. The
maximum number of bytes can be revision specific and operation
specific. This field will contain the actual number of bytes that
are executed for this operation. Not all operations require this
argument.
@param Buffer Contains the value of data to execute to the SMBus slave device.
Not all operations require this argument. The length of this
buffer is identified by Length.
@retval EFI_SUCCESS All the parameters are valid for the corresponding SMBus bus
protocol.
@retval EFI_INVALID_PARAMETER Operation is not defined in EFI_SMBUS_OPERATION.
and EfiSmbusQuickWrite. Length is outside the range of valid
values.
@retval EFI_UNSUPPORTED The SMBus operation or PEC is not supported.
@retval EFI_BUFFER_TOO_SMALL Buffer is not sufficient for this operation.
**/
)
{
//
// Set default value to be 2:
// for SmbusReadWord, SmbusWriteWord and SmbusProcessCall.
//
RequiredLen = 2;
switch (Operation) {
case EfiSmbusQuickRead:
case EfiSmbusQuickWrite:
return EFI_UNSUPPORTED;
}
break;
case EfiSmbusReceiveByte:
case EfiSmbusSendByte:
if (Command != 0) {
return EFI_UNSUPPORTED;
}
//
// Cascade to check length parameter.
//
case EfiSmbusReadByte:
case EfiSmbusWriteByte:
RequiredLen = 1;
//
// Cascade to check length parameter.
//
case EfiSmbusReadWord:
case EfiSmbusWriteWord:
case EfiSmbusProcessCall:
return EFI_INVALID_PARAMETER;
} else if (*Length < RequiredLen) {
}
*Length = RequiredLen;
break;
case EfiSmbusReadBlock:
case EfiSmbusWriteBlock:
(*Length < MIN_SMBUS_BLOCK_LEN) ||
(*Length > MAX_SMBUS_BLOCK_LEN)) {
return EFI_INVALID_PARAMETER;
}
break;
case EfiSmbusBWBRProcessCall:
return EFI_UNSUPPORTED;
default:
return EFI_INVALID_PARAMETER;
}
return Status;
}
/**
Executes an SMBus operation to an SMBus controller. Returns when either the command has been
executed or an error is encountered in doing the operation.
The SmbusExecute() function provides a standard way to execute an operation as defined in the System
Management Bus (SMBus) Specification. The resulting transaction will be either that the SMBus
slave devices accept this transaction or that this function returns with error.
@param SmbusAddress Address that encodes the SMBUS Slave Address, SMBUS Command, SMBUS Data Length,
and PEC.
@param Operation Signifies which particular SMBus hardware protocol instance that
it will use to execute the SMBus transactions. This SMBus
hardware protocol is defined by the SMBus Specification and is
not related to EFI.
@param Length Signifies the number of bytes that this operation will do. The
maximum number of bytes can be revision specific and operation
specific. This field will contain the actual number of bytes that
are executed for this operation. Not all operations require this
argument.
@param Buffer Contains the value of data to execute to the SMBus slave device.
Not all operations require this argument. The length of this
buffer is identified by Length.
@retval EFI_SUCCESS The last data that was returned from the access matched the poll
exit criteria.
@retval EFI_CRC_ERROR Checksum is not correct (PEC is incorrect).
@retval EFI_TIMEOUT Timeout expired before the operation was completed. Timeout is
determined by the SMBus host controller device.
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
@retval EFI_DEVICE_ERROR The request was not completed because a failure that was
reflected in the Host Status Register bit. Device errors are a
result of a transaction collision, illegal command field,
unclaimed cycle (host initiated), or bus errors (collisions).
@retval EFI_INVALID_PARAMETER Operation is not defined in EFI_SMBUS_OPERATION.
and EfiSmbusQuickWrite. Length is outside the range of valid
values.
@retval EFI_UNSUPPORTED The SMBus operation or PEC is not supported.
@retval EFI_BUFFER_TOO_SMALL Buffer is not sufficient for this operation.
**/
)
{
return Status;
}
switch (Operation) {
case EfiSmbusQuickRead:
break;
case EfiSmbusQuickWrite:
break;
case EfiSmbusReceiveByte:
break;
case EfiSmbusSendByte:
DEBUG ((EFI_D_INFO, "EfiSmbusReceiveByte - 0x%08x (0x%02x)\n", SmbusAddress, (UINTN)*(UINT8 *) Buffer));
break;
case EfiSmbusReadByte:
break;
case EfiSmbusWriteByte:
DEBUG ((EFI_D_INFO, "EfiSmbusWriteByte - 0x%08x (0x%02x)\n", SmbusAddress, (UINTN)*(UINT8 *) Buffer));
break;
case EfiSmbusReadWord:
break;
case EfiSmbusWriteWord:
DEBUG ((EFI_D_INFO, "EfiSmbusWriteByte - 0x%08x (0x%04x)\n", SmbusAddress, (UINTN)*(UINT16 *) Buffer));
break;
case EfiSmbusProcessCall:
DEBUG ((EFI_D_INFO, "EfiSmbusProcessCall - 0x%08x (0x%04x)\n", SmbusAddress, (UINTN)*(UINT16 *) Buffer));
break;
case EfiSmbusReadBlock:
//
// Read block transaction is complete successfully, and then
// check whether the output buffer is large enough.
//
if (*Length >= WorkBufferLen) {
} else {
}
*Length = WorkBufferLen;
}
break;
case EfiSmbusWriteBlock:
DEBUG ((EFI_D_INFO, "EfiSmbusWriteBlock - 0x%08x (0x%04x)\n", SmbusAddress, (UINTN)*(UINT16 *) Buffer));
break;
case EfiSmbusBWBRProcessCall:
//
// BUGBUG: Should this case be handled?
//
break;
}
return Status;
}
/**
Translates boot script width and address stride to MDE library interface.
@param Width Width of the operation.
@param Address Address of the operation.
@param AddressStride Instride for stepping input buffer.
@param BufferStride Outstride for stepping output buffer.
@retval EFI_SUCCESS Successful translation.
@retval EFI_INVALID_PARAMETER Width or Address is invalid.
**/
)
{
if (Width >= S3BootScriptWidthMaximum) {
return EFI_INVALID_PARAMETER;
}
return EFI_INVALID_PARAMETER;
}
*AddressStride = 0;
}
*BufferStride = 0;
}
return EFI_SUCCESS;
}
/**
Translates boot script to MDE library interface.
@param[in] Width Width of the operation.
@param[in] Address Address of the operation.
@param[in] Count Count of the number of accesses to perform.
@param[out] Buffer Pointer to the buffer to read from I/O space.
@retval EFI_SUCCESS The data was written to the EFI System.
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI System.
Buffer is NULL.
The Buffer is not aligned for the given Width.
Address is outside the legal range of I/O ports.
**/
)
{
if (Address > MAX_IO_ADDRESS) {
return EFI_INVALID_PARAMETER;
}
return Status;
}
//
// Loop for each iteration and move the data
//
switch (Width) {
case S3BootScriptWidthUint8:
break;
case S3BootScriptWidthUint16:
break;
case S3BootScriptWidthUint32:
break;
default:
return EFI_INVALID_PARAMETER;
}
}
return EFI_SUCCESS;
}
/**
Perform a write operation
@param[in] Width Width of the operation.
@param[in] Address Address of the operation.
@param[in] Count Count of the number of accesses to perform.
@param[in] Buffer Pointer to the buffer to write to I/O space.
@retval EFI_SUCCESS The data was written to the EFI System.
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI System.
Buffer is NULL.
The Buffer is not aligned for the given Width.
Address is outside the legal range of I/O ports.
**/
)
{
if (Address > MAX_IO_ADDRESS) {
return EFI_INVALID_PARAMETER;
}
return Status;
}
//
// Loop for each iteration and move the data
//
switch (Width) {
case S3BootScriptWidthUint8:
DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint8 - 0x%08x (0x%02x)\n", (UINTN)Address, (UINTN)*In.Uint8));
break;
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint8 - 0x%08x (0x%02x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint8));
break;
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint8 - 0x%08x (0x%02x)\n", (UINTN)Address, (UINTN)*In.Uint8));
break;
case S3BootScriptWidthUint16:
DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint16 - 0x%08x (0x%04x)\n", (UINTN)Address, (UINTN)*In.Uint16));
break;
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint16 - 0x%08x (0x%04x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint16));
break;
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint16 - 0x%08x (0x%04x)\n", (UINTN)Address, (UINTN)*In.Uint16));
break;
case S3BootScriptWidthUint32:
DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint32 - 0x%08x (0x%08x)\n", (UINTN)Address, (UINTN)*In.Uint32));
break;
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint32 - 0x%08x (0x%08x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint32));
break;
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint32 - 0x%08x (0x%08x)\n", (UINTN)Address, (UINTN)*In.Uint32));
break;
case S3BootScriptWidthUint64:
break;
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *In.Uint64));
break;
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *In.Uint64));
break;
default:
return EFI_INVALID_PARAMETER;
}
}
return EFI_SUCCESS;
}
/**
Interprete the IO write entry in S3 boot script and perform the write operation
@param Script Pointer to the node which is to be interpreted.
@retval EFI_SUCCESS The data was written to the EFI System.
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI System.
Buffer is NULL.
The Buffer is not aligned for the given Width.
Address is outside the legal range of I/O ports.
**/
)
{
}
/**
Perform memory read operation
@param Width Width of the operation.
@param Address Address of the operation.
@param Count Count of the number of accesses to perform.
@param Buffer Pointer to the buffer read from memory.
@retval EFI_SUCCESS The data was written to the EFI System.
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI System.
Buffer is NULL.
The Buffer is not aligned for the given Width.
@retval EFI_UNSUPPORTED The address range specified by Address, Width, and Count
is not valid for this EFI System.
**/
)
{
return Status;
}
//
// Loop for each iteration and move the data
//
switch (Width) {
case S3BootScriptWidthUint8:
break;
case S3BootScriptWidthUint16:
break;
case S3BootScriptWidthUint32:
break;
case S3BootScriptWidthUint64:
break;
default:
return EFI_UNSUPPORTED;
}
}
return EFI_SUCCESS;
}
/**
Translates boot script to MDE library interface.
@param Width Width of the operation.
@param Address Address of the operation.
@param Count Count of the number of accesses to perform.
@param Buffer Pointer to the buffer write to memory.
@retval EFI_SUCCESS The data was written to the EFI System.
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI System.
Buffer is NULL.
The Buffer is not aligned for the given Width.
@retval EFI_UNSUPPORTED The address range specified by Address, Width, and Count
is not valid for this EFI System.
**/
)
{
return Status;
}
//
// Loop for each iteration and move the data
//
switch (Width) {
case S3BootScriptWidthUint8:
DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint8 - 0x%08x (0x%02x)\n", (UINTN)Address, (UINTN)*In.Uint8));
break;
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint8 - 0x%08x (0x%02x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint8));
break;
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint8 - 0x%08x (0x%02x)\n", (UINTN)Address, (UINTN)*In.Uint8));
break;
case S3BootScriptWidthUint16:
DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint16 - 0x%08x (0x%04x)\n", (UINTN)Address, (UINTN)*In.Uint16));
break;
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint16 - 0x%08x (0x%04x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint16));
break;
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint16 - 0x%08x (0x%04x)\n", (UINTN)Address, (UINTN)*In.Uint16));
break;
case S3BootScriptWidthUint32:
DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint32 - 0x%08x (0x%08x)\n", (UINTN)Address, (UINTN)*In.Uint32));
break;
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint32 - 0x%08x (0x%08x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint32));
break;
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint32 - 0x%08x (0x%08x)\n", (UINTN)Address, (UINTN)*In.Uint32));
break;
case S3BootScriptWidthUint64:
break;
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint64 - 0x%08x (0x%016lx)\n", (UINTN)OriginalAddress, *In.Uint64));
break;
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *In.Uint64));
break;
default:
return EFI_UNSUPPORTED;
}
}
return EFI_SUCCESS;
}
/**
Interprete the boot script node with EFI_BOOT_SCRIPT_MEM_WRITE OP code.
@param[in] Script Pointer to the node which is to be interpreted.
@retval EFI_SUCCESS The data was written to the EFI System.
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI System.
Buffer is NULL.
The Buffer is not aligned for the given Width.
@retval EFI_UNSUPPORTED The address range specified by Address, Width, and Count
is not valid for this EFI System.
**/
)
{
DEBUG ((EFI_D_INFO, "BootScriptExecuteMemoryWrite - 0x%08x, 0x%08x, 0x%08x\n", (UINTN)Address, (UINTN)Count, (UINTN)Width));
}
/**
Translates boot script to MDE library interface for PCI configuration read operation
@param Width Width of the operation.
@param Address Address of the operation.
@param Buffer Pointer to the buffer reaf from PCI config space
@retval EFI_SUCCESS The read succeed.
@retval EFI_INVALID_PARAMETER if Width is not defined
**/
)
{
switch (Width) {
case S3BootScriptWidthUint8:
break;
case S3BootScriptWidthUint16:
break;
case S3BootScriptWidthUint32:
break;
default:
return EFI_INVALID_PARAMETER;
}
return EFI_SUCCESS;
}
/**
Translates boot script to MDE library interface for PCI configuration write operation
@param Width Width of the operation.
@param Address Address of the operation.
@param Buffer Pointer to the buffer reaf from PCI config space
@retval EFI_SUCCESS The write succeed.
@retval EFI_INVALID_PARAMETER if Width is not defined
**/
)
{
switch (Width) {
case S3BootScriptWidthUint8:
DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint8 - 0x%016lx (0x%02x)\n", Address, (UINTN)*(UINT8 *) Buffer));
break;
case S3BootScriptWidthUint16:
DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint16 - 0x%016lx (0x%04x)\n", Address, (UINTN)*(UINT16 *) Buffer));
break;
case S3BootScriptWidthUint32:
DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint32 - 0x%016lx (0x%08x)\n", Address, (UINTN)*(UINT32 *) Buffer));
break;
default:
return EFI_INVALID_PARAMETER;
}
return EFI_SUCCESS;
}
/**
Perform pci configure 2 read operation.
@param Width Width of the operation.
@param Segment Pci segment number
@param Address Address of the operation.
@param Buffer Pointer to the buffer to write to I/O space.
@retval EFI_SUCCESS The data was written to the EFI System.
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI System.
Buffer is NULL.
The Buffer is not aligned for the given Width.
Address is outside the legal range of I/O ports.
@note A known Limitations in the implementation which is the 'Segment' parameter is assumed as
Zero, or else, assert.
**/
)
{
}
/**
Perform pci configure write operation.
@param Width Width of the operation.
@param Segment Pci segment number
@param Address Address of the operation.
@param Buffer Pointer to the buffer to write to I/O space.
@retval EFI_SUCCESS The data was written to the EFI System.
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI System.
Buffer is NULL.
The Buffer is not aligned for the given Width.
Address is outside the legal range of I/O ports.
@note A known Limitations in the implementation which is the 'Segment' parameter is assumed as
Zero, or else, assert.
**/
)
{
}
/**
Perform Pci configuration Write operation.
@param Script The pointer of typed node in boot script table
@retval EFI_SUCCESS The operation was executed successfully
**/
)
{
DEBUG ((EFI_D_INFO, "BootScriptExecutePciCfgWrite - 0x%08x, 0x%08x, 0x%08x\n", (UINTN)PciAddress, (UINTN)PciConfigWrite.Count, (UINTN)DataWidth));
);
}
}
}
return Status;
}
/**
Excute the script to perform IO modification operation.
@param Script The pointer of typed node in boot script table
@param AndMask Mask value for 'and' operation
@param OrMask Mask value for 'or' operation
@retval EFI_SUCCESS The operation was executed successfully
**/
)
{
Data = 0;
DEBUG ((EFI_D_INFO, "BootScriptExecuteIoReadWrite - 0x%08x, 0x%016lx, 0x%016lx\n", (UINTN)IoReadWrite.Address, (UINT64)AndMask, (UINT64)OrMask));
Status = ScriptIoRead (
1,
&Data
);
Status = ScriptIoWrite (
1,
&Data
);
}
return Status;
}
/**
Excute the script to perform memory modification operation.
@param Script The pointer of typed node in boot script table
@param AndMask Mask value for 'and' operation
@param OrMask Mask value for 'or' operation
@retval EFI_SUCCESS The operation was executed successfully
**/
)
{
Data = 0;
DEBUG ((EFI_D_INFO, "BootScriptExecuteMemoryReadWrite - 0x%08x, 0x%016lx, 0x%016lx\n", (UINTN)MemReadWrite.Address, (UINT64)AndMask, (UINT64)OrMask));
1,
&Data
);
1,
&Data
);
}
return Status;
}
/**
Excute the script to perform PCI IO modification operation.
@param Script The pointer of typed node in boot script table
@param AndMask Mask value for 'and' operation
@param OrMask Mask value for 'or' operation
@retval EFI_SUCCESS The operation was executed successfully
**/
)
{
DEBUG ((EFI_D_INFO, "BootScriptExecutePciCfgReadWrite - 0x%08x, 0x%016lx, 0x%016lx\n", (UINTN)PciCfgReadWrite.Address, (UINT64)AndMask, (UINT64)OrMask));
&Data
);
return Status;
}
&Data
);
return Status;
}
/**
To Execute SMBUS command.
@param Script The pointer of typed node in boot script table
@retval EFI_SUCCESS The operation was executed successfully
@retval EFI_UNSUPPORTED Cannot locate smbus ppi or occur error of script execution
@retval Others Result of script execution
**/
)
{
DEBUG ((EFI_D_INFO, "BootScriptExecuteSmbusExecute - 0x%08x, 0x%08x\n", (UINTN)SmbusExecuteEntry.SmBusAddress, (UINTN)SmbusExecuteEntry.Operation));
return SmbusExecute (
&DataSize,
Script + sizeof (EFI_BOOT_SCRIPT_SMBUS_EXECUTE)
);
}
/**
Execute stall operation in boot script table.
@param Script The pointer of typed node in boot script table
@retval EFI_SUCCESS The operation was executed successfully
**/
)
{
return EFI_SUCCESS;
}
/**
To execute assigned function.
@param Script The pointer of typed node in boot script table
@retval EFI_SUCCESS The operation was executed successfully
**/
)
{
return Status;
}
/**
Execute dispach2 opertion code which is to invoke a spcified function with one parameter.
@param Script The pointer of typed node in boot script table
@retval EFI_SUCCESS The operation was executed successfully
**/
)
{
DEBUG ((EFI_D_INFO, "BootScriptExecuteDispatch2 - 0x%08x(0x%08x)\n", (UINTN)ScriptDispatch2.EntryPoint, (UINTN)ScriptDispatch2.Context));
return Status;
}
/**
Excute the script to poll memory.
@param Script The pointer of typed node in boot script table
@param AndMask Mask value for 'and' operation
@param OrMask Mask value for 'or' operation
@retval EFI_DEVICE_ERROR Data polled from memory does not equal to
the epecting data within the Loop Times.
@retval EFI_SUCCESS The operation was executed successfully
**/
)
{
Data = 0;
1,
&Data
);
return EFI_SUCCESS;
}
Data = 0;
1,
&Data
);
return EFI_SUCCESS;
}
}
return EFI_SUCCESS;
} else {
return EFI_DEVICE_ERROR;
}
}
/**
Execute the boot script to interpret the Store arbitrary information.
This opcode is a no-op on dispatch and is only used for debugging script issues.
@param Script The pointer of node in boot script table
**/
)
{
}
}
/**
calculate the mask value for 'and' and 'or' operation
@param ScriptHeader The pointer of header of node in boot script table
@param AndMask The Mask value for 'and' operation
@param OrMask The Mask value for 'or' operation
@param Script Pointer to the entry.
**/
)
{
switch (ScriptHeader->OpCode) {
Size = sizeof (EFI_BOOT_SCRIPT_IO_READ_WRITE);
break;
Size = sizeof (EFI_BOOT_SCRIPT_MEM_READ_WRITE);
break;
Size = sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE);
break;
Size = sizeof (EFI_BOOT_SCRIPT_MEM_POLL);
break;
Size = sizeof (EFI_BOOT_SCRIPT_IO_POLL);
break;
Size = sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE);
break;
Size = sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL);
break;
Size = sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_POLL);
break;
default:
return;
}
switch (ScriptHeader->Width) {
case S3BootScriptWidthUint8:
break;
case S3BootScriptWidthUint16:
break;
case S3BootScriptWidthUint32:
break;
case S3BootScriptWidthUint64:
break;
default:
break;
}
return;
}
/**
Excute the script to poll Io port for some time
@param Script The pointer of typed node in boot script table
@param AndMask Mask value for 'and' operation
@param OrMask Mask value for 'or' operation
@retval EFI_DEVICE_ERROR Data polled from memory does not equal to
the epecting data within the Loop Times.
@retval EFI_SUCCESS The operation was executed successfully
**/
)
{
Data = 0;
Status = ScriptIoRead (
1,
&Data
);
return EFI_SUCCESS;
}
NanoSecondDelay (100);
Data = 0;
Status = ScriptIoRead (
1,
&Data
);
return EFI_SUCCESS;
}
}
return EFI_SUCCESS;
} else {
return EFI_DEVICE_ERROR;
}
}
/**
Perform Pci configuration Write operation.
@param Script The pointer of S3 boot script
@retval EFI_SUCCESS The operation was executed successfully
**/
)
{
);
}
}
}
return Status;
}
/**
Perform pci configuration read & Write operation.
@param Script The pointer of S3 boot script
@param AndMask Mask value for 'and' operation
@param OrMask Mask value for 'or' operation
@retval EFI_SUCCESS The operation was executed successfully
**/
)
{
DEBUG ((EFI_D_INFO, "BootScriptExecutePciCfg2ReadWrite - 0x%08x\n", (UINTN)PciCfg2ReadWrite.Address));
&Data
);
return Status;
}
&Data
);
return Status;
}
/**
To perform poll pci configure operation.
@param Script The pointer of S3 boot script
@param AndMask Mask value for 'and' operation
@param OrMask Mask value for 'or' operation
@retval EFI_SUCCESS The operation was executed successfully
@retval EFI_DEVICE_ERROR Data polled from Pci configuration space does not equal to
epecting data within the Loop Times.
**/
)
{
Data = 0;
&Data
);
return EFI_SUCCESS;
}
NanoSecondDelay (100);
Data = 0;
&Data
);
return EFI_SUCCESS;
}
}
return EFI_SUCCESS;
} else {
return EFI_DEVICE_ERROR;
}
}
/**
To perform poll pci configure operation.
@param Script The pointer of S3 Boot Script
@param AndMask Mask value for 'and' operation
@param OrMask Mask value for 'or' operation
@retval EFI_SUCCESS The operation was executed successfully
@retval EFI_DEVICE_ERROR Data polled from Pci configuration space does not equal to
epecting data within the Loop Times.
**/
)
{
Data = 0;
&Data
);
return EFI_SUCCESS;
}
NanoSecondDelay (100);
Data = 0;
&Data
);
return EFI_SUCCESS;
}
}
return EFI_SUCCESS;
} else {
return EFI_DEVICE_ERROR;
}
}
/**
Executes the S3 boot script table.
@retval RETURN_SUCCESS The boot script table was executed successfully.
@retval RETURN_UNSUPPORTED Invalid script table or opcode.
@note A known Limitations in the implementation: When interpreting the opcode EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE_OPCODE
EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE_OPCODE and EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE, the 'Segment' parameter is assumed as
Zero, or else, assert.
**/
)
{
if (Script != 0) {
} else {
return EFI_INVALID_PARAMETER;
}
return EFI_UNSUPPORTED;
}
AndMask = 0;
OrMask = 0;
switch (ScriptHeader.OpCode) {
break;
);
break;
break;
break;
);
break;
break;
);
break;
break;
break;
break;
return EFI_SUCCESS;
);
break;
break;
break;
break;
break;
break;
break;
//
// For label
//
break;
default:
return EFI_UNSUPPORTED;
}
return Status;
}
}
return Status;
}