Files
OpenCellular/include/vboot.h
Daisuke Nojiri 921e9b7125 vboot: Jump to RW early
This change makes EC run vboot in the HOOK task. The vboot routine
requires battery and charger info. It waits in a deferred call
loop until the charge manager is initialized.

BUG=b:63586051
BRANCH=none
TEST=Verify the following cases:

A. Hardware reboot (type-c/BJ)
1. Unplug AC in S0 then plug in AC:     BOOT/BOOT
2. Unplug AC in S5 then plug in AC:     S5/S5
3. Unplug AC after A.2 then plug in AC: S5/S5
4. Press PB in S5:                      BOOT/BOOT

B. Software reboot (type-c/BJ)
1. Run EC reboot command in S0:        BOOT/BOOT
2. Run EC reboot command in S5:        BOOT/BOOT
3. Run EC reboot ap-off command in S0: S5/S5
4. Run EC reboot ap-off command in S5: S5/S5
5. Run host reboot command:            BOOT/BOOT
6. Run host shutdown command:          S5/S5

C. Recovery tests
1. Press RB and PB in S0:                        FAIL(*1)/PASS
2. Press RB and PB in S5:                        FAIL(*1)/PASS(*2)
3. Unplug AC in S0 then press RB and plug in AC: PASS/PASS
4. Unplug AC in S5 then press RB and plug in AC: PASS(*2)/PASS(*2)

*1: b:63668669
*2: b:63669512. Requires one more PB press.

Change-Id: I28f37fdad7f83d0d44570b9003e8c6a4b83b832f
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/568699
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-07-14 04:01:45 -07:00

49 lines
1.3 KiB
C

/* Copyright 2017 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.
*/
#include "common.h"
#include "vb21_struct.h"
#include "rsa.h"
/**
* Validate key contents.
*
* @param key
* @return EC_SUCCESS or EC_ERROR_*
*/
int vb21_is_packed_key_valid(const struct vb21_packed_key *key);
/**
* Validate signature contents.
*
* @param sig Signature to be validated.
* @param key Key to be used for validating <sig>.
* @return EC_SUCCESS or EC_ERROR_*
*/
int vb21_is_signature_valid(const struct vb21_signature *sig,
const struct vb21_packed_key *key);
/**
* Check data region is filled with ones
*
* @param data Data to be validated.
* @param start Offset where validation starts.
* @param end Offset where validation ends. data[end] won't be checked.
* @return EC_SUCCESS or EC_ERROR_*
*/
int vboot_is_padding_valid(const uint8_t *data, uint32_t start, uint32_t end);
/**
* Verify data by RSA signature
*
* @param data Data to be verified.
* @param len Number of bytes in <data>.
* @param key Key to be used for verification.
* @param sig Signature of <data>
* @return EC_SUCCESS or EC_ERROR_*
*/
int vboot_verify(const uint8_t *data, int len,
const struct rsa_public_key *key, const uint8_t *sig);