![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <console/console.h>
#include <ec/acpi/ec.h>
#include <stdint.h>
#include <string.h>
#include "ec.h"
#include "commands.h"
Go to the source code of this file.
Data Structures | |
struct | err_code_entry |
Variables | |
static enum ec_err_code | default_ec_err = DLED_ROM |
static const struct err_code_entry | post_code_err_map [] |
static uint8_t | wilco_ec_saved_post_code |
Definition at line 195 of file commands.c.
References ARRAY_SIZE, BIOS_EMERG, default_ec_err, err_code_entry::ec_err, KB_ERR_CODE, NULL, post_code, post_code_err_map, printk, wilco_ec_mailbox(), WILCO_EC_MSG_DEFAULT, and wilco_ec_saved_post_code.
int wilco_ec_change_wake | ( | uint8_t | source, |
enum ec_wake_change | change | ||
) |
wilco_ec_change_wake_source
Change acpi wake up source. @source: Wake up source that can be enabled/disabled. @ec_wake_change: On/off switch.
Returns -1 if the EC command failed
Definition at line 156 of file commands.c.
References ARRAY_SIZE, KB_ACPI_WAKEUP_CHANGE, NULL, wilco_ec_mailbox(), and WILCO_EC_MSG_DEFAULT.
Referenced by wilco_ec_smi_sleep().
int wilco_ec_get_board_id | ( | uint8_t * | id | ) |
wilco_ec_get_board_id
Retrieve the board ID value from the EC. @id: Pointer to variable to store the ID read from the EC.
Returns number of bytes transferred from the EC Returns -1 if the EC command failed
Definition at line 125 of file commands.c.
References KB_BOARD_ID, NULL, wilco_ec_mailbox(), and WILCO_EC_MSG_RAW.
Referenced by board_id().
int wilco_ec_get_info | ( | enum get_ec_info_cmd | cmd, |
char * | info | ||
) |
wilco_ec_get_info
Read a specific information string from the EC and return it in the caller-provided buffer of at least EC_INFO_MAX_SIZE bytes.
@cmd: Information to retrieve @info: Character array of EC_INFO_MAX_SIZE bytes
Returns 0 if successful and resulting string is in 'info' Returns -1 if the EC command fails
Definition at line 11 of file commands.c.
References ec_response_get_ec_info::data, info, KB_EC_INFO, strncpy(), type, and wilco_ec_sendrecv().
Referenced by wilco_ec_print_all_info().
int wilco_ec_get_lid_state | ( | void | ) |
wilco_ec_get_lid_state
Retrieve the lid state without clearing it in the EC.
Returns 1 if the lid is open, 0 if it is closed Returns -1 if the EC command failed
Definition at line 115 of file commands.c.
References EC_PM1_LID_OPEN, ec_pm_event_state::state, and wilco_ec_get_power_status().
int wilco_ec_get_pm | ( | struct ec_pm_event_state * | pm, |
bool | clear | ||
) |
wilco_ec_get_pm
Retrieve power and event information from the EC.
@pm: Power event state structure to fill out @clear: Clear EC event state after reading
Returns 0 if EC command was successful Returns -1 if EC command failed
Definition at line 107 of file commands.c.
References wilco_ec_get_power_smi(), and wilco_ec_get_power_status().
Referenced by wilco_ec_smi_espi().
|
static |
Definition at line 42 of file commands.c.
References ec_pm_event_state::event, ec_pm_event_state::hotkey, KB_POWER_SMI, ec_pm_event_state::state, and wilco_ec_sendrecv_noargs().
Referenced by wilco_ec_get_pm().
|
static |
Definition at line 74 of file commands.c.
References ec_pm_event_state::ac_type, ec_pm_event_state::event, ec_pm_event_state::hotkey, KB_POWER_STATUS, ec_pm_event_state::state, and wilco_ec_sendrecv_noargs().
Referenced by wilco_ec_get_lid_state(), and wilco_ec_get_pm().
void wilco_ec_power_off | ( | enum ec_power_off_reason | reason | ) |
wilco_ec_power_off
Tell the EC why the host is about to power off.
Definition at line 139 of file commands.c.
References BIOS_ERR, KB_POWER_OFF, NULL, printk, wilco_ec_mailbox(), and WILCO_EC_MSG_NO_RESPONSE.
Referenced by wilco_ec_smi_sleep().
wilco_ec_print_all_info
Retrieve and print all the information strings from the EC:
GET_EC_LABEL GET_EC_SVN_REV GET_EC_MODEL_NO GET_EC_BUILD_DATE
Definition at line 25 of file commands.c.
References BIOS_INFO, EC_INFO_MAX_SIZE, GET_EC_BUILD_DATE, GET_EC_LABEL, GET_EC_MODEL_NO, GET_EC_SVN_REV, info, printk, and wilco_ec_get_info().
Referenced by wilco_ec_init().
wilco_ec_radio_control() - Control wireless radios.
@ec_radio: Wireless radio type. @state: Turn radio on or off. Return: 0 if successful or negative error code on failure.
Definition at line 147 of file commands.c.
References ARRAY_SIZE, KB_RADIO_CONTROL, NULL, RADIO_WRITE, wilco_ec_mailbox(), and WILCO_EC_MSG_DEFAULT.
Referenced by wilco_ec_init().
wilco_ec_save_post_code
Save this post code as the most recent progress step. If the boot fails and calls die_notify() this post code will be used to send an error code to the EC indicating the failure.
@post_code: Post code to save
Definition at line 189 of file commands.c.
References post_code, and wilco_ec_saved_post_code.
Referenced by mainboard_post().
wilco_ec_set_cpuid
Set CPU ID to EC.
@cpuid: read CPU ID from cpu_eax(1) @cpu_cores: cores of CPU @gpu_cores: cores of GPU
Returns 0 if EC command was successful Returns -1 if EC command failed
Definition at line 225 of file commands.c.
References ARRAY_SIZE, cpu_id, cpuid, KB_CPU_ID, NULL, wilco_ec_mailbox(), and WILCO_EC_MSG_DEFAULT.
Referenced by wilco_set_cpu_id().
int wilco_ec_signed_fw | ( | void | ) |
wilco_ec_signed_fw
Indicate if the EC uses signed firmware.
Returns 1 if EC uses signed firmware, otherwise returns 0
Definition at line 165 of file commands.c.
Referenced by get_sku_index(), sku_id(), and smbios_system_sku().
wilco_ec_slp_en
Tell the EC that the host is entering a sleep state.
Definition at line 131 of file commands.c.
References BIOS_ERR, KB_SLP_EN, NULL, printk, wilco_ec_mailbox(), and WILCO_EC_MSG_NO_RESPONSE.
Referenced by wilco_ec_smi_sleep().
|
static |
Definition at line 165 of file commands.c.
Referenced by die_notify().
|
static |
Definition at line 165 of file commands.c.
Referenced by die_notify().
|
static |
Definition at line 187 of file commands.c.
Referenced by die_notify(), and wilco_ec_save_post_code().