diff options
author | Doug Anderson <dianders@chromium.org> | 2013-08-27 12:55:09 -0700 |
---|---|---|
committer | Caroline Tice <cmtice@chromium.org> | 2013-08-29 22:51:11 +0000 |
commit | 3f4899b6b0e97d6fca4cde0a9bb44c98c258a012 (patch) | |
tree | 658cfe3d4dfce7e12347fb18fd5910904f5e1da7 /core | |
parent | fcd388df8eef2f723cb4ff7277fa44d3754bb966 (diff) | |
download | chrome-ec-3f4899b6b0e97d6fca4cde0a9bb44c98c258a012.tar.gz |
stm32l: Add a "PRE_FREQ_CHANGE" hook to allow other code to prepare
Before this change drivers had no way of knowing that a frequency
change was coming. This could cause problems for some drivers (like
i2c) that need to make sure that a transaction isn't happening while a
frequency change is happening.
The PRE_FREQ_CHANGE archiecture is very simple here and we don't allow
any way to cancel it.
At the moment, we guarantee:
- We won't call PRE_FREQ_CHANGE with interrupts disabled, so acquiring
locks / sleeping is OK.
- We'll call the actual HOOK_FREQ_CHANGE after the PRE_FREQ_CHANGE.
PRE_FREQ_CHANGE and HOOK_FREQ_CHANGE should not use deferred function
calls.
BRANCH=pit
BUG=chrome-os-partner:22093
TEST=With all patches together:
- on AP: suspend_stress_test
- on EC: battery 10000 50
Change-Id: I2731a3e85d41e749fa571fdb74b5c9b12043cda6
Signed-off-by: Doug Anderson <dianders@chromium.org>
Previous-Reviewed-on: https://chromium-review.googlesource.com/167101
(cherry picked from commit d84c0dbbf7c5a72917a820e292ecfdfa698d0fb9)
Reviewed-on: https://chromium-review.googlesource.com/167148
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'core')
-rw-r--r-- | core/cortex-m/ec.lds.S | 4 | ||||
-rw-r--r-- | core/host/host_exe.lds | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/core/cortex-m/ec.lds.S b/core/cortex-m/ec.lds.S index c5d90265ce..115310bc28 100644 --- a/core/cortex-m/ec.lds.S +++ b/core/cortex-m/ec.lds.S @@ -60,6 +60,10 @@ SECTIONS *(.rodata.HOOK_INIT) __hooks_init_end = .; + __hooks_pre_freq_change = .; + *(.rodata.HOOK_PRE_FREQ_CHANGE) + __hooks_pre_freq_change_end = .; + __hooks_freq_change = .; *(.rodata.HOOK_FREQ_CHANGE) __hooks_freq_change_end = .; diff --git a/core/host/host_exe.lds b/core/host/host_exe.lds index 04e605287b..15925213a7 100644 --- a/core/host/host_exe.lds +++ b/core/host/host_exe.lds @@ -24,6 +24,10 @@ SECTIONS { *(.rodata.HOOK_INIT) __hooks_init_end = .; + __hooks_pre_freq_change = .; + *(.rodata.HOOK_PRE_FREQ_CHANGE) + __hooks_pre_freq_change_end = .; + __hooks_freq_change = .; *(.rodata.HOOK_FREQ_CHANGE) __hooks_freq_change_end = .; |