From d36116efce964b725631d78a44b7dcb5147fee63 Mon Sep 17 00:00:00 2001 From: Daisuke Nojiri Date: Wed, 7 Nov 2018 10:47:46 -0800 Subject: 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 BUG=b:118798180 BRANCH=none TEST=buildall Change-Id: I7b4e126f02f9488ce6059c090a5f3ec665b39406 Reviewed-on: https://chromium-review.googlesource.com/1323852 Commit-Ready: Daisuke Nojiri Tested-by: Daisuke Nojiri Reviewed-by: Jett Rink --- include/ec_commands.h | 6 +++--- util/cbi-util.c | 6 +++--- util/ectool.c | 37 +++++++++++++++++++------------------ 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 of output file in bytes\n" " must be a positive integer <= 0XFFFFFFFF and field size can\n" "be optionally specified by notation: e.g. 0xabcd:4.\n" - " can be a string for DRAM PART NUM/OEM NAME.\n" " must be a positive integer <= 0XFFFF.\n" "Optional ARGS are:\n" - " --dram_part_num DRAM PART NUM\n" - " --oem_name OEM NAME\n" + " --dram_part_num DRAM PART NUM\n" + " --oem_name OEM NAME\n" " --erase_byte Byte used for empty space. Default:0xff\n" " --format_version Data format version\n" + " 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 [get_flag]\n" - " Usage: %s set [set_flag]\n" - " 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" - " is the size of the data in byte\n" - " 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 [get_flag]\n" + " Usage: %s set [set_flag]\n" + " 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" + " is the size of the data in byte. It should be zero for\n" + " string types.\n" + " 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; -- cgit v1.2.1