From 9ed10bff317097c42b1545279f88af95ca796ab0 Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Thu, 20 Feb 2020 13:38:49 +1100 Subject: ec/google/chromeec: Introduce SKU_ID helpers The following introduces helpers that, by default, accommodate a larger SKU id space. The following is the rational for that: Allow INT32_MAX SKU id encodings beyond UINT8_MAX. This allows for the SKU id to accommodate up to 4 bytes however we reserve the highest bit for SKU_UNKNOWN to be encoded. However, the legacy UINT8_MAX encoding is supported by leveraging the Kconfig by overriding it with the legacy max of 0xff. Follow ups migrate boards to this common framework. V.2: Fixup array size && drop sku_id SKU_UNKNOWN check and pass whatever is set to userspace as firmware doesn't care about the value. V.3: Use SPDX-License header. BUG=b:149348474 BRANCH=none TEST=tested on hatch. Change-Id: I805b25465a3b4ee3dc0cbda5feb9e9ea2493ff9e Signed-off-by: Edward O'Callaghan Reviewed-on: https://review.coreboot.org/c/coreboot/+/39018 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh --- src/ec/google/chromeec/ec.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/ec/google/chromeec/ec.h') diff --git a/src/ec/google/chromeec/ec.h b/src/ec/google/chromeec/ec.h index 7341636819..f13b5105c2 100644 --- a/src/ec/google/chromeec/ec.h +++ b/src/ec/google/chromeec/ec.h @@ -89,6 +89,9 @@ 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); +uint32_t google_chromeec_get_board_sku(void); +const char *google_chromeec_smbios_system_sku(void); + /* MEC uses 0x800/0x804 as register/index pair, thus an 8-byte resource. */ #define MEC_EMI_BASE 0x800 #define MEC_EMI_SIZE 8 -- cgit v1.2.3