soc/intel/skylake: Move DMI lock down config after resource allocation

This patch to ensures that coreboot is performing DMI
registers lockdown after PCI enumeration is done.

This requirements are intended to support platform security
guideline where all required chipset registers are expected
to be in lock down stage before launching any 3rd party
code as in option rom etc.

coreboot has to change its execution order to meet those
requirements. Hence BIOS Interface lock down through Sideband
access has been moved right after pci resource allocation is done,
so that BILD lock down is getting executed along with LPC and SPI
BIOS interface lockdown settings before calling post pci
enumeration FSP NotifyPhase() API which is targeted to
be done in BS_DEV_ENABLE-BS_ON_ENTRY.

TEST=Ensure DMI register offset 0x274c bit 0 is set.

Change-Id: Ie66701d5bd8c8f389e23fb30c8595dd83cf6b1ae
Signed-off-by: Subrata Banik <subrata.banik@intel.com>
Reviewed-on: https://review.coreboot.org/21030
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Subrata Banik 2017-08-16 18:38:54 +05:30 committed by Aaron Durbin
parent f61ffcf9a4
commit 97a09454d2
2 changed files with 14 additions and 5 deletions

View File

@ -35,8 +35,6 @@
#include <soc/systemagent.h>
#include <stdlib.h>
#define PCR_DMI_GCS 0x274C
#define PCR_DMI_GCS_BILD (1 << 0)
#define PSF_BASE_ADDRESS 0xA00
#define PCR_PSFX_T0_SHDW_PCIEN 0x1C
#define PCR_PSFX_T0_SHDW_PCIEN_FUNDIS (1 << 8)
@ -168,9 +166,6 @@ static void soc_lockdown(void)
/* Bios Interface Lock */
fast_spi_set_bios_interface_lock_down();
/* GCS reg of DMI */
pcr_or8(PID_DMI, PCR_DMI_GCS, PCR_DMI_GCS_BILD);
/* Bios Lock */
fast_spi_set_lock_enable();
}

View File

@ -16,11 +16,16 @@
#include <arch/io.h>
#include <bootstate.h>
#include <chip.h>
#include <intelblocks/pcr.h>
#include <soc/lpc.h>
#include <soc/pci_devs.h>
#include <soc/pcr_ids.h>
#include <soc/pm.h>
#include <string.h>
#define PCR_DMI_GCS 0x274C
#define PCR_DMI_GCS_BILD (1 << 0)
static void lpc_lockdown_config(void)
{
static struct soc_intel_skylake_config *config;
@ -55,11 +60,20 @@ static void pmc_lockdown_config(void)
write32(pmcbase + PMSYNC_TPR_CFG, pmsyncreg);
}
static void dmi_lockdown_config(void)
{
/* GCS reg of DMI */
pcr_or8(PID_DMI, PCR_DMI_GCS, PCR_DMI_GCS_BILD);
}
static void platform_lockdown_config(void *unused)
{
/* LPC lock down configuration */
lpc_lockdown_config();
/* DMI lock down configuration */
dmi_lockdown_config();
/* PMC lock down configuration */
pmc_lockdown_config();
}