mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-28 10:45:22 +00:00
This patch makes EC enable PD communication if it's running in manual recovery mode. This is required to show recovery screen on a type-c monitor. This patch also makes EC-EFS ignore power availability. It will make EC verify & jump to RW even if power is sourced by a barrel jack adapter. This should allow depthcharge to show screens (e.g. broken, warning) on a type-c monitor. BUG=b:72387533 BRANCH=none TEST=On Fizz with type-c monitor, verify - Recovery screen is displayed in manual recovery mode. - Critical update screen is displayed in normal mode. - Warning screen is displayed in developer mode. Monitors tested: Dingdong, Dell S2718D Change-Id: Ib53e02d1e5c0f5b2d96d9a02fd33022f92e52b04 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/898346 Reviewed-by: Randall Spangler <rspangler@chromium.org>
61 lines
1.5 KiB
C
61 lines
1.5 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);
|
|
|
|
/**
|
|
* Entry point of EC EFS
|
|
*/
|
|
void vboot_main(void);
|
|
|
|
/**
|
|
* Get if vboot requires PD comm to be enabled or not
|
|
*
|
|
* @return 1: need PD communication. 0: PD communication is not needed.
|
|
*/
|
|
int vboot_need_pd_comm(void);
|