summaryrefslogtreecommitdiff
path: root/include/update_fw.h
diff options
context:
space:
mode:
authorNick Sanders <nsanders@chromium.org>2016-07-19 15:13:50 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-07-21 13:13:35 -0700
commit14dbcb829e2c676cb2325445f7e3b9f352833050 (patch)
tree0e6a1aa974b7f9a3a9286a3339fd9a8b8f9656d0 /include/update_fw.h
parent63bd3feaabb95562c1051a718ac88305126c3ead (diff)
downloadchrome-ec-14dbcb829e2c676cb2325445f7e3b9f352833050.tar.gz
servo_v4: copypasta usb updater code into common
This copies the generic USB update code into common so it can be used on other platforms. There should be no functional change. cr50 folks want no change to their code so vbendeb@chomium.org will refactor this back together at a later date. BUG=chromium:571476 TEST=none BRANCH=none Change-Id: I710afb22940013e7db5d8694898b90c0ae245777 Signed-off-by: Nick Sanders <nsanders@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/362131 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'include/update_fw.h')
-rw-r--r--include/update_fw.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/include/update_fw.h b/include/update_fw.h
new file mode 100644
index 0000000000..f1b76e1033
--- /dev/null
+++ b/include/update_fw.h
@@ -0,0 +1,36 @@
+/* Copyright 2016 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef __CROS_EC_UPDATE_FW_H
+#define __CROS_EC_UPDATE_FW_H
+
+#include <stddef.h>
+
+/* TODO: Handle this in update_fw.c, not usb_update.c */
+#define UPDATE_DONE 0xB007AB1E
+
+/*
+ * This array defines possible sections available for the firmare update.
+ * The section which does not map the current execting code is picked as the
+ * valid update area. The values are offsets into the flash space.
+ *
+ * This should be defined in board.c, with each entry containing:
+ * {CONFIG_RW_MEM_OFF, CONFIG_RW_MEM_OFF + CONFIG_RW_SIZE}
+ * for its relevant section.
+ */
+struct section_descriptor {
+ uint32_t sect_base_offset;
+ uint32_t sect_top_offset;
+};
+
+extern const struct section_descriptor * const rw_sections;
+extern const int num_rw_sections;
+
+
+void fw_update_command_handler(void *body,
+ size_t cmd_size,
+ size_t *response_size);
+
+#endif /* ! __CROS_EC_UPDATE_FW_H */