summaryrefslogtreecommitdiff
path: root/include/update_fw.h
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@google.com>2017-07-31 12:35:32 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-08-10 01:14:59 -0700
commit23b0d417f564619779dfb7c20ec4502d3ca132fe (patch)
tree877bc068a5c3b205a188b8ad403f50017e611443 /include/update_fw.h
parent7947687f12b2e802b2ef8cb13f9688ee7c10b746 (diff)
downloadchrome-ec-23b0d417f564619779dfb7c20ec4502d3ca132fe.tar.gz
update_fw: Add support for touchpad update over virtual address
In the field, we want to update touchpad FW using the same USB update protocol as the main EC FW. To distinguish between EC FW update and touchpad FW update, we use a virtual address, defined by CONFIG_TOUCHPAD_VIRTUAL_OFF, that does not map to anything on the EC chip. Also, this will allow us to verify hashes of each block of the flashed touchpad firmware, so that we can ensure its integrity before flashing it into the touchpad. A stub is implemented in update_fw.c:contents_allowed. BRANCH=none BUG=b:63993173 TEST=With follow-up CLs, ./usb_updater2 -p 144.0_2.0.bin Change-Id: I4de1d7d138fc01fe1552a4173c8ef208ecb834a7 Signed-off-by: Nicolas Boichat <drinkcat@google.com> Reviewed-on: https://chromium-review.googlesource.com/593373 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Chun-ta Lin <itspeter@chromium.org>
Diffstat (limited to 'include/update_fw.h')
-rw-r--r--include/update_fw.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/update_fw.h b/include/update_fw.h
index 44c64468f6..58ef453931 100644
--- a/include/update_fw.h
+++ b/include/update_fw.h
@@ -194,6 +194,13 @@ struct touchpad_info {
uint8_t reserved; /* padding */
uint16_t vendor; /* Vendor USB id */
+ /*
+ * Virtual address to write to to update TP FW over USB update protocol,
+ * and FW size. Both are 0 if unsupported.
+ */
+ uint32_t fw_address;
+ uint32_t fw_size;
+
/* Vendor specific data. */
struct {
uint16_t id;
@@ -230,4 +237,7 @@ enum {
/* Obtain touchpad information */
int touchpad_get_info(struct touchpad_info *tp);
+/* Touchpad FW update: Write a FW block. */
+int touchpad_update_write(int offset, int size, const uint8_t *data);
+
#endif /* ! __CROS_EC_UPDATE_FW_H */