summaryrefslogtreecommitdiff
path: root/include/cros_board_info.h
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2018-05-11 15:09:50 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-05-16 16:42:47 -0700
commit5252c739362455cc133af5deb86ffd5e00742024 (patch)
tree52dcf7942f7d6a7a562139b1784337c2a947368d /include/cros_board_info.h
parent9ebaece91b94f42bcb2b9c94af5fe2e328d3bca2 (diff)
downloadchrome-ec-5252c739362455cc133af5deb86ffd5e00742024.tar.gz
cbi-util: Allow field size to be specified
Currently, field sizes are automatically set to the smallest size which can fit a given value. This patch makes cbi-util allow field sizes to be specified. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b:79514391 BRANCH=none TEST=Tested as follows: 1. Create CBI image: $ cbi-util create --file cbi.bin --board_version 0x202 \ --oem_id 0xabcd:2 --sku_id 0xff:4 --size 256 2. Verify the image: $ cbi-util show --file cbi.bin CBI image: /home/dnojiri/tmp/nami/tmp/cbi.new.bin TOTAL_SIZE: 22 Data Field: name: value (hex, tag, size) BOARD_VERSION: 514 (0x202, 0, 2) OEM_ID: 43981 (0xabcd, 1, 2) SKU_ID: 255 (0xff, 2, 4) 3. Verify the output matches with the previous output if field sizes are not specified. Change-Id: Ic7149274d6e4a118ea12bbf03199b548b7089a3e Reviewed-on: https://chromium-review.googlesource.com/1056201 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'include/cros_board_info.h')
-rw-r--r--include/cros_board_info.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/cros_board_info.h b/include/cros_board_info.h
index fb667ef899..23063d2766 100644
--- a/include/cros_board_info.h
+++ b/include/cros_board_info.h
@@ -81,7 +81,7 @@ uint8_t cbi_crc8(const struct cbi_header *h);
* should be pointing to the data section of CBI.
* @param tag Tag of the data item
* @param buf Pointer to the buffer containing the data being copied.
- * @param size Size of the data
+ * @param size Size of the data in bytes. Must be 0 < size < 256.
* @return Address of the byte following the stored data in the
* destination buffer
*/