summaryrefslogtreecommitdiff
path: root/include/flash.h
diff options
context:
space:
mode:
authorNick Sanders <nsanders@chromium.org>2016-04-06 14:25:45 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-05-26 16:17:26 -0700
commit56ee8aefc33505a7df4e4148001a11ac461907a3 (patch)
tree9aa84b4f26d7396878757bb7ed79bebaa18f59a2 /include/flash.h
parent5cc3cac589d3e869266c18ed7e538a769496478f (diff)
downloadchrome-ec-56ee8aefc33505a7df4e4148001a11ac461907a3.tar.gz
servo_micro: add programmable serial number
This change provides a console command for setting, and loading a usb serial number from flash. This feature adds CONFIG_USB_SERIALNO, and currently only has a useful implementation when PSTATE is present. BUG=chromium:571477 TEST=serialno set abcdef; serialno load; reboot BRANCH=none Change-Id: I3b24cfa2d52d54118bc3fd54b276e3d95412d245 Signed-off-by: Nick Sanders <nsanders@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/337359 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'include/flash.h')
-rw-r--r--include/flash.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/flash.h b/include/flash.h
index b065e7bb1b..03a6e89c25 100644
--- a/include/flash.h
+++ b/include/flash.h
@@ -245,4 +245,20 @@ uint32_t flash_get_protect(void);
*/
int flash_set_protect(uint32_t mask, uint32_t flags);
+/**
+ * Get the serial number from flash.
+ *
+ * @return char * ascii serial number string.
+ */
+const char *flash_read_serial(void);
+
+/**
+ * Set the serial number in flash.
+ *
+ * @param serialno ascii serial number string < 30 char.
+ *
+ * @return success status.
+ */
+int flash_write_serial(const char *serialno);
+
#endif /* __CROS_EC_FLASH_H */