diff options
author | Randall Spangler <rspangler@chromium.org> | 2012-10-29 10:48:13 -0700 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-11-01 12:45:28 -0700 |
commit | e9e02762dd4b09060911bda9b160502a8f36d4fd (patch) | |
tree | 8847133693a1a089e918bbf58bac4d507ac07dbf /include/chipset.h | |
parent | d83f42bdc8b61773efc17e0194e5abe26109128d (diff) | |
download | chrome-ec-e9e02762dd4b09060911bda9b160502a8f36d4fd.tar.gz |
Move reset/overheat/shutdown funcs to chipset interface
They're not x86-specific, so move to the chipset interface.
BUG=chrome-os-partner:15579
BRANCH=none
TEST=x86reset warm, then x86reset cold. Should reboot OS in each case.
Change-Id: Ib571ab916bab16179198a0d054320e59afbae124
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36785
Diffstat (limited to 'include/chipset.h')
-rw-r--r-- | include/chipset.h | 52 |
1 files changed, 43 insertions, 9 deletions
diff --git a/include/chipset.h b/include/chipset.h index b2f8897ea9..e652ec23d8 100644 --- a/include/chipset.h +++ b/include/chipset.h @@ -3,23 +3,27 @@ * found in the LICENSE file. */ -/* Chipset module for Chrome EC. +/* + * Chipset module for Chrome EC. * * This is intended to be a platform/chipset-neutral interface, implemented by - * all main chipsets (x86, gaia, etc.). */ + * all main chipsets (x86, gaia, etc.). + */ #ifndef __CROS_EC_CHIPSET_H #define __CROS_EC_CHIPSET_H #include "common.h" -/* Chipset state mask +/* + * Chipset state mask * * Note that this is a non-exhaustive list of states which the main chipset can * be in, and is potentially one-to-many for real, underlying chipset states. * That's why chipset_in_state() asks "Is the chipset in something * approximating this state?" and not "Tell me what state the chipset is in and - * I'll compare it myself with the state(s) I want." */ + * I'll compare it myself with the state(s) I want." + */ enum chipset_state_mask { CHIPSET_STATE_HARD_OFF = 0x01, /* Hard off (G3) */ CHIPSET_STATE_SOFT_OFF = 0x02, /* Soft off (S5) */ @@ -30,15 +34,45 @@ enum chipset_state_mask { CHIPSET_STATE_SOFT_OFF), /* Any off state */ }; -/* Return non-zero if the chipset is in one of the states specified in the - * mask. */ +/** + * Check if chipset is in a given state. + * + * @param state_mask Combination of one or more CHIPSET_STATE_* flags. + * + * @return non-zero if the chipset is in one of the states specified in the + * mask. + */ int chipset_in_state(int state_mask); -/* Ask the chipset to exit the hard off state. Does nothing if the chipset has - * already left the state, or was not in the state to begin with. */ +/** + * Ask the chipset to exit the hard off state. + * + * Does nothing if the chipset has already left the state, or was not in the + * state to begin with. + */ void chipset_exit_hard_off(void); -/* Enable/disable CPU throttling. */ +/** + * Enable/disable CPU throttling. + * + * @param throttle Enable (!=0) or disable(0) throttling + */ void chipset_throttle_cpu(int throttle); +/** + * Immedaitely shut off power to main processor and chipset. + * + * This is intended for use when the system is too hot or battery power is + * critical. + */ +void chipset_force_shutdown(void); + +/** + * Reset the CPU and/or chipset. + * + * @param cold_reset If !=0, force a cold reset of the CPU and chipset; + * if 0, just pulse the reset line to the CPU. + */ +void chipset_reset(int cold_reset); + #endif /* __CROS_EC_CHIPSET_H */ |