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:
committed by
Martin Roth
parent
b0bea2bf6f
commit
07f9748f22
@@ -558,6 +558,40 @@ int google_chromeec_reboot(int dev_idx, enum ec_reboot_cmd type, uint8_t flags)
|
||||
return google_chromeec_command(&cec_cmd);
|
||||
}
|
||||
|
||||
static int cbi_get_uint32(uint32_t *id, uint32_t type)
|
||||
{
|
||||
struct chromeec_command cmd;
|
||||
struct ec_params_get_cbi p;
|
||||
uint32_t r;
|
||||
int rv;
|
||||
|
||||
p.type = type;
|
||||
|
||||
cmd.cmd_code = EC_CMD_GET_CROS_BOARD_INFO;
|
||||
cmd.cmd_version = 0;
|
||||
cmd.cmd_data_in = &p;
|
||||
cmd.cmd_data_out = &r;
|
||||
cmd.cmd_size_in = sizeof(p);
|
||||
cmd.cmd_size_out = sizeof(r);
|
||||
cmd.cmd_dev_index = 0;
|
||||
|
||||
rv = google_chromeec_command(&cmd);
|
||||
if (rv < 0)
|
||||
return rv;
|
||||
*id = r;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int google_chromeec_cbi_get_sku_id(uint32_t *id)
|
||||
{
|
||||
return cbi_get_uint32(id, CBI_DATA_SKU_ID);
|
||||
}
|
||||
|
||||
int google_chromeec_cbi_get_oem_id(uint32_t *id)
|
||||
{
|
||||
return cbi_get_uint32(id, CBI_DATA_OEM_ID);
|
||||
}
|
||||
|
||||
#ifndef __SMM__
|
||||
u16 google_chromeec_get_board_version(void)
|
||||
{
|
||||
|
Reference in New Issue
Block a user