diff options
author | CHLin <CHLIN56@nuvoton.com> | 2019-10-07 17:19:00 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-10-08 04:50:03 +0000 |
commit | dc2e624d8387c34da2ea65a916985a147c814a48 (patch) | |
tree | 5bb25b551162d0f5b447cff700cc1d86e4309193 | |
parent | f3d7d6be01ff72eff6e7ddc970e605513c7ece54 (diff) | |
download | chrome-ec-dc2e624d8387c34da2ea65a916985a147c814a48.tar.gz |
npcx: espi: clear pending bit while setting VW interrupt
According to the datasheet, firmware should clear MIWU pending register
(WKPND) after configuring WKMOD/WKEDG/WKAED register and before
enabling WKEN register. Otherwise, the module might cause a false
wake-up or interrupt event.
BUG=b:141730279
BRANCH=none
TEST=No error for "make buildall"
TEST=Test on yorp, check the fake virtual wire events are no longer
generated and the system crash symptom is fixed when CONFIG_BRINGUP
is defined.
Change-Id: I89e055b4174419658cdd823f04acff41aa14cfe6
Signed-off-by: CHLin <CHLIN56@nuvoton.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1844660
Reviewed-by: Edward Hill <ecgh@chromium.org>
Commit-Queue: Edward Hill <ecgh@chromium.org>
Tested-by: Edward Hill <ecgh@chromium.org>
-rw-r--r-- | chip/npcx/espi.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/chip/npcx/espi.c b/chip/npcx/espi.c index d092327aed..5dc7e258cf 100644 --- a/chip/npcx/espi.c +++ b/chip/npcx/espi.c @@ -233,6 +233,9 @@ static void espi_enable_vw_int(const struct host_wui_item *vwire_int) /* enable Any Edge */ SET_BIT(NPCX_WKAEDG(table, group), num); + /* Clear the pending bit */ + NPCX_WKPCL(table, group) = BIT(num); + /* Enable wake-up input sources */ SET_BIT(NPCX_WKEN(table, group), num); } |