diff options
author | Bill Richardson <wfrichar@chromium.org> | 2013-07-19 14:00:51 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-07-25 19:02:09 -0700 |
commit | ac78e589af2fd74c36b570130dd0dde03f35e572 (patch) | |
tree | 455fd7a83bcac686cc651912ff8e9274fefa78f4 /common | |
parent | 245275f4b67a45276aed3a79ee405d91cc1ccef5 (diff) | |
download | chrome-ec-ac78e589af2fd74c36b570130dd0dde03f35e572.tar.gz |
Add new hostevents to ask the AP to throttle itself
Occasionally the EC wants to ask the AP to throttle itself. Currently, the
only thing that the EC can do (at least on x86) is to assert the PROCHOT#
signal, which is a fairly intrusive operation and one that Intel suggests we
save for emergencies.
This CL adds a new pair of host events to ask the BIOS to throttle the AP
politely, or stop doing so. The turbo charger code will send these events to
the AP if they become necessary.
BUG=chrome-os-partner:20739
BRANCH=falco,peppy
TEST=manual
Tests should still pass, everything else is unchanged.
make BOARD=${BOARD} runtests
Currently, there's nothing on the BIOS/OS side that would respond to these
events, so they're just ignored. You can test that, even without this CL, by
running
hostevent set 0x40000
hostevent set 0x80000
Change-Id: I4a7a1b6eb87e42df94ddd09f4c6abee6ebcbd485
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63379
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/extpower_falco.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/common/extpower_falco.c b/common/extpower_falco.c index dec406703b..4f2daedeaf 100644 --- a/common/extpower_falco.c +++ b/common/extpower_falco.c @@ -185,9 +185,19 @@ bad: CPRINTF("[%T ERROR: can't talk to charger: %d]\n", r); } +/* FIXME: There's already a chipset_throttle_cpu() function. However, it's a + * fairly large hammer - on x86, it just asserts PROCHOT. That's less than + * ideal for the turbo boost charger stuff. We might want to make this + * function generic enough to use from other places. For now, meh. */ test_export_static int ap_is_throttled; static void set_throttle(int on) { + if (on) + host_set_events(EC_HOST_EVENT_MASK( + EC_HOST_EVENT_THROTTLE_START)); + else + host_set_events(EC_HOST_EVENT_MASK( + EC_HOST_EVENT_THROTTLE_STOP)); ap_is_throttled = on; } |