diff options
-rw-r--r-- | board/cr50/board.c | 1 | ||||
-rw-r--r-- | board/cr50/wp.c | 1 | ||||
-rw-r--r-- | chip/g/system_chip.h | 47 | ||||
-rw-r--r-- | chip/g/upgrade_fw.c | 3 | ||||
-rw-r--r-- | common/tpm_registers.c | 1 | ||||
-rw-r--r-- | include/system.h | 36 |
6 files changed, 52 insertions, 37 deletions
diff --git a/board/cr50/board.c b/board/cr50/board.c index 7b41dd0ef8..695bd75d03 100644 --- a/board/cr50/board.c +++ b/board/cr50/board.c @@ -26,6 +26,7 @@ #include "signed_header.h" #include "spi.h" #include "system.h" +#include "system_chip.h" #include "task.h" #include "tpm_registers.h" #include "trng.h" diff --git a/board/cr50/wp.c b/board/cr50/wp.c index eb1d01155e..e980efdf0b 100644 --- a/board/cr50/wp.c +++ b/board/cr50/wp.c @@ -12,6 +12,7 @@ #include "registers.h" #include "scratch_reg1.h" #include "system.h" +#include "system_chip.h" #include "task.h" #include "timer.h" #include "tpm_registers.h" 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" diff --git a/common/tpm_registers.c b/common/tpm_registers.c index e2e286136f..a70fd0e028 100644 --- a/common/tpm_registers.c +++ b/common/tpm_registers.c @@ -18,6 +18,7 @@ #include "printf.h" #include "signed_header.h" #include "system.h" +#include "system_chip.h" #include "task.h" #include "tpm_manufacture.h" #include "tpm_registers.h" diff --git a/include/system.h b/include/system.h index 4b95e59c70..9cb04844ed 100644 --- a/include/system.h +++ b/include/system.h @@ -476,40 +476,4 @@ uintptr_t system_get_fw_reset_vector(uintptr_t base); */ int system_is_reboot_warm(void); -/** - * 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_H */ |