summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2012-05-22 11:00:36 -0700
committerBill Richardson <wfrichar@chromium.org>2012-05-22 14:22:13 -0700
commita7d62b4fd4b4cd9e290bbd1e9e2e479f9ab9455e (patch)
tree8a67e8760ce9dcd079bed3a245ebd5370a43636e /include
parent43e26da7940633bca4b6cfcb0ff8a541375506f9 (diff)
downloadchrome-ec-a7d62b4fd4b4cd9e290bbd1e9e2e479f9ab9455e.tar.gz
Add LPC command to handle vboot stuff.
This adds "ectool vboot", which works like so: # ./ectool vboot 0x06 image=A fake_dev=1 # ./ectool vboot 0 # ./ectool vboot 0x02 image=A fake_dev=0 # ./ectool vboot ff # ./ectool vboot 0x06 image=A fake_dev=1 You can set or unset the fake dev-switch, and see which firmware image the EC is running from. BUG=chrome-os-partner:8313 TEST=manual Boot the host, use crossystem to see the devsw_boot state. Change it with the ectool command, reboot, see that it's changed. Change-Id: Iaac40267338c6a07bc47b80e925e829bf1e1ae0c Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/ec_commands.h27
-rw-r--r--include/vboot.h13
2 files changed, 40 insertions, 0 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h
index 91b5443e79..ea699f3d09 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -418,6 +418,33 @@ struct ec_params_lightbar_cmd {
} __attribute__ ((packed));
/*****************************************************************************/
+/* Verified boot commands. Details still evolving. */
+#define EC_CMD_VBOOT_CMD 0x29
+struct ec_params_vboot_cmd {
+ union {
+ union {
+ uint8_t cmd;
+ struct {
+ uint8_t cmd;
+ /* no inputs */
+ } get_flags;
+ struct {
+ uint8_t cmd;
+ uint8_t val;
+ } set_flags;
+ } in;
+ union {
+ struct {
+ uint8_t val;
+ } get_flags;
+ struct {
+ /* no outputs */
+ } set_flags;
+ } out;
+ };
+} __attribute__ ((packed));
+
+/*****************************************************************************/
/* USB charging control commands */
/* Set USB port charging mode */
diff --git a/include/vboot.h b/include/vboot.h
index 430c617a52..48d626c0c7 100644
--- a/include/vboot.h
+++ b/include/vboot.h
@@ -17,4 +17,17 @@ int vboot_pre_init(void);
/* Initializes the module. */
int vboot_init(void);
+/* These are the vboot commands available via LPC. */
+enum vboot_command {
+ VBOOT_CMD_GET_FLAGS,
+ VBOOT_CMD_SET_FLAGS,
+ VBOOT_NUM_CMDS,
+};
+
+/* These are the flags transferred across LPC. At the moment, only the devmode
+ flag can be set, and only because it's faked. Ultimately this functionality
+ will be moved elsewhere. */
+#define VBOOT_FLAGS_IMAGE_MASK 0x03 /* enum system_image_copy_t */
+#define VBOOT_FLAGS_FAKE_DEVMODE 0x04 /* fake dev-mode bit */
+
#endif /* __CROS_EC_VBOOT_H */