soc/intel/common/block/cse: Prevent HECI commands when flash descriptor override is set

Sending the disable and EOP commands will not work if flash descriptor
override is set on Meteor Lake.

Change-Id: I3b5a56229434c9cc326141d48359faa7759541ee
Signed-off-by: Jeremy Soller <Jeremy@system76.com>
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82728
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Michał Kopeć <michal.kopec@3mdeb.com>
This commit is contained in:
Jeremy Soller 2024-03-21 12:38:52 -06:00 committed by Matt DeVillier
commit 2ce567f1d0
4 changed files with 27 additions and 0 deletions

View file

@ -11,6 +11,7 @@
#include <device/pci_ids.h>
#include <device/pci_ops.h>
#include <intelblocks/cse.h>
#include <intelblocks/fast_spi.h>
#include <intelblocks/me.h>
#include <intelblocks/pmclib.h>
#include <intelblocks/post_codes.h>
@ -1348,6 +1349,13 @@ static void cse_set_state(struct device *dev)
int send;
int result;
if (fast_spi_flash_descriptor_override()) {
printk(BIOS_WARNING, "HECI: not setting ME state because "
"flash descriptor override is enabled\n");
return;
}
/*
* Check if the CMOS value "me_state" exists, if it doesn't, then
* don't do anything.

View file

@ -4,6 +4,7 @@
#include <bootstate.h>
#include <console/console.h>
#include <intelblocks/cse.h>
#include <intelblocks/fast_spi.h>
#include <intelblocks/pmc_ipc.h>
#include <security/vboot/vboot_common.h>
#include <soc/intel/common/reset.h>
@ -243,6 +244,11 @@ static void do_send_end_of_post(bool wait_for_completion)
return;
}
if (fast_spi_flash_descriptor_override()) {
printk(BIOS_WARNING, "CSE: not sending EOP because flash descriptor override is enabled\n");
return;
}
if (!eop_sent) {
set_cse_device_state(PCH_DEVFN_CSE, DEV_ACTIVE);
timestamp_add_now(TS_ME_END_OF_POST_START);

View file

@ -472,6 +472,15 @@ void fast_spi_clear_outstanding_status(void)
write32(spibar + SPIBAR_HSFSTS_CTL, SPIBAR_HSFSTS_W1C_BITS);
}
/* Check if flash descriptor override is asserted */
bool fast_spi_flash_descriptor_override(void)
{
void *spibar = fast_spi_get_bar();
uint32_t hsfsts = read32(spibar + SPIBAR_HSFSTS_CTL);
printk(BIOS_DEBUG, "HSFSTS: 0x%X\n", hsfsts);
return !(hsfsts & SPIBAR_HSFSTS_FDOPSS);
}
/* As there is no official ACPI ID for this controller use the generic PNP ID for now. */
static const char *fast_spi_acpi_hid(const struct device *dev)

View file

@ -107,5 +107,9 @@ void fast_spi_cache_ext_bios_postcar(struct postcar_frame *pcf);
* Set FAST_SPIBAR BIOS Decode Lock bit
*/
void fast_spi_set_bde(void);
/*
* Check if flash descriptor override is asserted
*/
bool fast_spi_flash_descriptor_override(void);
#endif /* SOC_INTEL_COMMON_BLOCK_FAST_SPI_H */