diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2018-01-12 12:52:18 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-01-18 05:09:31 -0800 |
commit | bc4b786156b3dd51de75f512d05679d5b413399b (patch) | |
tree | 830a7bcbc8b5e7d08b8b453fec4c4f1cd25ecfbe /include/ec_commands.h | |
parent | 5232cdd16bb2e1b15b281b0041c33c55bc9ca52d (diff) | |
download | chrome-ec-bc4b786156b3dd51de75f512d05679d5b413399b.tar.gz |
CBI: Add host command to set board info
This patch adds host command to write board information in EERPOM.
BUG=b:70294260
BRANCH=none
TEST=Run ectool cbi set <type> <value> to write BOARD_VERSION, OEM_ID,
and SKU_ID. Enable WP and verify cbi set command fails.
Change-Id: I39536d146313408ace666f350a107d89b331bf7a
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/865570
Diffstat (limited to 'include/ec_commands.h')
-rw-r--r-- | include/ec_commands.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h index 23307354e1..705e54f2b1 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -4576,6 +4576,11 @@ struct __ec_align1 ec_params_efs_verify { * size to determine how big it is. */ #define EC_CMD_GET_CROS_BOARD_INFO 0x011F +/* + * Write info into Cros Board Info on EEPROM. Write fails if the board has + * hardware write-protect enabled. + */ +#define EC_CMD_SET_CROS_BOARD_INFO 0x0120 enum cbi_data_type { /* integer types */ @@ -4591,6 +4596,24 @@ struct __ec_align4 ec_params_get_cbi { uint32_t type; /* enum cbi_data_type */ }; +/* + * Flags to control write behavior. + * + * NO_SYNC: Makes EC update data in RAM but skip writing to EEPROM. It's + * useful when writing multiple fields in a row. + * INIT: Need to be set when creating a new CBI from scratch. All fields + * will be initialized to zero first. + */ +#define CBI_SET_NO_SYNC (1 << 0) +#define CBI_SET_INIT (1 << 1) + +struct __ec_align1 ec_params_set_cbi { + uint32_t type; /* enum cbi_data_type */ + uint8_t flag; /* CBI_SET_* */ + uint32_t data; /* For numeric value */ + uint8_t raw[]; /* For string and raw data */ +}; + /*****************************************************************************/ /* The command range 0x200-0x2FF is reserved for Rotor. */ |