summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2018-11-07 10:47:46 -0800
committerchrome-bot <chrome-bot@chromium.org>2018-11-27 19:14:10 -0800
commitd36116efce964b725631d78a44b7dcb5147fee63 (patch)
treeffe6d61d11ec972e55e0592395979c29674ce70f
parentc92a973c55a3030b9a781994b6bf0c2d2a1630c7 (diff)
downloadchrome-ec-d36116efce964b725631d78a44b7dcb5147fee63.tar.gz
CBI: Clarify value types in help messages
This patch make cbi-util and ectool show OEM_NAME and DRAM_PART_NUM take a string parameter. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b:118798180 BRANCH=none TEST=buildall Change-Id: I7b4e126f02f9488ce6059c090a5f3ec665b39406 Reviewed-on: https://chromium-review.googlesource.com/1323852 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r--include/ec_commands.h6
-rw-r--r--util/cbi-util.c6
-rw-r--r--util/ectool.c37
3 files changed, 25 insertions, 24 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h
index d0b272e8a8..ee6fa61ace 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -4901,9 +4901,9 @@ struct ec_params_efs_verify {
#define EC_CMD_SET_CROS_BOARD_INFO 0x0120
enum cbi_data_tag {
- CBI_TAG_BOARD_VERSION = 0, /* uint16_t or uint8_t[] = {minor,major} */
- CBI_TAG_OEM_ID = 1, /* uint8_t */
- CBI_TAG_SKU_ID = 2, /* uint8_t */
+ CBI_TAG_BOARD_VERSION = 0, /* uint32_t or smaller */
+ CBI_TAG_OEM_ID = 1, /* uint32_t or smaller */
+ CBI_TAG_SKU_ID = 2, /* uint32_t or smaller */
CBI_TAG_DRAM_PART_NUM = 3, /* variable length ascii, nul terminated. */
CBI_TAG_OEM_NAME = 4, /* variable length ascii, nul terminated. */
CBI_TAG_COUNT,
diff --git a/util/cbi-util.c b/util/cbi-util.c
index aa8e5dd325..cc4fda8ba5 100644
--- a/util/cbi-util.c
+++ b/util/cbi-util.c
@@ -82,13 +82,13 @@ const char help_create[] =
" --size <size> Size of output file in bytes\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"
- "<value> can be a string for DRAM PART NUM/OEM NAME.\n"
"<size> must be a positive integer <= 0XFFFF.\n"
"Optional ARGS are:\n"
- " --dram_part_num <value> DRAM PART NUM\n"
- " --oem_name <value> OEM NAME\n"
+ " --dram_part_num <string> DRAM PART NUM\n"
+ " --oem_name <string> OEM NAME\n"
" --erase_byte <uint8> Byte used for empty space. Default:0xff\n"
" --format_version <uint16> Data format version\n"
+ "<string> is a string\n"
"\n";
const char help_show[] =
diff --git a/util/ectool.c b/util/ectool.c
index 24c0c7955e..1c5cb1cc59 100644
--- a/util/ectool.c
+++ b/util/ectool.c
@@ -6750,21 +6750,22 @@ int cmd_board_version(int argc, char *argv[])
static void cmd_cbi_help(char *cmd)
{
fprintf(stderr,
- " Usage: %s get <type> [get_flag]\n"
- " Usage: %s set <type> <value> <size> [set_flag]\n"
- " <type> is one of:\n"
- " 0: BOARD_VERSION\n"
- " 1: OEM_ID\n"
- " 2: SKU_ID\n"
- " 3: DRAM_PART_NUM\n"
- " 4: OEM_NAME\n"
- " <size> is the size of the data in byte\n"
- " <value> is integer to be set, string for DRAM_PART_NUM/OEM_NAME\n"
- " [get_flag] is combination of:\n"
- " 01b: Invalidate cache and reload data from EEPROM\n"
- " [set_flag] is combination of:\n"
- " 01b: Skip write to EEPROM. Use for back-to-back writes\n"
- " 10b: Set all fields to defaults first\n", cmd, cmd);
+ " Usage: %s get <tag> [get_flag]\n"
+ " Usage: %s set <tag> <value/string> <size> [set_flag]\n"
+ " <tag> is one of:\n"
+ " 0: BOARD_VERSION\n"
+ " 1: OEM_ID\n"
+ " 2: SKU_ID\n"
+ " 3: DRAM_PART_NUM (string)\n"
+ " 4: OEM_NAME (string)\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"
+ " [get_flag] is combination of:\n"
+ " 01b: Invalidate cache and reload data from EEPROM\n"
+ " [set_flag] is combination of:\n"
+ " 01b: Skip write to EEPROM. Use for back-to-back writes\n"
+ " 10b: Set all fields to defaults first\n", cmd, cmd);
}
/*
@@ -6879,9 +6880,9 @@ static int cmd_cbi(int argc, char *argv[])
p, sizeof(*p) + size, NULL, 0);
if (rv < 0) {
if (rv == -EC_RES_ACCESS_DENIED - EECRESULT)
- fprintf(stderr, "Write failed. Write-protect "
- "is enabled or EC explicitly refused "
- "to change the requested field.");
+ fprintf(stderr, "Write-protect is enabled or "
+ "EC explicitly refused to change the "
+ "requested field.\n");
else
fprintf(stderr, "Error code: %d\n", rv);
return rv;