summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ec/google/chromeec/ec.c18
-rw-r--r--src/ec/google/chromeec/ec.h1
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);