Move clear HOB to the very end of the boot flow

Current SBL calls ClearFspHob() too early. Since HOB is required
during the whole FSP life cycle. It is better to clear it at the
end after the last call. Otherwise, some previous API call will
potentically encounter issues.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This commit is contained in:
Maurice Ma
2019-11-24 11:26:16 -08:00
parent d7bdca432e
commit ec8dca50bb
2 changed files with 2 additions and 6 deletions
@@ -589,8 +589,6 @@ ProgramSecuritySetting (
// Set the BIOS Lock Enable and EISS bits
MmioOr8 (SpiBaseAddress + R_SPI_BCR, (UINT8) (B_SPI_BCR_BLE | B_SPI_BCR_EISS));
ClearFspHob ();
}
@@ -756,6 +754,7 @@ BoardInit (
IoWrite32 (ACPI_BASE_ADDRESS + R_TCO1_CNT, TcoCnt | B_TCO1_CNT_LOCK);
break;
case EndOfFirmware:
ClearFspHob ();
// Clear known MCA logged in BANK4 and enable this MCA again
AsmWriteMsr64 (IA32_MC4_STATUS, 0);
AsmMsrOr32 (IA32_MC4_CTL, (UINT32)BIT4);
@@ -1172,8 +1172,6 @@ BoardInit (
if ((GetBootMode() != BOOT_ON_FLASH_UPDATE) && (GetPayloadId() != 0)) {
// Set the BIOS Lock Enable and EISS bits
MmioOr8 (SpiBaseAddress + R_SPI_BCR, (UINT8) (B_SPI_BCR_BLE | B_SPI_BCR_EISS));
ClearFspHob ();
}
break;
case ReadyToBoot:
@@ -1232,8 +1230,6 @@ BoardInit (
//
MmioOr8 (PCH_PWRM_BASE_ADDRESS + R_PMC_PWRM_GEN_PMCON_B, (UINT8)B_PMC_PWRM_GEN_PMCON_B_SMI_LOCK);
ClearFspHob ();
//
// Lock down Tco WDT just before handling off to OS
//
@@ -1241,6 +1237,7 @@ BoardInit (
IoOr16 ((TcoBase + R_TCO_IO_TCO1_CNT), B_TCO_IO_TCO1_CNT_LOCK);
break;
case EndOfFirmware:
ClearFspHob ();
break;
default:
break;