/** @file\r
- Interpret and execute the S3 data in S3 boot script. \r
+ Interpret and execute the S3 data in S3 boot script.\r
\r
- Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions\r
Management Bus (SMBus) Specification. The resulting transaction will be either that the SMBus\r
slave devices accept this transaction or that this function returns with error.\r
\r
- @param SmbusAddress Address that encodes the SMBUS Slave Address, SMBUS Command, SMBUS Data Length, \r
+ @param SmbusAddress Address that encodes the SMBUS Slave Address, SMBUS Command, SMBUS Data Length,\r
and PEC.\r
@param Operation Signifies which particular SMBus hardware protocol instance that\r
it will use to execute the SMBus transactions. This SMBus\r
\r
**/\r
EFI_STATUS\r
-SmbusExecute (\r
+InternalSmbusExecute (\r
IN UINTN SmbusAddress,\r
IN EFI_SMBUS_OPERATION Operation,\r
IN OUT UINTN *Length,\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
- return Status; \r
+ return Status;\r
}\r
\r
/**\r
@param Width Width of the operation.\r
@param Address Address of the operation.\r
@param AddressStride Instride for stepping input buffer.\r
- @param BufferStride Outstride for stepping output buffer. \r
+ @param BufferStride Outstride for stepping output buffer.\r
\r
@retval EFI_SUCCESS Successful translation.\r
@retval EFI_INVALID_PARAMETER Width or Address is invalid.\r
\r
/**\r
Perform IO read operation\r
- \r
+\r
@param[in] Width Width of the operation.\r
@param[in] Address Address of the operation.\r
@param[in] Count Count of the number of accesses to perform.\r
- @param[out] Buffer Pointer to the buffer to read from I/O space. \r
+ @param[out] Buffer Pointer to the buffer to read from I/O space.\r
\r
@retval EFI_SUCCESS The data was written to the EFI System.\r
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI System.\r
Buffer is NULL.\r
The Buffer is not aligned for the given Width.\r
- Address is outside the legal range of I/O ports. \r
- \r
+ Address is outside the legal range of I/O ports.\r
+\r
**/\r
EFI_STATUS\r
ScriptIoRead (\r
\r
/**\r
Perform IO write operation\r
- \r
+\r
@param[in] Width Width of the operation.\r
@param[in] Address Address of the operation.\r
@param[in] Count Count of the number of accesses to perform.\r
- @param[in] Buffer Pointer to the buffer to write to I/O space. \r
+ @param[in] Buffer Pointer to the buffer to write to I/O space.\r
\r
@retval EFI_SUCCESS The data was written to the EFI System.\r
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI System.\r
Buffer is NULL.\r
The Buffer is not aligned for the given Width.\r
- Address is outside the legal range of I/O ports. \r
- \r
+ Address is outside the legal range of I/O ports.\r
+\r
**/\r
EFI_STATUS\r
ScriptIoWrite (\r
case S3BootScriptWidthUint8:\r
DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint8 - 0x%08x (0x%02x)\n", (UINTN)Address, (UINTN)*In.Uint8));\r
IoWrite8 ((UINTN) Address, *In.Uint8);\r
- break; \r
+ break;\r
case S3BootScriptWidthFifoUint8:\r
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint8 - 0x%08x (0x%02x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint8));\r
IoWrite8 ((UINTN) OriginalAddress, *In.Uint8);\r
- break; \r
+ break;\r
case S3BootScriptWidthFillUint8:\r
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint8 - 0x%08x (0x%02x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint8));\r
IoWrite8 ((UINTN) Address, *OriginalIn.Uint8);\r
case S3BootScriptWidthUint16:\r
DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint16 - 0x%08x (0x%04x)\n", (UINTN)Address, (UINTN)*In.Uint16));\r
IoWrite16 ((UINTN) Address, *In.Uint16);\r
- break; \r
+ break;\r
case S3BootScriptWidthFifoUint16:\r
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint16 - 0x%08x (0x%04x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint16));\r
IoWrite16 ((UINTN) OriginalAddress, *In.Uint16);\r
- break; \r
+ break;\r
case S3BootScriptWidthFillUint16:\r
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint16 - 0x%08x (0x%04x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint16));\r
IoWrite16 ((UINTN) Address, *OriginalIn.Uint16);\r
case S3BootScriptWidthUint32:\r
DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint32 - 0x%08x (0x%08x)\n", (UINTN)Address, (UINTN)*In.Uint32));\r
IoWrite32 ((UINTN) Address, *In.Uint32);\r
- break; \r
+ break;\r
case S3BootScriptWidthFifoUint32:\r
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint32 - 0x%08x (0x%08x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint32));\r
IoWrite32 ((UINTN) OriginalAddress, *In.Uint32);\r
case S3BootScriptWidthUint64:\r
DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *In.Uint64));\r
IoWrite64 ((UINTN) Address, *In.Uint64);\r
- break; \r
+ break;\r
case S3BootScriptWidthFifoUint64:\r
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint64 - 0x%08x (0x%016lx)\n", (UINTN)OriginalAddress, *In.Uint64));\r
IoWrite64 ((UINTN) OriginalAddress, *In.Uint64);\r
- break; \r
+ break;\r
case S3BootScriptWidthFillUint64:\r
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *OriginalIn.Uint64));\r
IoWrite64 ((UINTN) Address, *OriginalIn.Uint64);\r
return EFI_INVALID_PARAMETER;\r
}\r
}\r
- \r
+\r
\r
return EFI_SUCCESS;\r
}\r
/**\r
Interprete the boot script node with EFI_BOOT_SCRIPT_IO_WRITE OP code.\r
- \r
+\r
@param Script Pointer to the node which is to be interpreted.\r
\r
@retval EFI_SUCCESS The data was written to the EFI System.\r
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI System.\r
Buffer is NULL.\r
The Buffer is not aligned for the given Width.\r
- Address is outside the legal range of I/O ports. \r
- \r
+ Address is outside the legal range of I/O ports.\r
+\r
**/\r
EFI_STATUS\r
BootScriptExecuteIoWrite (\r
- IN UINT8 *Script \r
+ IN UINT8 *Script\r
)\r
{\r
S3_BOOT_SCRIPT_LIB_WIDTH Width;\r
UINTN Count;\r
VOID *Buffer;\r
EFI_BOOT_SCRIPT_IO_WRITE IoWrite;\r
- \r
+\r
CopyMem ((VOID*)&IoWrite, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_IO_WRITE));\r
Width = (S3_BOOT_SCRIPT_LIB_WIDTH) IoWrite.Width;\r
Address = IoWrite.Address;\r
}\r
/**\r
Perform memory read operation\r
- \r
+\r
@param Width Width of the operation.\r
@param Address Address of the operation.\r
@param Count Count of the number of accesses to perform.\r
- @param Buffer Pointer to the buffer read from memory. \r
+ @param Buffer Pointer to the buffer read from memory.\r
\r
@retval EFI_SUCCESS The data was written to the EFI System.\r
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI System.\r
Buffer is NULL.\r
The Buffer is not aligned for the given Width.\r
- @retval EFI_UNSUPPORTED The address range specified by Address, Width, and Count \r
- is not valid for this EFI System. \r
- \r
+ @retval EFI_UNSUPPORTED The address range specified by Address, Width, and Count\r
+ is not valid for this EFI System.\r
+\r
**/\r
EFI_STATUS\r
ScriptMemoryRead (\r
}\r
/**\r
Perform memory write operation\r
- \r
+\r
@param Width Width of the operation.\r
@param Address Address of the operation.\r
@param Count Count of the number of accesses to perform.\r
- @param Buffer Pointer to the buffer write to memory. \r
+ @param Buffer Pointer to the buffer write to memory.\r
\r
@retval EFI_SUCCESS The data was written to the EFI System.\r
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI System.\r
Buffer is NULL.\r
The Buffer is not aligned for the given Width.\r
- @retval EFI_UNSUPPORTED The address range specified by Address, Width, and Count \r
- is not valid for this EFI System. \r
- \r
+ @retval EFI_UNSUPPORTED The address range specified by Address, Width, and Count\r
+ is not valid for this EFI System.\r
+\r
**/\r
EFI_STATUS\r
ScriptMemoryWrite (\r
{\r
EFI_STATUS Status;\r
UINTN AddressStride;\r
- UINT64 OriginalAddress; \r
+ UINT64 OriginalAddress;\r
UINTN BufferStride;\r
PTR In;\r
PTR OriginalIn;\r
// Loop for each iteration and move the data\r
//\r
OriginalAddress = Address;\r
- OriginalIn.Buf = In.Buf; \r
+ OriginalIn.Buf = In.Buf;\r
for (; Count > 0; Count--, Address += AddressStride, In.Buf += BufferStride) {\r
switch (Width) {\r
case S3BootScriptWidthUint8:\r
DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint8 - 0x%08x (0x%02x)\n", (UINTN)Address, (UINTN)*In.Uint8));\r
MmioWrite8 ((UINTN) Address, *In.Uint8);\r
- break; \r
+ break;\r
case S3BootScriptWidthFifoUint8:\r
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint8 - 0x%08x (0x%02x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint8));\r
MmioWrite8 ((UINTN) OriginalAddress, *In.Uint8);\r
- break; \r
+ break;\r
case S3BootScriptWidthFillUint8:\r
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint8 - 0x%08x (0x%02x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint8));\r
MmioWrite8 ((UINTN) Address, *OriginalIn.Uint8);\r
case S3BootScriptWidthUint16:\r
DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint16 - 0x%08x (0x%04x)\n", (UINTN)Address, (UINTN)*In.Uint16));\r
MmioWrite16 ((UINTN) Address, *In.Uint16);\r
- break; \r
+ break;\r
case S3BootScriptWidthFifoUint16:\r
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint16 - 0x%08x (0x%04x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint16));\r
MmioWrite16 ((UINTN) OriginalAddress, *In.Uint16);\r
- break; \r
+ break;\r
case S3BootScriptWidthFillUint16:\r
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint16 - 0x%08x (0x%04x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint16));\r
MmioWrite16 ((UINTN) Address, *OriginalIn.Uint16);\r
case S3BootScriptWidthUint32:\r
DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint32 - 0x%08x (0x%08x)\n", (UINTN)Address, (UINTN)*In.Uint32));\r
MmioWrite32 ((UINTN) Address, *In.Uint32);\r
- break; \r
+ break;\r
case S3BootScriptWidthFifoUint32:\r
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint32 - 0x%08x (0x%08x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint32));\r
MmioWrite32 ((UINTN) OriginalAddress, *In.Uint32);\r
- break; \r
+ break;\r
case S3BootScriptWidthFillUint32:\r
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint32 - 0x%08x (0x%08x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint32));\r
MmioWrite32 ((UINTN) Address, *OriginalIn.Uint32);\r
case S3BootScriptWidthUint64:\r
DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *In.Uint64));\r
MmioWrite64 ((UINTN) Address, *In.Uint64);\r
- break; \r
+ break;\r
case S3BootScriptWidthFifoUint64:\r
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint64 - 0x%08x (0x%016lx)\n", (UINTN)OriginalAddress, *In.Uint64));\r
MmioWrite64 ((UINTN) OriginalAddress, *In.Uint64);\r
- break; \r
+ break;\r
case S3BootScriptWidthFillUint64:\r
DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *OriginalIn.Uint64));\r
MmioWrite64 ((UINTN) Address, *OriginalIn.Uint64);\r
Interprete the boot script node with EFI_BOOT_SCRIPT_MEM_WRITE OP code.\r
\r
@param[in] Script Pointer to the node which is to be interpreted.\r
- \r
+\r
@retval EFI_SUCCESS The data was written to the EFI System.\r
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI System.\r
Buffer is NULL.\r
The Buffer is not aligned for the given Width.\r
- @retval EFI_UNSUPPORTED The address range specified by Address, Width, and Count \r
- is not valid for this EFI System. \r
- \r
+ @retval EFI_UNSUPPORTED The address range specified by Address, Width, and Count\r
+ is not valid for this EFI System.\r
+\r
**/\r
EFI_STATUS\r
BootScriptExecuteMemoryWrite (\r
UINT64 Address;\r
UINTN Count;\r
EFI_BOOT_SCRIPT_MEM_WRITE MemWrite;\r
- \r
+\r
CopyMem((VOID*)&MemWrite, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_MEM_WRITE));\r
Width = (S3_BOOT_SCRIPT_LIB_WIDTH)MemWrite.Width;\r
Address = MemWrite.Address;\r
\r
DEBUG ((EFI_D_INFO, "BootScriptExecuteMemoryWrite - 0x%08x, 0x%08x, 0x%08x\n", (UINTN)Address, Count, (UINTN)Width));\r
return ScriptMemoryWrite (Width,Address, Count, Buffer);\r
- \r
-} \r
+\r
+}\r
/**\r
- Performance PCI configuration read operation\r
+ Performance PCI configuration 2 read operation\r
\r
@param Width Width of the operation.\r
+ @param Segment Pci segment number\r
@param Address Address of the operation.\r
@param Count Count of the number of accesses to perform.\r
@param Buffer Pointer to the buffer read from PCI config space\r
- \r
+\r
@retval EFI_SUCCESS The read succeed.\r
- @retval EFI_INVALID_PARAMETER if Width is not defined \r
+ @retval EFI_INVALID_PARAMETER if Width is not defined\r
@note A known Limitations in the implementation which is 64bits operations are not supported.\r
\r
**/\r
EFI_STATUS\r
-ScriptPciCfgRead (\r
+ScriptPciCfg2Read (\r
IN S3_BOOT_SCRIPT_LIB_WIDTH Width,\r
+ IN UINT16 Segment,\r
IN UINT64 Address,\r
IN UINTN Count,\r
OUT VOID *Buffer\r
UINTN AddressStride;\r
UINTN BufferStride;\r
PTR Out;\r
- UINTN PciAddress;\r
+ UINT64 PciAddress;\r
\r
Out.Buf = (UINT8 *) Buffer;\r
\r
- PciAddress = PCI_ADDRESS_ENCODE (Address);\r
+ PciAddress = PCI_ADDRESS_ENCODE (Segment, Address);\r
\r
Status = BuildLoopData (Width, PciAddress, &AddressStride, &BufferStride);\r
if (EFI_ERROR (Status)) {\r
for (; Count > 0; Count--, PciAddress += AddressStride, Out.Buf += BufferStride) {\r
switch (Width) {\r
case S3BootScriptWidthUint8:\r
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint8 - 0x%08x\n", PciAddress));\r
- *Out.Uint8 = PciRead8 (PciAddress);\r
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint8 - 0x%016lx\n", PciAddress));\r
+ *Out.Uint8 = PciSegmentRead8 (PciAddress);\r
break;\r
case S3BootScriptWidthFifoUint8:\r
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint8 - 0x%08x\n", PciAddress));\r
- *Out.Uint8 = PciRead8 (PciAddress);\r
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint8 - 0x%016lx\n", PciAddress));\r
+ *Out.Uint8 = PciSegmentRead8 (PciAddress);\r
break;\r
case S3BootScriptWidthFillUint8:\r
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint8 - 0x%08x\n", PciAddress));\r
- *Out.Uint8 = PciRead8 (PciAddress);\r
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint8 - 0x%016lx\n", PciAddress));\r
+ *Out.Uint8 = PciSegmentRead8 (PciAddress);\r
break;\r
\r
case S3BootScriptWidthUint16:\r
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint16 - 0x%08x\n", PciAddress));\r
- *Out.Uint16 = PciRead16 (PciAddress);\r
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint16 - 0x%016lx\n", PciAddress));\r
+ *Out.Uint16 = PciSegmentRead16 (PciAddress);\r
break;\r
case S3BootScriptWidthFifoUint16:\r
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint16 - 0x%08x\n", PciAddress));\r
- *Out.Uint16 = PciRead16 (PciAddress);\r
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint16 - 0x%016lx\n", PciAddress));\r
+ *Out.Uint16 = PciSegmentRead16 (PciAddress);\r
break;\r
case S3BootScriptWidthFillUint16:\r
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint16 - 0x%08x\n", PciAddress));\r
- *Out.Uint16 = PciRead16 (PciAddress);\r
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint16 - 0x%016lx\n", PciAddress));\r
+ *Out.Uint16 = PciSegmentRead16 (PciAddress);\r
break;\r
\r
case S3BootScriptWidthUint32:\r
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint32 - 0x%08x\n", PciAddress));\r
- *Out.Uint32 = PciRead32 (PciAddress);\r
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint32 - 0x%016lx\n", PciAddress));\r
+ *Out.Uint32 = PciSegmentRead32 (PciAddress);\r
break;\r
case S3BootScriptWidthFifoUint32:\r
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint32 - 0x%08x\n", PciAddress));\r
- *Out.Uint32 = PciRead32 (PciAddress);\r
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint32 - 0x%016lx\n", PciAddress));\r
+ *Out.Uint32 = PciSegmentRead32 (PciAddress);\r
break;\r
case S3BootScriptWidthFillUint32:\r
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint32 - 0x%08x\n", PciAddress));\r
- *Out.Uint32 = PciRead32 (PciAddress);\r
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint32 - 0x%016lx\n", PciAddress));\r
+ *Out.Uint32 = PciSegmentRead32 (PciAddress);\r
break;\r
\r
default:\r
}\r
\r
/**\r
- Performance PCI configuration write operation\r
+ Performance PCI configuration 2 write operation\r
\r
@param Width Width of the operation.\r
+ @param Segment Pci segment number\r
@param Address Address of the operation.\r
@param Count Count of the number of accesses to perform.\r
@param Buffer Pointer to the buffer write to PCI config space\r
- \r
+\r
@retval EFI_SUCCESS The write succeed.\r
- @retval EFI_INVALID_PARAMETER if Width is not defined \r
+ @retval EFI_INVALID_PARAMETER if Width is not defined\r
@note A known Limitations in the implementation which is 64bits operations are not supported.\r
\r
**/\r
EFI_STATUS\r
-ScriptPciCfgWrite (\r
+ScriptPciCfg2Write (\r
IN S3_BOOT_SCRIPT_LIB_WIDTH Width,\r
+ IN UINT16 Segment,\r
IN UINT64 Address,\r
IN UINTN Count,\r
IN VOID *Buffer\r
EFI_STATUS Status;\r
UINTN AddressStride;\r
UINTN BufferStride;\r
- UINTN OriginalPciAddress;\r
+ UINT64 OriginalPciAddress;\r
PTR In;\r
PTR OriginalIn;\r
- UINTN PciAddress;\r
+ UINT64 PciAddress;\r
\r
In.Buf = (UINT8 *) Buffer;\r
\r
- PciAddress = PCI_ADDRESS_ENCODE (Address);\r
+ PciAddress = PCI_ADDRESS_ENCODE (Segment, Address);\r
\r
Status = BuildLoopData (Width, PciAddress, &AddressStride, &BufferStride);\r
if (EFI_ERROR (Status)) {\r
for (; Count > 0; Count--, PciAddress += AddressStride, In.Buf += BufferStride) {\r
switch (Width) {\r
case S3BootScriptWidthUint8:\r
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint8 - 0x%08x (0x%02x)\n", PciAddress, (UINTN)*In.Uint8));\r
- PciWrite8 (PciAddress, *In.Uint8);\r
- break; \r
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint8 - 0x%016lx (0x%02x)\n", PciAddress, (UINTN)*In.Uint8));\r
+ PciSegmentWrite8 (PciAddress, *In.Uint8);\r
+ break;\r
case S3BootScriptWidthFifoUint8:\r
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint8 - 0x%08x (0x%02x)\n", OriginalPciAddress, (UINTN)*In.Uint8));\r
- PciWrite8 (OriginalPciAddress, *In.Uint8);\r
- break; \r
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint8 - 0x%016lx (0x%02x)\n", OriginalPciAddress, (UINTN)*In.Uint8));\r
+ PciSegmentWrite8 (OriginalPciAddress, *In.Uint8);\r
+ break;\r
case S3BootScriptWidthFillUint8:\r
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint8 - 0x%08x (0x%02x)\n", PciAddress, (UINTN)*OriginalIn.Uint8));\r
- PciWrite8 (PciAddress, *OriginalIn.Uint8);\r
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint8 - 0x%016lx (0x%02x)\n", PciAddress, (UINTN)*OriginalIn.Uint8));\r
+ PciSegmentWrite8 (PciAddress, *OriginalIn.Uint8);\r
break;\r
case S3BootScriptWidthUint16:\r
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint16 - 0x%08x (0x%04x)\n", PciAddress, (UINTN)*In.Uint16));\r
- PciWrite16 (PciAddress, *In.Uint16);\r
- break; \r
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint16 - 0x%016lx (0x%04x)\n", PciAddress, (UINTN)*In.Uint16));\r
+ PciSegmentWrite16 (PciAddress, *In.Uint16);\r
+ break;\r
case S3BootScriptWidthFifoUint16:\r
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint16 - 0x%08x (0x%04x)\n", OriginalPciAddress, (UINTN)*In.Uint16));\r
- PciWrite16 (OriginalPciAddress, *In.Uint16);\r
- break; \r
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint16 - 0x%016lx (0x%04x)\n", OriginalPciAddress, (UINTN)*In.Uint16));\r
+ PciSegmentWrite16 (OriginalPciAddress, *In.Uint16);\r
+ break;\r
case S3BootScriptWidthFillUint16:\r
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint16 - 0x%08x (0x%04x)\n", PciAddress, (UINTN)*OriginalIn.Uint16));\r
- PciWrite16 (PciAddress, *OriginalIn.Uint16);\r
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint16 - 0x%016lx (0x%04x)\n", PciAddress, (UINTN)*OriginalIn.Uint16));\r
+ PciSegmentWrite16 (PciAddress, *OriginalIn.Uint16);\r
break;\r
case S3BootScriptWidthUint32:\r
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint32 - 0x%08x (0x%08x)\n", PciAddress, (UINTN)*In.Uint32));\r
- PciWrite32 (PciAddress, *In.Uint32);\r
- break; \r
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint32 - 0x%016lx (0x%08x)\n", PciAddress, (UINTN)*In.Uint32));\r
+ PciSegmentWrite32 (PciAddress, *In.Uint32);\r
+ break;\r
case S3BootScriptWidthFifoUint32:\r
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint32 - 0x%08x (0x%08x)\n", OriginalPciAddress, (UINTN)*In.Uint32));\r
- PciWrite32 (OriginalPciAddress, *In.Uint32);\r
- break; \r
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint32 - 0x%016lx (0x%08x)\n", OriginalPciAddress, (UINTN)*In.Uint32));\r
+ PciSegmentWrite32 (OriginalPciAddress, *In.Uint32);\r
+ break;\r
case S3BootScriptWidthFillUint32:\r
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint32 - 0x%08x (0x%08x)\n", (UINTN)PciAddress, (UINTN)*OriginalIn.Uint32));\r
- PciWrite32 (PciAddress, *OriginalIn.Uint32);\r
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint32 - 0x%016lx (0x%08x)\n", (UINTN)PciAddress, (UINTN)*OriginalIn.Uint32));\r
+ PciSegmentWrite32 (PciAddress, *OriginalIn.Uint32);\r
break;\r
default:\r
return EFI_INVALID_PARAMETER;\r
return EFI_SUCCESS;\r
}\r
/**\r
- Performance PCI configuration 2 read operation\r
- \r
+ Performance PCI configuration read operation\r
+\r
@param Width Width of the operation.\r
- @param Segment Pci segment number\r
@param Address Address of the operation.\r
@param Count Count of the number of accesses to perform.\r
@param Buffer Pointer to the buffer to read from PCI config space.\r
Buffer is NULL.\r
The Buffer is not aligned for the given Width.\r
Address is outside the legal range of I/O ports.\r
- @note A known Limitations in the implementation which is the 'Segment' parameter is assumed as \r
- Zero, or else, assert.\r
+\r
**/\r
EFI_STATUS\r
-ScriptPciCfg2Read (\r
+ScriptPciCfgRead (\r
IN S3_BOOT_SCRIPT_LIB_WIDTH Width,\r
- IN UINT16 Segment, \r
IN UINT64 Address,\r
IN UINTN Count,\r
OUT VOID *Buffer\r
)\r
{\r
- ASSERT (Segment==0);\r
- \r
- return ScriptPciCfgRead (Width, Address, Count, Buffer);\r
+ return ScriptPciCfg2Read (Width, 0, Address, Count, Buffer);\r
}\r
/**\r
- Performance PCI configuration 2 write operation\r
- \r
+ Performance PCI configuration write operation\r
+\r
@param Width Width of the operation.\r
- @param Segment Pci segment number\r
@param Address Address of the operation.\r
@param Count Count of the number of accesses to perform.\r
@param Buffer Pointer to the buffer to write to PCI config space.\r
Buffer is NULL.\r
The Buffer is not aligned for the given Width.\r
Address is outside the legal range of I/O ports.\r
- @note A known Limitations in the implementation which is the 'Segment' parameter is assumed as \r
- Zero, or else, assert.\r
- \r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
-ScriptPciCfg2Write (\r
+ScriptPciCfgWrite (\r
IN S3_BOOT_SCRIPT_LIB_WIDTH Width,\r
- IN UINT16 Segment, \r
IN UINT64 Address,\r
IN UINTN Count,\r
IN VOID *Buffer\r
)\r
{\r
- ASSERT (Segment==0);\r
- return ScriptPciCfgWrite (Width, Address, Count, Buffer);\r
+ return ScriptPciCfg2Write (Width, 0, Address, Count, Buffer);\r
}\r
/**\r
Interprete the boot script node with EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE OP code.\r
- \r
- @param Script The pointer of typed node in boot script table \r
- \r
+\r
+ @param Script The pointer of typed node in boot script table\r
+\r
@retval EFI_SUCCESS The operation was executed successfully\r
**/\r
EFI_STATUS\r
Count = PciCfgWrite.Count;\r
Buffer = Script + sizeof(EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE);\r
\r
- DEBUG ((EFI_D_INFO, "BootScriptExecutePciCfgWrite - 0x%08x, 0x%08x, 0x%08x\n", PCI_ADDRESS_ENCODE (Address), Count, (UINTN)Width));\r
+ DEBUG ((EFI_D_INFO, "BootScriptExecutePciCfgWrite - 0x%016lx, 0x%08x, 0x%08x\n", PCI_ADDRESS_ENCODE (0, Address), Count, (UINTN)Width));\r
return ScriptPciCfgWrite (Width, Address, Count, Buffer);\r
}\r
/**\r
Interprete the boot script node with EFI_BOOT_SCRIPT_IO_READ_WRITE OP code.\r
\r
- @param Script The pointer of typed node in boot script table \r
+ @param Script The pointer of typed node in boot script table\r
@param AndMask Mask value for 'and' operation\r
@param OrMask Mask value for 'or' operation\r
\r
EFI_STATUS Status;\r
UINT64 Data;\r
EFI_BOOT_SCRIPT_IO_READ_WRITE IoReadWrite;\r
- \r
+\r
Data = 0;\r
- \r
+\r
CopyMem((VOID*)&IoReadWrite, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_IO_READ_WRITE));\r
\r
DEBUG ((EFI_D_INFO, "BootScriptExecuteIoReadWrite - 0x%08x, 0x%016lx, 0x%016lx\n", (UINTN)IoReadWrite.Address, AndMask, OrMask));\r
/**\r
Interprete the boot script node with EFI_BOOT_SCRIPT_MEM_READ_WRITE OP code.\r
\r
- @param Script The pointer of typed node in boot script table \r
+ @param Script The pointer of typed node in boot script table\r
@param AndMask Mask value for 'and' operation\r
@param OrMask Mask value for 'or' operation\r
\r
EFI_STATUS Status;\r
UINT64 Data;\r
EFI_BOOT_SCRIPT_MEM_READ_WRITE MemReadWrite;\r
- \r
+\r
Data = 0;\r
- \r
+\r
CopyMem((VOID*)&MemReadWrite, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_MEM_READ_WRITE));\r
\r
DEBUG ((EFI_D_INFO, "BootScriptExecuteMemoryReadWrite - 0x%08x, 0x%016lx, 0x%016lx\n", (UINTN)MemReadWrite.Address, AndMask, OrMask));\r
- \r
+\r
Status = ScriptMemoryRead (\r
(S3_BOOT_SCRIPT_LIB_WIDTH) MemReadWrite.Width,\r
MemReadWrite.Address,\r
/**\r
Interprete the boot script node with EFI_BOOT_SCRIPT_PCI_CFG_READ_WRITE OP code.\r
\r
- @param Script The pointer of typed node in boot script table \r
+ @param Script The pointer of typed node in boot script table\r
@param AndMask Mask value for 'and' operation\r
@param OrMask Mask value for 'or' operation\r
\r
\r
CopyMem((VOID*)&PciCfgReadWrite, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE));\r
\r
- DEBUG ((EFI_D_INFO, "BootScriptExecutePciCfgReadWrite - 0x%08x, 0x%016lx, 0x%016lx\n", PCI_ADDRESS_ENCODE (PciCfgReadWrite.Address), AndMask, OrMask));\r
- \r
+ DEBUG ((EFI_D_INFO, "BootScriptExecutePciCfgReadWrite - 0x%016lx, 0x%016lx, 0x%016lx\n", PCI_ADDRESS_ENCODE (0, PciCfgReadWrite.Address), AndMask, OrMask));\r
+\r
Status = ScriptPciCfgRead (\r
(S3_BOOT_SCRIPT_LIB_WIDTH) PciCfgReadWrite.Width,\r
PciCfgReadWrite.Address,\r
/**\r
Interprete the boot script node with EFI_BOOT_SCRIPT_SMBUS_EXECUTE OP code.\r
\r
- @param Script The pointer of typed node in boot script table \r
- \r
+ @param Script The pointer of typed node in boot script table\r
+\r
@retval EFI_SUCCESS The operation was executed successfully\r
@retval EFI_UNSUPPORTED Cannot locate smbus ppi or occur error of script execution\r
- @retval Others Result of script execution \r
+ @retval Others Result of script execution\r
**/\r
EFI_STATUS\r
BootScriptExecuteSmbusExecute (\r
UINTN SmBusAddress;\r
UINTN DataSize;\r
EFI_BOOT_SCRIPT_SMBUS_EXECUTE SmbusExecuteEntry;\r
- \r
+\r
CopyMem ((VOID*)&SmbusExecuteEntry, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_SMBUS_EXECUTE ));\r
\r
DEBUG ((EFI_D_INFO, "BootScriptExecuteSmbusExecute - 0x%08x, 0x%08x\n", (UINTN)SmbusExecuteEntry.SmBusAddress, (UINTN)SmbusExecuteEntry.Operation));\r
\r
SmBusAddress = (UINTN)SmbusExecuteEntry.SmBusAddress;\r
DataSize = (UINTN) SmbusExecuteEntry.DataSize;\r
- return SmbusExecute (\r
+ return InternalSmbusExecute (\r
SmBusAddress,\r
(EFI_SMBUS_OPERATION) SmbusExecuteEntry.Operation,\r
&DataSize,\r
/**\r
Interprete the boot script node with EFI_BOOT_SCRIPT_STALL OP code.\r
\r
- @param Script The pointer of typed node in boot script table \r
- \r
+ @param Script The pointer of typed node in boot script table\r
+\r
@retval EFI_SUCCESS The operation was executed successfully\r
**/\r
EFI_STATUS\r
)\r
{\r
EFI_BOOT_SCRIPT_STALL Stall;\r
- \r
+\r
CopyMem ((VOID*)&Stall, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_STALL));\r
\r
DEBUG ((EFI_D_INFO, "BootScriptExecuteStall - 0x%08x\n", (UINTN)Stall.Duration));\r
}\r
/**\r
Interprete the boot script node with EFI_BOOT_SCRIPT_DISPATCH OP code.\r
- \r
- @param Script The pointer of typed node in boot script table \r
+\r
+ @param Script The pointer of typed node in boot script table\r
@retval EFI_SUCCESS The operation was executed successfully\r
**/\r
EFI_STATUS\r
EFI_STATUS Status;\r
DISPATCH_ENTRYPOINT_FUNC EntryFunc;\r
EFI_BOOT_SCRIPT_DISPATCH ScriptDispatch;\r
- \r
+\r
CopyMem ((VOID*)&ScriptDispatch, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_DISPATCH));\r
EntryFunc = (DISPATCH_ENTRYPOINT_FUNC) (UINTN) (ScriptDispatch.EntryPoint);\r
\r
/**\r
Interprete the boot script node with EFI_BOOT_SCRIPT_DISPATCH_2 OP code.\r
\r
- @param Script The pointer of typed node in boot script table \r
+ @param Script The pointer of typed node in boot script table\r
@retval EFI_SUCCESS The operation was executed successfully\r
**/\r
EFI_STATUS\r
EFI_STATUS Status;\r
DISPATCH_ENTRYPOINT_FUNC EntryFunc;\r
EFI_BOOT_SCRIPT_DISPATCH_2 ScriptDispatch2;\r
- \r
+\r
CopyMem ((VOID*)&ScriptDispatch2, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_DISPATCH_2));\r
\r
DEBUG ((EFI_D_INFO, "BootScriptExecuteDispatch2 - 0x%08x(0x%08x)\n", (UINTN)ScriptDispatch2.EntryPoint, (UINTN)ScriptDispatch2.Context));\r
- \r
+\r
EntryFunc = (DISPATCH_ENTRYPOINT_FUNC) (UINTN) (ScriptDispatch2.EntryPoint);\r
\r
Status = EntryFunc (NULL, (VOID *) (UINTN) ScriptDispatch2.Context);\r
/**\r
Interprete the boot script node with EFI_BOOT_SCRIPT_MEM_POLL OP code.\r
\r
- @param Script The pointer of typed node in boot script table \r
+ @param Script The pointer of typed node in boot script table\r
@param AndMask Mask value for 'and' operation\r
@param OrMask Mask value for 'or' operation\r
- \r
- @retval EFI_DEVICE_ERROR Data polled from memory does not equal to \r
+\r
+ @retval EFI_DEVICE_ERROR Data polled from memory does not equal to\r
the epecting data within the Loop Times.\r
@retval EFI_SUCCESS The operation was executed successfully\r
**/\r
BootScriptExecuteMemPoll (\r
IN UINT8 *Script,\r
IN UINT64 AndMask,\r
- IN UINT64 OrMask \r
+ IN UINT64 OrMask\r
)\r
{\r
- \r
+\r
UINT64 Data;\r
UINT64 LoopTimes;\r
EFI_STATUS Status;\r
EFI_BOOT_SCRIPT_MEM_POLL MemPoll;\r
- \r
+\r
CopyMem ((VOID*)&MemPoll, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_MEM_POLL));\r
\r
DEBUG ((EFI_D_INFO, "BootScriptExecuteMemPoll - 0x%08x, 0x%016lx, 0x%016lx\n", (UINTN)MemPoll.Address, AndMask, OrMask));\r
Execute the boot script to interpret the Store arbitrary information.\r
This opcode is a no-op on dispatch and is only used for debugging script issues.\r
\r
- @param Script The pointer of node in boot script table \r
- \r
+ @param Script The pointer of node in boot script table\r
+\r
**/\r
VOID\r
BootScriptExecuteInformation (\r
}\r
\r
/**\r
- Execute the boot script to interpret the Label information. \r
+ Execute the boot script to interpret the Label information.\r
+\r
+ @param Script The pointer of node in boot script table\r
\r
- @param Script The pointer of node in boot script table \r
- \r
**/\r
VOID\r
BootScriptExecuteLabel (\r
\r
/**\r
calculate the mask value for 'and' and 'or' operation\r
- @param ScriptHeader The pointer of header of node in boot script table \r
+ @param ScriptHeader The pointer of header of node in boot script table\r
@param AndMask The Mask value for 'and' operation\r
@param OrMask The Mask value for 'or' operation\r
@param Script Pointer to the entry.\r
case EFI_BOOT_SCRIPT_MEM_POLL_OPCODE:\r
Size = sizeof (EFI_BOOT_SCRIPT_MEM_POLL);\r
break;\r
- \r
+\r
case EFI_BOOT_SCRIPT_IO_POLL_OPCODE:\r
Size = sizeof (EFI_BOOT_SCRIPT_IO_POLL);\r
- break; \r
- \r
+ break;\r
+\r
case EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE_OPCODE:\r
Size = sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE);\r
break;\r
- \r
+\r
case EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE:\r
Size = sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL);\r
break;\r
- \r
+\r
case EFI_BOOT_SCRIPT_PCI_CONFIG_POLL_OPCODE:\r
Size = sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_POLL);\r
break;\r
- \r
+\r
default:\r
return;\r
}\r
- \r
+\r
DataPtr = Script + Size;\r
\r
switch (ScriptHeader->Width) {\r
/**\r
Interprete the boot script node with EFI_BOOT_SCRIPT_IO_POLL OP code.\r
\r
- @param Script The pointer of typed node in boot script table \r
+ @param Script The pointer of typed node in boot script table\r
@param AndMask Mask value for 'and' operation\r
@param OrMask Mask value for 'or' operation\r
- \r
- @retval EFI_DEVICE_ERROR Data polled from memory does not equal to \r
+\r
+ @retval EFI_DEVICE_ERROR Data polled from memory does not equal to\r
the epecting data within the Loop Times.\r
@retval EFI_SUCCESS The operation was executed successfully\r
**/\r
UINT64 Data;\r
UINT64 LoopTimes;\r
EFI_BOOT_SCRIPT_IO_POLL IoPoll;\r
- \r
+\r
CopyMem ((VOID*)&IoPoll, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_IO_POLL));\r
\r
DEBUG ((EFI_D_INFO, "BootScriptExecuteIoPoll - 0x%08x, 0x%016lx, 0x%016lx\n", (UINTN)IoPoll.Address, AndMask, OrMask));\r
);\r
if ((!EFI_ERROR (Status)) &&(Data & AndMask) == OrMask) {\r
return EFI_SUCCESS;\r
- } \r
+ }\r
}\r
\r
if (LoopTimes < IoPoll.Delay) {\r
UINT64 Address;\r
UINTN Count;\r
EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE PciCfg2Write;\r
- \r
+\r
CopyMem ((VOID*)&PciCfg2Write, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE));\r
\r
Width = (S3_BOOT_SCRIPT_LIB_WIDTH)PciCfg2Write.Width;\r
Count = PciCfg2Write.Count;\r
Buffer = Script + sizeof(EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE);\r
\r
- DEBUG ((EFI_D_INFO, "BootScriptExecutePciCfg2Write - 0x%04x, 0x%08x, 0x%08x, 0x%08x\n", Segment, PCI_ADDRESS_ENCODE (Address), Count, (UINTN)Width));\r
+ DEBUG ((EFI_D_INFO, "BootScriptExecutePciCfg2Write - 0x%016lx, 0x%08x, 0x%08x\n", PCI_ADDRESS_ENCODE (Segment, Address), Count, (UINTN)Width));\r
return ScriptPciCfg2Write (Width, Segment, Address, Count, Buffer);\r
}\r
\r
\r
/**\r
Interprete the boot script node with EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE OP code.\r
- \r
+\r
@param Script The pointer of S3 boot script\r
@param AndMask Mask value for 'and' operation\r
@param OrMask Mask value for 'or' operation\r
\r
CopyMem ((VOID*)&PciCfg2ReadWrite, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE));\r
\r
- DEBUG ((EFI_D_INFO, "BootScriptExecutePciCfg2ReadWrite - 0x%04x, 0x%08x, 0x%016lx, 0x%016lx\n", PciCfg2ReadWrite.Segment, PCI_ADDRESS_ENCODE (PciCfg2ReadWrite.Address), AndMask, OrMask));\r
- \r
+ DEBUG ((EFI_D_INFO, "BootScriptExecutePciCfg2ReadWrite - 0x%016lx, 0x%016lx, 0x%016lx\n", PCI_ADDRESS_ENCODE (PciCfg2ReadWrite.Segment, PciCfg2ReadWrite.Address), AndMask, OrMask));\r
+\r
Status = ScriptPciCfg2Read (\r
(S3_BOOT_SCRIPT_LIB_WIDTH) PciCfg2ReadWrite.Width,\r
PciCfg2ReadWrite.Segment,\r
}\r
/**\r
Interprete the boot script node with EFI_BOOT_SCRIPT_PCI_CONFIG_POLL OP code.\r
- \r
+\r
@param Script The pointer of S3 boot script\r
@param AndMask Mask value for 'and' operation\r
@param OrMask Mask value for 'or' operation\r
\r
@retval EFI_SUCCESS The operation was executed successfully\r
- @retval EFI_DEVICE_ERROR Data polled from Pci configuration space does not equal to \r
+ @retval EFI_DEVICE_ERROR Data polled from Pci configuration space does not equal to\r
epecting data within the Loop Times.\r
**/\r
EFI_STATUS\r
BootScriptPciCfgPoll (\r
IN UINT8 *Script,\r
IN UINT64 AndMask,\r
- IN UINT64 OrMask \r
+ IN UINT64 OrMask\r
)\r
{\r
UINT64 Data;\r
EFI_BOOT_SCRIPT_PCI_CONFIG_POLL PciCfgPoll;\r
CopyMem ((VOID*)&PciCfgPoll, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_PCI_CONFIG_POLL));\r
\r
- DEBUG ((EFI_D_INFO, "BootScriptPciCfgPoll - 0x%08x, 0x%016lx, 0x%016lx\n", PCI_ADDRESS_ENCODE (PciCfgPoll.Address), AndMask, OrMask));\r
- \r
+ DEBUG ((EFI_D_INFO, "BootScriptPciCfgPoll - 0x%016lx, 0x%016lx, 0x%016lx\n", PCI_ADDRESS_ENCODE (0, PciCfgPoll.Address), AndMask, OrMask));\r
+\r
Data = 0;\r
Status = ScriptPciCfgRead (\r
(S3_BOOT_SCRIPT_LIB_WIDTH) PciCfgPoll.Width,\r
\r
/**\r
Interprete the boot script node with EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL OP code.\r
- \r
+\r
@param Script The pointer of S3 Boot Script\r
@param AndMask Mask value for 'and' operation\r
@param OrMask Mask value for 'or' operation\r
\r
@retval EFI_SUCCESS The operation was executed successfully\r
- @retval EFI_DEVICE_ERROR Data polled from Pci configuration space does not equal to \r
+ @retval EFI_DEVICE_ERROR Data polled from Pci configuration space does not equal to\r
epecting data within the Loop Times.\r
\r
**/\r
BootScriptPciCfg2Poll (\r
IN UINT8 *Script,\r
IN UINT64 AndMask,\r
- IN UINT64 OrMask \r
+ IN UINT64 OrMask\r
)\r
{\r
EFI_STATUS Status;\r
Data = 0;\r
CopyMem ((VOID*)&PciCfg2Poll, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL));\r
\r
- DEBUG ((EFI_D_INFO, "BootScriptPciCfg2Poll - 0x%04x, 0x%08x, 0x%016lx, 0x%016lx\n", PciCfg2Poll.Segment, PCI_ADDRESS_ENCODE (PciCfg2Poll.Address), AndMask, OrMask));\r
- \r
+ DEBUG ((EFI_D_INFO, "BootScriptPciCfg2Poll - 0x%016lx, 0x%016lx, 0x%016lx\n", PCI_ADDRESS_ENCODE (PciCfg2Poll.Segment, PciCfg2Poll.Address), AndMask, OrMask));\r
+\r
Status = ScriptPciCfg2Read (\r
(S3_BOOT_SCRIPT_LIB_WIDTH) PciCfg2Poll.Width,\r
PciCfg2Poll.Segment,\r
Data = 0;\r
Status = ScriptPciCfg2Read (\r
(S3_BOOT_SCRIPT_LIB_WIDTH) PciCfg2Poll.Width,\r
- PciCfg2Poll.Segment, \r
+ PciCfg2Poll.Segment,\r
PciCfg2Poll.Address,\r
1,\r
&Data\r
} else {\r
return EFI_DEVICE_ERROR;\r
}\r
- \r
+\r
}\r
\r
/**\r
Executes the S3 boot script table.\r
- \r
+\r
@retval RETURN_SUCCESS The boot script table was executed successfully.\r
- @retval RETURN_UNSUPPORTED Invalid script table or opcode. \r
- \r
- @note A known Limitations in the implementation: When interpreting the opcode EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE_OPCODE\r
- EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE_OPCODE and EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE, the 'Segment' parameter is assumed as \r
- Zero, or else, assert.\r
+ @retval RETURN_UNSUPPORTED Invalid script table or opcode.\r
+\r
**/\r
RETURN_STATUS\r
EFIAPI\r
EFI_BOOT_SCRIPT_COMMON_HEADER ScriptHeader;\r
EFI_BOOT_SCRIPT_TABLE_HEADER TableHeader;\r
Script = mS3BootScriptTablePtr->TableBase;\r
- if (Script != 0) { \r
+ if (Script != 0) {\r
CopyMem ((VOID*)&TableHeader, Script, sizeof(EFI_BOOT_SCRIPT_TABLE_HEADER));\r
} else {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
DEBUG ((EFI_D_INFO, "TableHeader - 0x%08x\n", Script));\r
- \r
+\r
StartAddress = (UINTN) Script;\r
TableLength = TableHeader.TableLength;\r
Script = Script + TableHeader.Length;\r
AndMask = 0;\r
OrMask = 0;\r
\r
+ DEBUG ((EFI_D_INFO, "TableHeader.Version - 0x%04x\n", (UINTN)TableHeader.Version));\r
DEBUG ((EFI_D_INFO, "TableHeader.TableLength - 0x%08x\n", (UINTN)TableLength));\r
\r
while ((UINTN) Script < (UINTN) (StartAddress + TableLength)) {\r
DEBUG ((EFI_D_INFO, "ExecuteBootScript - %08x\n", (UINTN)Script));\r
- \r
+\r
CopyMem ((VOID*)&ScriptHeader, Script, sizeof(EFI_BOOT_SCRIPT_COMMON_HEADER));\r
switch (ScriptHeader.OpCode) {\r
\r
case EFI_BOOT_SCRIPT_INFORMATION_OPCODE:\r
DEBUG ((EFI_D_INFO, "EFI_BOOT_SCRIPT_INFORMATION_OPCODE\n"));\r
BootScriptExecuteInformation (Script);\r
- break; \r
+ break;\r
\r
case S3_BOOT_SCRIPT_LIB_TERMINATE_OPCODE:\r
DEBUG ((EFI_D_INFO, "S3_BOOT_SCRIPT_LIB_TERMINATE_OPCODE\n"));\r
DEBUG ((EFI_D_INFO, "EFI_BOOT_SCRIPT_MEM_POLL_OPCODE\n"));\r
CheckAndOrMask (&ScriptHeader, &AndMask, &OrMask, Script);\r
Status = BootScriptExecuteMemPoll (Script, AndMask, OrMask);\r
- \r
+\r
break;\r
- \r
+\r
case EFI_BOOT_SCRIPT_IO_POLL_OPCODE:\r
DEBUG ((EFI_D_INFO, "EFI_BOOT_SCRIPT_IO_POLL_OPCODE\n"));\r
CheckAndOrMask (&ScriptHeader, &AndMask, &OrMask, Script);\r
Status = BootScriptExecuteIoPoll (Script, AndMask, OrMask);\r
break;\r
- \r
+\r
case EFI_BOOT_SCRIPT_PCI_CONFIG_POLL_OPCODE:\r
DEBUG ((EFI_D_INFO, "EFI_BOOT_SCRIPT_PCI_CONFIG_POLL_OPCODE\n"));\r
CheckAndOrMask (&ScriptHeader, &AndMask, &OrMask, Script);\r
Status = BootScriptPciCfgPoll (Script, AndMask, OrMask);\r
break;\r
- \r
+\r
case EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE:\r
DEBUG ((EFI_D_INFO, "EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE\n"));\r
CheckAndOrMask (&ScriptHeader, &AndMask, &OrMask, Script);\r