summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Lok <ben.lok@mediatek.com>2015-08-20 16:24:59 +0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-08-21 08:10:27 +0000
commitee6663563d721b21b3686f6744424d40efd0d34d (patch)
treeb7ce0a37ffa52fb2a2225d9cc2a7dec96792d3ad
parentc2ebc9e4773c89847165f4ca877e4448604ddfd5 (diff)
downloadchrome-ec-ee6663563d721b21b3686f6744424d40efd0d34d.tar.gz
stm32: spi: clear the spi sleep mask when AP in S3.
The SLEEP_MASK_SPI will not be cleared, if SPI received a bad data. It is possible to block EC to enter deep sleep if AP send a bad packet to EC before AP goto S3/S5. In order to ensure that deep sleep can be enabled, clear SLEEP_MASK_SPI in chipset suspend hook to avoid this situation. BUG=chrome-os-partner:44170 BRANCH=None TEST=manually 1. use AP console command to let AP enter S5: > shutdown -h now 2. check the sleepmask in EC console. > sleepmask sleep mask: 00000000 Change-Id: Ib5f5c421c123d9a3c2cc6fead07c8fa515e452f1 Signed-off-by: Ben Lok <ben.lok@mediatek.com> Reviewed-on: https://chromium-review.googlesource.com/294432 Reviewed-by: Rong Chang <rongchang@chromium.org>
-rw-r--r--chip/stm32/spi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/chip/stm32/spi.c b/chip/stm32/spi.c
index a4a8e9febc..2218df6f66 100644
--- a/chip/stm32/spi.c
+++ b/chip/stm32/spi.c
@@ -622,6 +622,9 @@ static void spi_chipset_shutdown(void)
/* Set SPI pins to inputs so we don't leak power when AP is off */
gpio_config_module(MODULE_SPI, 0);
+
+ /* Allow deep sleep when AP off */
+ enable_sleep(SLEEP_MASK_SPI);
}
DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, spi_chipset_shutdown, HOOK_PRIO_DEFAULT);