diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2017-02-16 11:12:13 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-02-18 17:26:59 -0800 |
commit | 2062c99cd2bfe1642433b2cae33c617e02c27cdd (patch) | |
tree | 3aadc63a34b9b5e6f196a8cf0a3db17ad32bdbf9 /chip | |
parent | bb184acdccff14a526b67eed9a8eae9dfb7431b6 (diff) | |
download | chrome-ec-2062c99cd2bfe1642433b2cae33c617e02c27cdd.tar.gz |
cleanup: Move chip/g-specific system() prototypes to system_chip.h
BUG=chromium:693148
BRANCH=None
TEST=`make buildall -j`
Change-Id: I7a758e6b5a04721d0422cfe8b767d85abddb1ad2
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/444264
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r-- | chip/g/system_chip.h | 47 | ||||
-rw-r--r-- | chip/g/upgrade_fw.c | 3 |
2 files changed, 49 insertions, 1 deletions
diff --git a/chip/g/system_chip.h b/chip/g/system_chip.h new file mode 100644 index 0000000000..5d2576a722 --- /dev/null +++ b/chip/g/system_chip.h @@ -0,0 +1,47 @@ +/* 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. + */ + +/* chip/g-specific system function prototypes */ + +#ifndef __CROS_EC_SYSTEM_CHIP_H +#define __CROS_EC_SYSTEM_CHIP_H + +/** + * On systems with protection from a failing RW update: read the retry counter + * and act on it. + * + * @return EC_SUCCESS if no flash write errors were encounterd. + */ +int system_process_retry_counter(void); + +/** + * On systems with protection from a failing RW update: reset retry + * counter, this is used after a new image upload is finished, to make + * sure that the new image has a chance to run. + */ +void system_clear_retry_counter(void); + +/** + * A function provided by some platforms to hint that something is going + * wrong. + * + * @return a boolean, set to True if rolling reboot condition is suspected. + */ +int system_rolling_reboot_suspected(void); + +/** + * Compare the rw headers to check if there was a rollback. + * + * @return a boolean, set to True if a rollback is detected. + */ +int system_rollback_detected(void); + +/** + * Returns non-zero value when firmware is expected to be abe to detect user + * request to cut off battery supply. + */ +int system_battery_cutoff_support_required(void); + +#endif /* __CROS_EC_SYSTEM_CHIP_H */ diff --git a/chip/g/upgrade_fw.c b/chip/g/upgrade_fw.c index d5be0f4491..6d351c5ba0 100644 --- a/chip/g/upgrade_fw.c +++ b/chip/g/upgrade_fw.c @@ -4,13 +4,14 @@ */ #include "byteorder.h" +#include "compile_time_macros.h" #include "console.h" #include "dcrypto/dcrypto.h" #include "extension.h" #include "flash.h" #include "hooks.h" -#include "include/compile_time_macros.h" #include "system.h" +#include "system_chip.h" #include "registers.h" #include "uart.h" |