soc/intel/cmn/blk: cse_enable_ptt: Wait up to 5 s for FW Init Complete
FW Init Complete is a prerequisite for sending the FW FEATURE SHIPMENT
TIME STATE OVERRIDE message. Unfortunately, on some platforms such as
Lenovo ThinkCentre M700 Tiny, it takes too long for the flag to be set,
so enabling PTT fails.
Wait up to 5 seconds for the FW Init Complete to be set instead of
failing immediately.
On M700 Tiny with debug level set to ERROR, we have to wait nearly 2
seconds:
[EMERG] HECI: CSE took 1900 ms to complete FW init
Because FW Init Complete is not required for getting the current feature
enablement state, only for setting, move the FW Init Complete check to
after we've determined if we actually need to change the state. This
avoids needlessly increasing boot time.
Reference: Intel ME 11.x BIOS Specification, #549522, section 6.3.15
Change-Id: Ib6de170f3f998273bec437848faa49652f013f45
Signed-off-by: Michał Kopeć <michal.kopec@3mdeb.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/84862
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
89cdd8d491
commit
9a4c6710ab
1 changed files with 12 additions and 4 deletions
|
|
@ -40,6 +40,8 @@
|
|||
#define HECI_CIP_TIMEOUT_US 1000
|
||||
/* Wait up to 5 seconds for CSE to boot from RO(BP1) */
|
||||
#define CSE_DELAY_BOOT_TO_RO_MS (5 * 1000)
|
||||
/* Wait up to 5 sec for CSE FW init to complete */
|
||||
#define CSE_FW_INIT_TIMEOUT_MS (5 * 1000)
|
||||
|
||||
#define SLOT_SIZE sizeof(uint32_t)
|
||||
|
||||
|
|
@ -1193,10 +1195,8 @@ void cse_enable_ptt(bool state)
|
|||
* 4) HFSTS1 FW Init Complete is set
|
||||
* 5) Before EOP issued to CSE
|
||||
*/
|
||||
if (!cse_is_hfs1_cws_normal() || !cse_is_hfs1_com_normal() ||
|
||||
!cse_is_hfs1_fw_init_complete() || !ENV_RAMSTAGE) {
|
||||
printk(BIOS_ERR, "HECI: Unmet prerequisites for"
|
||||
"FW FEATURE SHIPMENT TIME STATE OVERRIDE\n");
|
||||
if (!cse_is_hfs1_cws_normal() || !cse_is_hfs1_com_normal() || !ENV_RAMSTAGE) {
|
||||
printk(BIOS_ERR, "HECI: Could not set PTT state because ME is not ready\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1210,6 +1210,14 @@ void cse_enable_ptt(bool state)
|
|||
return;
|
||||
}
|
||||
|
||||
int elapsed = wait_ms(CSE_FW_INIT_TIMEOUT_MS, cse_is_hfs1_fw_init_complete());
|
||||
if (!elapsed) {
|
||||
printk(BIOS_ERR, "HECI: Could not set PTT state because ME is not ready\n");
|
||||
return;
|
||||
}
|
||||
|
||||
printk(BIOS_DEBUG, "HECI: CSE took %d ms to become ready\n", elapsed);
|
||||
|
||||
printk(BIOS_DEBUG, "HECI: Send FW FEATURE SHIPMENT TIME STATE OVERRIDE Command\n");
|
||||
|
||||
if (state)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue