diff options
author | Patrick Georgi <pgeorgi@google.com> | 2017-07-31 14:20:07 +0200 |
---|---|---|
committer | Aaron Durbin <adurbin@chromium.org> | 2017-08-15 20:22:20 +0000 |
commit | 69206d90fe99e0420ea5715736fe4b2403cbad06 (patch) | |
tree | 38ca53f2107cc873c8711d750dd2917fd830aedb | |
parent | 2f764f7dfe95e318057a241d8136fc866ebfed60 (diff) |
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>
-rw-r--r-- | src/ec/google/chromeec/ec.c | 18 | ||||
-rw-r--r-- | src/ec/google/chromeec/ec.h | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c index 2efc66a77c..4d47982aa6 100644 --- a/src/ec/google/chromeec/ec.c +++ b/src/ec/google/chromeec/ec.c @@ -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; diff --git a/src/ec/google/chromeec/ec.h b/src/ec/google/chromeec/ec.h index b2b63e8e5f..60d5a323b7 100644 --- a/src/ec/google/chromeec/ec.h +++ b/src/ec/google/chromeec/ec.h @@ -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); |