diff options
author | Randall Spangler <rspangler@chromium.org> | 2012-07-07 15:48:04 -0700 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-07-07 19:10:24 -0700 |
commit | 053b7b682c60eb7bcf55a079ff7afccccef82fa6 (patch) | |
tree | b7bdc361954769143897653d3e2bd6672f037844 /firmware/include | |
parent | b2ac7fbbbf05fecfbabd37f6a2e4b268c9ac330f (diff) | |
download | vboot-053b7b682c60eb7bcf55a079ff7afccccef82fa6.tar.gz |
Stub out new vboot APIs for EC software sync
BUG=chrome-os-partner:11087
TEST=make sure it builds; APIs aren't used yet.
Change-Id: If86f3465a889b8fa87cf225d2b9876fe79311327
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/26875
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'firmware/include')
-rw-r--r-- | firmware/include/vboot_api.h | 53 |
1 files changed, 46 insertions, 7 deletions
diff --git a/firmware/include/vboot_api.h b/firmware/include/vboot_api.h index 08e61ad8..2a418ad3 100644 --- a/firmware/include/vboot_api.h +++ b/firmware/include/vboot_api.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011 The Chromium OS Authors. All rights reserved. +/* Copyright (c) 2012 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. */ @@ -601,6 +601,51 @@ uint32_t VbExKeyboardRead(void); /*****************************************************************************/ +/* Embedded controller (EC) */ + +/* This is called only if the system implements a keyboard-based (virtual) + * developer switch. It must return true only if the system has an embedded + * controller which is provably running in its RO firmware at the time the + * function is called. */ +int VbExTrustEC(void); + +/* Check if the EC is currently running rewritable code. + * + * If the EC is in RO code, sets *in_rw=0. + * If the EC is in RW code, sets *in_rw non-zero. + * If the current EC image is unknown, returns error. */ +VbError_t VbExEcRunningRW(int *in_rw); + +/* Request the EC jump to its rewritable code. If successful, returns + * when the EC has booting its RW code far enough to respond to + * subsequent commands. Does nothing if the EC is already in its + * rewritable code. */ +VbError_t VbExEcJumpToRW(void); + +/* Cold-reboot the EC into read-only code. This also reboots the main + * processor, so this function only returns if there was an error. */ +VbError_t VbExEcRebootToRO(void); + +/* Tell the EC to stay in RO code until it reboots. Subsequent calls to + * VbExEcJumpToRW() this boot will fail. Fails if the EC is not currently in + * RO code. */ +VbError_t VbExEcStayInRO(void); + +/* Read the SHA-256 hash of the rewriteable EC image. */ +VbError_t VbExEcHashRW(const uint8_t **hash, int *hash_size); + +/* Get the expected contents of the EC image as stored in the main firmware. */ +VbError_t VbExEcGetExpectedRW(const uint8_t **image, int *image_size); + +/* Update the EC rewritable image. */ +VbError_t VbExEcUpdateRW(const uint8_t *image, int image_size); + +/* Lock the EC code to prevent updates until the EC is rebooted. + * Subsequent calls to VbExEcUpdateRW() this boot will fail. */ +VbError_t VbExEcProtectRW(void); + + +/*****************************************************************************/ /* Misc */ /* Checks if the firmware needs to shut down the system. @@ -624,10 +669,4 @@ VbError_t VbExDecompress(void *inbuf, uint32_t in_size, void *outbuf, uint32_t *out_size); -/* This is called only if the system implements a keyboard-based (virtual) - * developer switch. It must return true only if the system has an embedded - * controller which is provably running in its RO firmware at the time the - * function is called. */ -int VbExTrustEC(void); - #endif /* VBOOT_REFERENCE_VBOOT_API_H_ */ |