Files
OpenCellular/include/vboot.h
Bill Richardson a7d62b4fd4 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>
2012-05-22 14:22:13 -07:00

34 lines
964 B
C

/* Copyright (c) 2011 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.
*/
/* Verified boot module for Chrome EC */
#ifndef __CROS_EC_VBOOT_H
#define __CROS_EC_VBOOT_H
#include "common.h"
/* Pre-initializes the module. This occurs before clocks or tasks are
* set up. */
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 */