From 8db8a6154fd5ae78a8e183f5ddc5ae9e6141dfe7 Mon Sep 17 00:00:00 2001 From: Jett Rink Date: Tue, 14 Jan 2020 11:41:47 -0700 Subject: ec/google/chromeec: add support for fw_config cbi field The firmware configuration (fw_config) field is store in the CBI EEPROM and it should be used to make firmware customization instead of sku/variant id. BUG=b:145519081 TEST=builds Change-Id: I790998a29e724ecdff8876cca072267537b7cea6 Signed-off-by: Jett Rink Reviewed-on: https://review.coreboot.org/c/coreboot/+/38410 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/ec/google/chromeec/ec.c | 5 +++++ src/ec/google/chromeec/ec.h | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src/ec/google/chromeec') diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c index b6020a3a62..0b23034101 100644 --- a/src/ec/google/chromeec/ec.c +++ b/src/ec/google/chromeec/ec.c @@ -885,6 +885,11 @@ int google_chromeec_cbi_get_sku_id(uint32_t *id) return cbi_get_uint32(id, CBI_TAG_SKU_ID); } +int google_chromeec_cbi_get_fw_config(uint32_t *fw_config) +{ + return cbi_get_uint32(fw_config, CBI_TAG_FW_CONFIG); +} + int google_chromeec_cbi_get_oem_id(uint32_t *id) { return cbi_get_uint32(id, CBI_TAG_OEM_ID); diff --git a/src/ec/google/chromeec/ec.h b/src/ec/google/chromeec/ec.h index 5ef4366117..d90d24c767 100644 --- a/src/ec/google/chromeec/ec.h +++ b/src/ec/google/chromeec/ec.h @@ -77,13 +77,14 @@ int google_chromeec_vstore_write(int slot, uint8_t *data, size_t size); int google_chromeec_reboot(int dev_idx, enum ec_reboot_cmd type, uint8_t flags); /** - * Get OEM (or SKU) ID from Cros Board Info + * Get data from Cros Board Info * - * @param id [OUT] oem/sku id + * @param id/fw_config/buf [OUT] value from from CBI. * @return 0 on success or negative integer for errors. */ int google_chromeec_cbi_get_oem_id(uint32_t *id); int google_chromeec_cbi_get_sku_id(uint32_t *id); +int google_chromeec_cbi_get_fw_config(uint32_t *fw_config); int google_chromeec_cbi_get_dram_part_num(char *buf, size_t bufsize); int google_chromeec_cbi_get_oem_name(char *buf, size_t bufsize); -- cgit v1.2.3