ec/google/chromeec: add support for retrieving DRAM part number

The DRAM part number can be stored in the CBI data. Therefore, add
support for fetching the DRAM part number from CBI.

BUG=b:112203105
TEST=Fetched data from CBI on phaser during testing.

Change-Id: Ia721c01aab5848ff36e11792adf9c494aa25c01d
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/27945
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Justin TerAvest <teravest@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
Aaron Durbin
2018-08-07 12:24:21 -06:00
parent 9a30c7289f
commit b388c0e557
3 changed files with 27 additions and 0 deletions

View File

@@ -607,6 +607,31 @@ int google_chromeec_cbi_get_oem_id(uint32_t *id)
return cbi_get_uint32(id, CBI_TAG_OEM_ID);
}
int google_chromeec_cbi_get_dram_part_num(char *buf, size_t bufsize)
{
struct ec_params_get_cbi p = {
.tag = CBI_TAG_DRAM_PART_NUM,
};
struct chromeec_command cmd = {
.cmd_code = EC_CMD_GET_CROS_BOARD_INFO,
.cmd_version = 0,
.cmd_data_in = &p,
.cmd_data_out = buf,
.cmd_size_in = sizeof(p),
.cmd_size_out = bufsize,
};
int rv;
rv = google_chromeec_command(&cmd);
if (rv < 0)
return rv;
/* Ensure NUL termination. */
buf[bufsize - 1] = '\0';
return 0;
}
#ifndef __SMM__
u16 google_chromeec_get_board_version(void)
{