ec/google: Get OEM ID and SKU ID from EC

This patch adds EC_CMD_GET_CROS_BOARD_INFO and two APIs to fetch
OEM ID and SKU ID from cros EC.

CBI abbreviates Cros Board Info.

BUG=b:70294260
BRANCH=none
TEST=Verify AP log shows expected OEM ID and SKU ID on Fizz.

Change-Id: Iff69a2dc0e562d87dd287f79c407f23aeb09fb9e
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://review.coreboot.org/23549
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Daisuke Nojiri
2018-02-01 07:46:02 -08:00
committed by Martin Roth
parent b0bea2bf6f
commit 07f9748f22
3 changed files with 103 additions and 0 deletions

View File

@@ -64,6 +64,15 @@ int google_chromeec_vstore_write(int slot, uint8_t *data, size_t size);
success, < 0 otherwise. */
int google_chromeec_reboot(int dev_idx, enum ec_reboot_cmd type, uint8_t flags);
/**
* Get OEM (or SKU) ID from Cros Board Info
*
* @param id [OUT] oem/sku id
* @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);
/* MEC uses 0x800/0x804 as register/index pair, thus an 8-byte resource. */
#define MEC_EMI_BASE 0x800
#define MEC_EMI_SIZE 8