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 meteorlake. Change-Id: I3b5a56229434c9cc326141d48359faa7759541ee Signed-off-by: Jeremy Soller <jackpot51@gmail.com>
This commit is contained in:
		| @@ -11,6 +11,7 @@ | |||||||
| #include <device/pci_ids.h> | #include <device/pci_ids.h> | ||||||
| #include <device/pci_ops.h> | #include <device/pci_ops.h> | ||||||
| #include <intelblocks/cse.h> | #include <intelblocks/cse.h> | ||||||
|  | #include <intelblocks/fast_spi.h> | ||||||
| #include <intelblocks/me.h> | #include <intelblocks/me.h> | ||||||
| #include <intelblocks/pmclib.h> | #include <intelblocks/pmclib.h> | ||||||
| #include <intelblocks/post_codes.h> | #include <intelblocks/post_codes.h> | ||||||
| @@ -1268,6 +1269,10 @@ static void me_reset_with_count(void) | |||||||
|  |  | ||||||
| static void cse_set_state(struct device *dev) | static void cse_set_state(struct device *dev) | ||||||
| { | { | ||||||
|  | 	if (fast_spi_flash_descriptor_override()) { | ||||||
|  | 		printk(BIOS_WARNING, "ME: not setting state because flash descriptor override is enabled\n"); | ||||||
|  | 		return; | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	/* (CS)ME Disable Command */ | 	/* (CS)ME Disable Command */ | ||||||
| 	struct me_disable_command { | 	struct me_disable_command { | ||||||
|   | |||||||
| @@ -4,6 +4,7 @@ | |||||||
| #include <bootstate.h> | #include <bootstate.h> | ||||||
| #include <console/console.h> | #include <console/console.h> | ||||||
| #include <intelblocks/cse.h> | #include <intelblocks/cse.h> | ||||||
|  | #include <intelblocks/fast_spi.h> | ||||||
| #include <intelblocks/pmc_ipc.h> | #include <intelblocks/pmc_ipc.h> | ||||||
| #include <security/vboot/vboot_common.h> | #include <security/vboot/vboot_common.h> | ||||||
| #include <soc/intel/common/reset.h> | #include <soc/intel/common/reset.h> | ||||||
| @@ -243,6 +244,11 @@ static void do_send_end_of_post(bool wait_for_completion) | |||||||
| 		return; | 		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) { | 	if (!eop_sent) { | ||||||
| 		set_cse_device_state(PCH_DEVFN_CSE, DEV_ACTIVE); | 		set_cse_device_state(PCH_DEVFN_CSE, DEV_ACTIVE); | ||||||
| 		timestamp_add_now(TS_ME_END_OF_POST_START); | 		timestamp_add_now(TS_ME_END_OF_POST_START); | ||||||
|   | |||||||
| @@ -483,6 +483,15 @@ void fast_spi_clear_outstanding_status(void) | |||||||
| 	write32(spibar + SPIBAR_HSFSTS_CTL, SPIBAR_HSFSTS_W1C_BITS); | 	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. */ | /* 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) | static const char *fast_spi_acpi_hid(const struct device *dev) | ||||||
|   | |||||||
| @@ -111,5 +111,7 @@ void fast_spi_set_bde(void); | |||||||
|  * Set FAST_SPIBAR Vendor Component Lock bit. |  * Set FAST_SPIBAR Vendor Component Lock bit. | ||||||
|  */ |  */ | ||||||
| void fast_spi_set_vcl(void); | void fast_spi_set_vcl(void); | ||||||
|  | /* Check if flash descriptor override is asserted */ | ||||||
|  | bool fast_spi_flash_descriptor_override(void); | ||||||
|  |  | ||||||
| #endif	/* SOC_INTEL_COMMON_BLOCK_FAST_SPI_H */ | #endif	/* SOC_INTEL_COMMON_BLOCK_FAST_SPI_H */ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user