ec/google: Add command to fetch SKU ID from EC

BUG=b:64468585
BRANCH=none
TEST=with the other sku-id related patches applied, coreboot obtains the
right SKU ID from EC

Change-Id: I82e324407b4b96495a3eb3d4caf110f9eae05116
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/20946
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
This commit is contained in:
Patrick Georgi 2017-07-31 14:20:07 +02:00 committed by Aaron Durbin
parent 2f764f7dfe
commit 69206d90fe
2 changed files with 19 additions and 0 deletions

View File

@ -386,6 +386,24 @@ u16 google_chromeec_get_board_version(void)
return board_v.board_version;
}
u32 google_chromeec_get_sku_id(void)
{
struct chromeec_command cmd;
struct ec_response_sku_id sku_v;
cmd.cmd_code = EC_CMD_GET_SKU_ID;
cmd.cmd_version = 0;
cmd.cmd_size_in = 0;
cmd.cmd_size_out = sizeof(sku_v);
cmd.cmd_data_out = &sku_v;
cmd.cmd_dev_index = 0;
if (google_chromeec_command(&cmd) != 0)
return 0;
return sku_v.sku_id;
}
int google_chromeec_vbnv_context(int is_read, uint8_t *data, int len)
{
struct chromeec_command cec_cmd;

View File

@ -49,6 +49,7 @@ void google_chromeec_check_pd_image(int expected_type);
int google_chromeec_check_feature(int feature);
uint8_t google_chromeec_calc_checksum(const uint8_t *data, int size);
u16 google_chromeec_get_board_version(void);
u32 google_chromeec_get_sku_id(void);
u32 google_chromeec_get_events_b(void);
int google_chromeec_clear_events_b(u32 mask);
int google_chromeec_kbbacklight(int percent);