diff options
author | Nicolas Boichat <drinkcat@google.com> | 2017-06-03 12:06:37 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-06-13 21:23:56 -0700 |
commit | d132e5ecbd93fa598fc495ec90718ea853962ef7 (patch) | |
tree | a90d7fe4a7db29aa8bcade2867a33e66165964f1 /include/system.h | |
parent | 8ba7c1762c68ad81df688c407ecf1836ce177e75 (diff) | |
download | chrome-ec-d132e5ecbd93fa598fc495ec90718ea853962ef7.tar.gz |
stm32/usb: Add support for board-specific serial number
By default, read USB serial number from flash, but provide a way
for boards to override the function (e.g., to read serial number
from unique chip id).
BRANCH=none
BUG=b:62280271
TEST=Flash hammer
lsusb -d 18d1:5022 -v -v | grep iSerial
shows different chip IDs on different boards.
Change-Id: I0917752bb8e04c1eff4dffc0b3714f63dcd942b0
Reviewed-on: https://chromium-review.googlesource.com/523045
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'include/system.h')
-rw-r--r-- | include/system.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/system.h b/include/system.h index c7304a4d92..0f01907574 100644 --- a/include/system.h +++ b/include/system.h @@ -285,6 +285,12 @@ const char *system_get_chip_revision(void); */ int system_get_chip_unique_id(uint8_t **id); +/** + * Optional board-level callback functions to read a unique serial number per + * chip. Default implementation reads from flash (flash_read_serial). + */ +const char *board_read_serial(void) __attribute__((weak)); + /* * Common bbram entries. Chips don't necessarily need to implement * all of these, error will be returned from system_get/set_bbram if |