diff options
author | Weiyi Lu <weiyi.lu@mediatek.com> | 2021-02-03 17:41:32 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-03-05 04:21:09 +0000 |
commit | 954151e1776cf103a949ade16e14b9fcd4d3b690 (patch) | |
tree | 6e6ecdd180deca3e796a42a9046a6a136377028e | |
parent | cc7967db8534567b4ed9d23eaf293a00a411986a (diff) | |
download | chrome-ec-954151e1776cf103a949ade16e14b9fcd4d3b690.tar.gz |
mt8192_scp/clock: Use ULPOSC1 when AP suspend
Uses ULPOSC1(260/2MHz) when AP suspend(0.575V <= Vcore <= 0.6V)
TEST=suspend/resume ok
BUG=b:176317491
Signed-off-by: Weiyi Lu <weiyi.lu@mediatek.com>
Change-Id: I6fa604f1663539dc108e3c52775054ecc64a8021
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2671264
Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
Reviewed-by: Tzung-Bi Shih <tzungbi@chromium.org>
Commit-Queue: Tzung-Bi Shih <tzungbi@chromium.org>
Tested-by: Tzung-Bi Shih <tzungbi@chromium.org>
-rw-r--r-- | board/asurada_scp/board.h | 2 | ||||
-rw-r--r-- | chip/mt8192_scp/ipi.c | 16 |
2 files changed, 18 insertions, 0 deletions
diff --git a/board/asurada_scp/board.h b/board/asurada_scp/board.h index 1648862275..b945a048c0 100644 --- a/board/asurada_scp/board.h +++ b/board/asurada_scp/board.h @@ -71,6 +71,8 @@ #define CONFIG_DRAM_BASE_LOAD 0x50000000 #define CONFIG_DRAM_SIZE 0x01400000 /* 20 MB */ +#define CONFIG_POWER_TRACK_HOST_SLEEP_STATE + #ifndef __ASSEMBLER__ #include "gpio_signal.h" #endif /* !__ASSEMBLER__ */ diff --git a/chip/mt8192_scp/ipi.c b/chip/mt8192_scp/ipi.c index 39fcc09809..d7c7248760 100644 --- a/chip/mt8192_scp/ipi.c +++ b/chip/mt8192_scp/ipi.c @@ -4,11 +4,14 @@ */ #include "atomic.h" +#include "clock.h" +#include "clock_chip.h" #include "common.h" #include "console.h" #include "hooks.h" #include "hostcmd.h" #include "ipi_chip.h" +#include "power.h" #include "registers.h" #include "system.h" #include "task.h" @@ -54,6 +57,19 @@ static void ipi_wake_ap(int32_t id) SCP_SCP2SPM_IPC_SET = IPC_SCP2HOST; } +__override void +power_chipset_handle_host_sleep_event(enum host_sleep_event state, + struct host_sleep_event_context *ctx) +{ + if (state == HOST_SLEEP_EVENT_S3_SUSPEND) { + ccprints("AP suspend"); + clock_select_clock(SCP_CLK_ULPOSC1); + } else if (state == HOST_SLEEP_EVENT_S3_RESUME) { + ccprints("AP resume"); + clock_select_clock(SCP_CLK_ULPOSC2); + } +} + int ipi_send(int32_t id, const void *buf, uint32_t len, int wait) { int ret; |