Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Kelly Steele <kelly.steele@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
EFI_STATUS Status;\r
SPI_INSTANCE *SpiInstance;\r
UINT8 SpiStatus;\r
EFI_STATUS Status;\r
SPI_INSTANCE *SpiInstance;\r
UINT8 SpiStatus;\r
- UINTN PchRootComplexBar;\r
\r
if (UnlockCmdOpcodeIndex >= SPI_NUM_OPCODE) {\r
return EFI_UNSUPPORTED;\r
}\r
\r
SpiInstance = SPI_INSTANCE_FROM_SPIPROTOCOL (This);\r
\r
if (UnlockCmdOpcodeIndex >= SPI_NUM_OPCODE) {\r
return EFI_UNSUPPORTED;\r
}\r
\r
SpiInstance = SPI_INSTANCE_FROM_SPIPROTOCOL (This);\r
- PchRootComplexBar = SpiInstance->PchRootComplexBar;\r
\r
//\r
// Issue unlock command to disable block protection, this only needs to be done once per SPI power on\r
\r
//\r
// Issue unlock command to disable block protection, this only needs to be done once per SPI power on\r
UINT8 Index;\r
UINT16 OpcodeType;\r
SPI_INSTANCE *SpiInstance;\r
UINT8 Index;\r
UINT16 OpcodeType;\r
SPI_INSTANCE *SpiInstance;\r
- BOOLEAN MultiPartitionIsSupported;\r
UINTN PchRootComplexBar;\r
UINTN PchRootComplexBar;\r
- UINT8 SFDPCmdOpcodeIndex;\r
UINT8 UnlockCmdOpcodeIndex;\r
UINT8 UnlockCmdOpcodeIndex;\r
- UINT8 ReadDataCmdOpcodeIndex;\r
UINT8 FlashPartId[3];\r
\r
SpiInstance = SPI_INSTANCE_FROM_SPIPROTOCOL (This);\r
UINT8 FlashPartId[3];\r
\r
SpiInstance = SPI_INSTANCE_FROM_SPIPROTOCOL (This);\r
//\r
// Setup the Opcode Menu registers.\r
//\r
//\r
// Setup the Opcode Menu registers.\r
//\r
- ReadDataCmdOpcodeIndex = SPI_NUM_OPCODE;\r
- SFDPCmdOpcodeIndex = SPI_NUM_OPCODE;\r
UnlockCmdOpcodeIndex = SPI_NUM_OPCODE;\r
for (Index = 0; Index < SPI_NUM_OPCODE; Index++) {\r
MmioWrite8 (\r
UnlockCmdOpcodeIndex = SPI_NUM_OPCODE;\r
for (Index = 0; Index < SPI_NUM_OPCODE; Index++) {\r
MmioWrite8 (\r
- if (SpiInstance->SpiInitTable.OpcodeMenu[Index].Operation == EnumSpiOperationReadData ||\r
- SpiInstance->SpiInitTable.OpcodeMenu[Index].Operation == EnumSpiOperationFastRead ||\r
- SpiInstance->SpiInitTable.OpcodeMenu[Index].Operation == EnumSpiOperationDualOutputFastRead) {\r
- ReadDataCmdOpcodeIndex = Index;\r
- }\r
-\r
- if (SpiInstance->SpiInitTable.OpcodeMenu[Index].Operation == EnumSpiOperationDiscoveryParameters) {\r
- SFDPCmdOpcodeIndex = Index;\r
- }\r
-\r
if (SpiInstance->SpiInitTable.OpcodeMenu[Index].Operation == EnumSpiOperationWriteStatus) {\r
UnlockCmdOpcodeIndex = Index;\r
}\r
}\r
\r
if (SpiInstance->SpiInitTable.OpcodeMenu[Index].Operation == EnumSpiOperationWriteStatus) {\r
UnlockCmdOpcodeIndex = Index;\r
}\r
}\r
\r
- MultiPartitionIsSupported = FALSE;\r
-\r
Status = UnlockFlashComponents (\r
This,\r
UnlockCmdOpcodeIndex\r
Status = UnlockFlashComponents (\r
This,\r
UnlockCmdOpcodeIndex\r
--*/\r
{\r
SPI_INSTANCE *SpiInstance;\r
--*/\r
{\r
SPI_INSTANCE *SpiInstance;\r
- UINTN PchRootComplexBar;\r
\r
SpiInstance = SPI_INSTANCE_FROM_SPIPROTOCOL (This);\r
\r
SpiInstance = SPI_INSTANCE_FROM_SPIPROTOCOL (This);\r
- PchRootComplexBar = SpiInstance->PchRootComplexBar;\r
\r
if (SpiRegionType == EnumSpiRegionAll) {\r
//\r
\r
if (SpiRegionType == EnumSpiRegionAll) {\r
//\r
UINTN LimitAddress;\r
UINT32 SpiDataCount;\r
UINT8 OpCode;\r
UINTN LimitAddress;\r
UINT32 SpiDataCount;\r
UINT8 OpCode;\r
- SPI_OPERATION Operation;\r
UINTN PchRootComplexBar;\r
\r
SpiInstance = SPI_INSTANCE_FROM_SPIPROTOCOL (This);\r
PchRootComplexBar = SpiInstance->PchRootComplexBar;\r
SpiBiosSize = SpiInstance->SpiInitTable.BiosSize;\r
UINTN PchRootComplexBar;\r
\r
SpiInstance = SPI_INSTANCE_FROM_SPIPROTOCOL (This);\r
PchRootComplexBar = SpiInstance->PchRootComplexBar;\r
SpiBiosSize = SpiInstance->SpiInitTable.BiosSize;\r
- Operation = SpiInstance->SpiInitTable.OpcodeMenu[OpcodeIndex].Operation;\r
OpCode = MmioRead8 (PchRootComplexBar + R_QNC_RCRB_SPIOPMENU + OpcodeIndex);\r
\r
//\r
OpCode = MmioRead8 (PchRootComplexBar + R_QNC_RCRB_SPIOPMENU + OpcodeIndex);\r
\r
//\r