7 #ifndef _EC_GOOGLE_CHROMEEC_EC_H
8 #define _EC_GOOGLE_CHROMEEC_EC_H
110 #define CROS_SKU_UNKNOWN 0xFFFFFFFF
111 #define CROS_SKU_UNPROVISIONED 0x7FFFFFFF
117 #define MEC_EMI_BASE 0x800
118 #define MEC_EMI_SIZE 8
121 #define MEC_EMI_RANGE_START EC_HOST_CMD_REGION0
122 #define MEC_EMI_RANGE_END (EC_LPC_ADDR_MEMMAP + EC_MEMMAP_SIZE)
175 typedef int (*
crosec_io_t)(
size_t req_size,
size_t resp_size,
void *context);
411 #if CONFIG(HAVE_ACPI_TABLES)
static struct smmstore_params_info info
int google_chromeec_command(struct chromeec_command *cec_command)
Send a command to a CrOS EC.
int google_chromeec_get_pd_port_caps(int port, struct usb_pd_port_caps *port_caps)
Get role-based capabilities for a USB-PD port.
int google_chromeec_set_device_enabled_events(uint64_t mask)
int google_chromeec_cbi_get_fw_config(uint64_t *fw_config)
int google_chromeec_get_vboot_hash(uint32_t offset, struct ec_response_vboot_hash *resp)
Return the EC's vboot image hash.
int google_chromeec_clear_events_b(uint64_t mask)
uint8_t google_chromeec_calc_checksum(const uint8_t *data, int size)
int google_chromeec_wait_for_displayport(long timeout_ms)
Wait for DisplayPort to be ready.
int google_chromeec_get_protocol_info(struct ec_response_get_protocol_info *resp)
Get information about the protocol that the EC speaks.
int google_chromeec_get_cmd_versions(int command, uint32_t *pmask)
Get available versions of the specified command.
int google_chromeec_typec_control_enter_dp_mode(int port)
int google_chromeec_cbi_get_board_version(uint32_t *version)
int google_chromeec_set_wake_mask(uint64_t mask)
int google_chromeec_flash_info(struct ec_response_flash_info *info)
Return information about the entire flash.
int google_chromeec_vstore_supported(void)
int google_chromeec_regulator_is_enabled(uint32_t index, uint8_t *enabled)
Query if the regulator is enabled.
int google_chromeec_hello(void)
Performs light verification of the EC<->AP communication channel.
int google_chromeec_get_board_version(uint32_t *version)
google_chromeec_get_board_version() - Get the board version
void google_chromeec_post(uint8_t postcode)
void google_chromeec_ioport_range(uint16_t *base, size_t *size)
int google_chromeec_flash_region_info(enum ec_flash_region region, uint32_t *offset, uint32_t *size)
Get offset and size of the specified EC flash region.
int google_chromeec_flash_erase(uint32_t region_offset, uint32_t region_size)
Erase a region of EC flash.
const char * google_chromeec_smbios_system_sku(void)
bool google_chromeec_get_ap_watchdog_flag(void)
uint32_t google_chromeec_get_sku_id(void)
int google_chromeec_reboot(int dev_idx, enum ec_reboot_cmd type, uint8_t flags)
uint64_t google_chromeec_get_events_b(void)
int google_chromeec_read_limit_power_request(int *limit_power)
Check if the EC is requesting the system to limit input power.
int google_chromeec_check_feature(int feature)
int google_chromeec_flash_protect(uint32_t mask, uint32_t flags, struct ec_response_flash_protect *resp)
Protect/un-protect EC flash regions.
enum host_event_code google_chromeec_get_event(void)
int google_chromeec_cbi_get_dram_part_num(char *buf, size_t bufsize)
int google_ec_running_ro(void)
uint64_t google_chromeec_get_device_current_events(void)
int google_chromeec_regulator_set_voltage(uint32_t index, uint32_t min_mv, uint32_t max_mv)
Set voltage for the voltage regulator within the range specified.
void google_chromeec_log_events(uint64_t mask)
int crosec_command_proto(struct chromeec_command *cec_command, crosec_io_t crosec_io, void *context)
int google_chromeec_set_sku_id(uint32_t skuid)
int google_chromeec_cbi_get_oem_id(uint32_t *id)
Get data from Cros Board Info.
int google_chromeec_flash_write_block(const uint8_t *data, uint32_t size)
Write a block into EC flash.
int google_chromeec_usb_get_pd_mux_info(int port, uint8_t *flags)
Check for the current mux state in EC.
int google_chromeec_get_num_pd_ports(unsigned int *num_ports)
Get number of PD-capable USB ports from EC.
uint64_t google_chromeec_get_wake_mask(void)
int google_chromeec_get_keybd_config(struct ec_response_keybd_config *keybd)
Get the keyboard configuration / layout information from EC.
int google_chromeec_wait_for_dp_hpd(int port, long timeout_ms)
int google_chromeec_start_vboot_hash(enum ec_vboot_hash_type hash_type, uint32_t offset, struct ec_response_vboot_hash *resp)
Calculate image hash for vboot.
enum ec_image google_chromeec_get_current_image(void)
int google_chromeec_i2c_xfer(uint8_t chip, uint8_t addr, int alen, uint8_t *buffer, int len, int is_read)
int google_chromeec_vstore_info(uint32_t *locked)
int google_chromeec_get_usb_pd_power_info(enum usb_chg_type *type, uint16_t *current_max, uint16_t *voltage_max)
int google_chromeec_get_usbc_mux_info(int port, struct usbc_mux_info *mux_info)
uint8_t google_chromeec_get_switches(void)
int google_chromeec_get_mkbp_event(struct ec_response_get_next_event *event)
int google_chromeec_vstore_write(int slot, uint8_t *data, size_t size)
int google_chromeec_vstore_read(int slot, uint8_t *data)
int(* crosec_io_t)(size_t req_size, size_t resp_size, void *context)
int google_chromeec_set_smi_mask(uint64_t mask)
int google_chromeec_set_usb_pd_role(uint8_t port, enum usb_pd_control_role role)
int google_chromeec_kbbacklight(int percent)
void google_chromeec_events_init(const struct google_chromeec_event_info *info, bool is_s3_wakeup)
int google_chromeec_cbi_get_ssfc(uint32_t *ssfc)
uint64_t google_chromeec_get_device_enabled_events(void)
int google_chromeec_override_dedicated_charger_limit(uint16_t current_lim, uint16_t voltage_lim)
bool google_chromeec_is_uhepi_supported(void)
uint32_t google_chromeec_get_board_sku(void)
int google_chromeec_cbi_get_sku_id(uint32_t *id)
int google_chromeec_vbnv_context(int is_read, uint8_t *data, int len)
void * crosec_get_buffer(size_t size, int req)
int google_chromeec_battery_cutoff(uint8_t flags)
Command EC to perform battery cutoff.
int google_chromeec_ap_reset(void)
Send EC command to perform AP reset.
int google_chromeec_regulator_enable(uint32_t index, uint8_t enable)
Configure the regulator as enabled / disabled.
int google_chromeec_set_usb_charge_mode(uint8_t port_id, enum usb_charge_mode mode)
int google_chromeec_efs_verify(enum ec_flash_region region)
Verify flash using EFS if available.
void google_chromeec_init(void)
int google_chromeec_regulator_get_voltage(uint32_t index, uint32_t *voltage_mv)
Get the currently configured voltage for the voltage regulator.
int google_chromeec_cbi_get_oem_name(char *buf, size_t bufsize)
int google_chromeec_set_sci_mask(uint64_t mask)
void google_chromeec_fill_ssdt_generator(const struct device *dev)
const char * google_chromeec_acpi_name(const struct device *dev)
static struct usb_pd_port_caps port_caps
ec_pd_try_power_role_caps
static struct tpm_chip chip
u8 buffer[C2P_BUFFER_MAXSIZE]
static size_t region_offset(const struct region *r)
unsigned long long uint64_t
struct ec_response_flash_info - Response to the flash info command.
struct ec_response_flash_protect - Response to the flash protect command.
struct ec_response_get_protocol_info - Response to the get protocol info.
struct fw_config - Firmware configuration field and option.
uint64_t s3_device_events
uint64_t s0ix_wake_events
enum ec_pd_power_role_caps power_role_cap
enum ec_pd_try_power_role_caps try_power_role_cap
enum ec_pd_port_location port_location
enum ec_pd_data_role_caps data_role_cap