10 #include <soc/pci_devs.h>
14 #define CSE_MAX_RETRY_CMD 3
39 struct bus_disable_message {
45 struct bus_disable_resp {
51 size_t reply_sz =
sizeof(reply);
74 EOP_REQUESTED_ACTION_CONTINUE = 0,
75 EOP_REQUESTED_ACTION_GLOBAL_RESET = 1,
77 struct end_of_post_msg {
85 struct end_of_post_resp {
89 size_t resp_size =
sizeof(resp);
96 printk(
BIOS_INFO,
"HECI: coreboot in recovery mode; found CSE in expected SOFT "
97 "TEMP DISABLE state, skipping EOP\n");
109 printk(
BIOS_ERR,
"HECI: Prerequisites not met for sending EOP\n");
110 if (
CONFIG(SOC_INTEL_CSE_LITE_SKU))
116 printk(
BIOS_ERR,
"HECI: Prerequisites not met for sending EOP\n");
126 if (resp.hdr.result) {
133 switch (resp.requested_actions) {
134 case EOP_REQUESTED_ACTION_GLOBAL_RESET:
137 case EOP_REQUESTED_ACTION_CONTINUE:
151 ret = cse_send_command();
166 die(
"Failed to disable MEI bus while recovering from EOP error\n"
167 "Preventing system from booting into an insecure state.\n");
170 die(
"Error disabling MEI devices while recovering from EOP error\n"
171 "Preventing system from booting into an insecure state.\n");
178 printk(
BIOS_INFO,
"CSE requested global reset in EOP response, resetting...\n");
204 static bool eop_sent =
false;
221 printk(
BIOS_DEBUG,
"CSE is disabled, cannot send End-of-Post (EOP) message\n");
255 #if !CONFIG(HECI_DISABLE_USING_SMM)
#define retry(attempts, condition,...)
bool cse_is_hfs1_com_soft_temp_disable(void)
bool cse_is_hfs1_cws_normal(void)
bool cse_is_hfs1_com_normal(void)
enum cse_tx_rx_status heci_send_receive(const void *snd_msg, size_t snd_sz, void *rcv_msg, size_t *rcv_sz, uint8_t cse_addr)
bool is_cse_enabled(void)
bool set_cse_device_state(unsigned int devfn, enum cse_device_state requested_state)
void cse_trigger_vboot_recovery(enum csme_failure_reason reason)
#define printk(level,...)
void __noreturn die(const char *fmt,...)
@ CSE_TX_ERR_CSE_NOT_READY
@ CSE_RX_ERR_RESP_LEN_MISMATCH
@ CSE_RX_ERR_CSE_NOT_READY
#define MEI_BUS_DISABLE_COMMAND
static void cse_handle_eop_error(void)
static void set_cse_end_of_post(void *unused)
static enum cse_cmd_result cse_send_cmd_retries(enum cse_cmd_result(*cse_send_command)(void))
#define CSE_MAX_RETRY_CMD
static void handle_cse_eop_result(enum cse_cmd_result result)
static enum cse_cmd_result cse_send_eop(void)
static enum cse_cmd_result decode_heci_send_receive_error(enum cse_tx_rx_status ret)
void cse_send_end_of_post(void)
BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_BOOT, BS_ON_ENTRY, set_cse_end_of_post, NULL)
static enum cse_cmd_result cse_disable_mei_bus(void)
@ CSE_CMD_RESULT_DISABLED
@ CSE_CMD_RESULT_GLOBAL_RESET_REQUESTED
static void do_send_end_of_post(void)
bool cse_disable_mei_devices(void)
int acpi_get_sleep_type(void)
void timestamp_add_now(enum timestamp_id id)
#define BIOS_INFO
BIOS_INFO - Expected events.
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
#define BIOS_WARNING
BIOS_WARNING - Bad configuration.
int vboot_recovery_mode_enabled(void)
void do_global_reset(void)
#define MKHI_GROUP_ID_GEN
@ TS_ME_END_OF_POST_START