diff options
author | CHLin <CHLIN56@nuvoton.com> | 2019-02-15 17:09:45 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-03-13 10:38:57 -0700 |
commit | e7edd0ebedf85c13a1c97deb302c44655f4ca2d9 (patch) | |
tree | 18073b66e14d07fb5faef2c1cc423272b3498811 /common | |
parent | 9e9a032fa4c345d42fa23dfec7b4fe17e340951a (diff) | |
download | chrome-ec-e7edd0ebedf85c13a1c97deb302c44655f4ca2d9.tar.gz |
clock: define the function clock_enable_module to all EC chips
The API clock_enable_module(MODULE_FAST_CPU, x) allows common layer code
to set the CPU frequency to turbo or normal when it is needed.
However, not all of the EC chips support/implement the function. It
causes build error if this function is added to the common codes which
most of EC chips will use (EX: vboot_hash.) This CL fixes this issue by
defining the function as weak by default.
This CL also implements the clock_enable_module function for NPCX7 chip.
BRANCH=none
BUG=b:77608104
TEST=pass "make buildall"
TEST=on npcx7_evb/yorp, with follow-up CL, check that security
computation becomes faster and the clock goes back to normal frequency
after the computation finishes.
Change-Id: I731fb38f5fc1a4efa5fb331a59f8c3e2803ca30a
Signed-off-by: CHLin <CHLIN56@nuvoton.com>
Reviewed-on: https://chromium-review.googlesource.com/1475097
Commit-Ready: CH Lin <chlin56@nuvoton.com>
Tested-by: CH Lin <chlin56@nuvoton.com>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/system.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/common/system.c b/common/system.c index 6cd5702c30..467218560a 100644 --- a/common/system.c +++ b/common/system.c @@ -1632,3 +1632,13 @@ int board_write_serial(const char *serialno) } #endif #endif /* CONFIG_SERIALNO_LEN */ + + +__attribute__((weak)) +void clock_enable_module(enum module_id module, int enable) +{ + /* + * Default weak implementation - for chips that don't support this + * function. + */ +} |