From 97a09454d25bc19b80ae990743602ba0f943a9c0 Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Wed, 16 Aug 2017 18:38:54 +0530 Subject: 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 Reviewed-on: https://review.coreboot.org/21030 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/soc/intel/skylake/finalize.c | 5 ----- src/soc/intel/skylake/lockdown.c | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'src/soc/intel/skylake') diff --git a/src/soc/intel/skylake/finalize.c b/src/soc/intel/skylake/finalize.c index c38ac632c5..335435ad9d 100644 --- a/src/soc/intel/skylake/finalize.c +++ b/src/soc/intel/skylake/finalize.c @@ -35,8 +35,6 @@ #include #include -#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(); } diff --git a/src/soc/intel/skylake/lockdown.c b/src/soc/intel/skylake/lockdown.c index f2a9e8b19f..5bbf546de0 100644 --- a/src/soc/intel/skylake/lockdown.c +++ b/src/soc/intel/skylake/lockdown.c @@ -16,11 +16,16 @@ #include #include #include +#include #include #include +#include #include #include +#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(); } -- cgit v1.2.3