summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/cbi.c9
-rw-r--r--include/cros_board_info.h1
-rw-r--r--include/ec_commands.h1
-rw-r--r--util/cbi-util.c12
-rw-r--r--util/ectool.c1
5 files changed, 24 insertions, 0 deletions
diff --git a/common/cbi.c b/common/cbi.c
index e1839a9b6e..109911c0be 100644
--- a/common/cbi.c
+++ b/common/cbi.c
@@ -299,6 +299,14 @@ int cbi_get_fw_config(uint32_t *fw_config)
&size);
}
+int cbi_get_pcb_supplier(uint32_t *pcb_supplier)
+{
+ uint8_t size = sizeof(*pcb_supplier);
+
+ return cbi_get_board_info(CBI_TAG_PCB_SUPPLIER, (uint8_t *)pcb_supplier,
+ &size);
+}
+
static enum ec_status hc_cbi_get(struct host_cmd_handler_args *args)
{
const struct __ec_align4 ec_params_get_cbi *p = args->params;
@@ -414,6 +422,7 @@ static void dump_cbi(void)
print_tag("MODEL_ID", cbi_get_model_id(&val), &val);
print_tag("SKU_ID", cbi_get_sku_id(&val), &val);
print_tag("FW_CONFIG", cbi_get_fw_config(&val), &val);
+ print_tag("PCB_SUPPLIER", cbi_get_pcb_supplier(&val), &val);
}
static int cc_cbi(int argc, char **argv)
diff --git a/include/cros_board_info.h b/include/cros_board_info.h
index 13eff572d9..25330779d5 100644
--- a/include/cros_board_info.h
+++ b/include/cros_board_info.h
@@ -53,6 +53,7 @@ int cbi_get_sku_id(uint32_t *sku_id);
int cbi_get_oem_id(uint32_t *oem_id);
int cbi_get_model_id(uint32_t *id);
int cbi_get_fw_config(uint32_t *fw_config);
+int cbi_get_pcb_supplier(uint32_t *pcb_supplier);
/**
* Get data from CBI store
diff --git a/include/ec_commands.h b/include/ec_commands.h
index 5d7dd1926c..055432a431 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -5722,6 +5722,7 @@ enum cbi_data_tag {
CBI_TAG_OEM_NAME = 4, /* variable length ascii, nul terminated. */
CBI_TAG_MODEL_ID = 5, /* uint32_t or smaller */
CBI_TAG_FW_CONFIG = 6, /* uint32_t bit field */
+ CBI_TAG_PCB_SUPPLIER = 7, /* uint32_t or smaller */
CBI_TAG_COUNT,
};
diff --git a/util/cbi-util.c b/util/cbi-util.c
index 2fd983c1aa..06dc909c20 100644
--- a/util/cbi-util.c
+++ b/util/cbi-util.c
@@ -38,6 +38,7 @@ enum {
OPT_OEM_NAME,
OPT_MODEL_ID,
OPT_FW_CONFIG,
+ OPT_PCB_SUPPLIER,
OPT_SIZE,
OPT_ERASE_BYTE,
OPT_SHOW_ALL,
@@ -53,6 +54,7 @@ static const struct option opts_create[] = {
{"oem_name", 1, 0, OPT_OEM_NAME},
{"model_id", 1, 0, OPT_MODEL_ID},
{"fw_config", 1, 0, OPT_FW_CONFIG},
+ {"pcb_supplier", 1, 0, OPT_PCB_SUPPLIER},
{"size", 1, 0, OPT_SIZE},
{"erase_byte", 1, 0, OPT_ERASE_BYTE},
{NULL, 0, 0, 0}
@@ -73,6 +75,7 @@ static const char *field_name[] = {
"OEM_NAME",
"MODEL_ID",
"FW_CONFIG",
+ "PCB_SUPPLIER",
};
BUILD_ASSERT(ARRAY_SIZE(field_name) == CBI_TAG_COUNT);
@@ -93,6 +96,7 @@ const char help_create[] =
" --format_version <uint16> Data format version\n"
" --model_id <value> Model ID\n"
" --fw_config <value> Firmware configuration bit-field\n"
+ " --pcb_supplier <value> PCB supplier\n"
"\n"
"<value> must be a positive integer <= 0XFFFFFFFF and field size can\n"
" be optionally specified by <value:size> notation: e.g. 0xabcd:4.\n"
@@ -251,6 +255,7 @@ static int cmd_create(int argc, char **argv)
struct integer_field sku;
struct integer_field model;
struct integer_field fw_config;
+ struct integer_field pcb_supplier;
const char *dram_part_num;
const char *oem_name;
} bi;
@@ -323,6 +328,10 @@ static int cmd_create(int argc, char **argv)
if (parse_integer_field(optarg, &bi.fw_config))
return -1;
break;
+ case OPT_PCB_SUPPLIER:
+ if (parse_integer_field(optarg, &bi.pcb_supplier))
+ return -1;
+ break;
}
}
@@ -351,6 +360,8 @@ static int cmd_create(int argc, char **argv)
p = cbi_set_data(p, CBI_TAG_MODEL_ID, &bi.model.val, bi.model.size);
p = cbi_set_data(p, CBI_TAG_FW_CONFIG, &bi.fw_config.val,
bi.fw_config.size);
+ p = cbi_set_data(p, CBI_TAG_PCB_SUPPLIER, &bi.pcb_supplier.val,
+ bi.pcb_supplier.size);
p = cbi_set_string(p, CBI_TAG_DRAM_PART_NUM, bi.dram_part_num);
p = cbi_set_string(p, CBI_TAG_OEM_NAME, bi.oem_name);
@@ -479,6 +490,7 @@ static int cmd_show(int argc, char **argv)
print_integer(buf, CBI_TAG_FW_CONFIG);
print_string(buf, CBI_TAG_DRAM_PART_NUM);
print_string(buf, CBI_TAG_OEM_NAME);
+ print_integer(buf, CBI_TAG_PCB_SUPPLIER);
free(buf);
diff --git a/util/ectool.c b/util/ectool.c
index c04fddb4c6..fe681b675f 100644
--- a/util/ectool.c
+++ b/util/ectool.c
@@ -7716,6 +7716,7 @@ static void cmd_cbi_help(char *cmd)
" 4: OEM_NAME (string)\n"
" 5: MODEL_ID\n"
" 6: FW_CONFIG\n"
+ " 7: PCB_VENDOR\n"
" <size> is the size of the data in byte. It should be zero for\n"
" string types.\n"
" <value/string> is an integer or a string to be set\n"